diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2016-01-17 08:51:57 -0800 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-01-17 08:51:57 -0800 |
commit | 4ece7cfa9b0f090a2e30d1b5dc4770c64a392546 (patch) | |
tree | b47ae059bec21c9da0d55860bc22e58ce41828f8 /gr-analog/python/analog/nbfm_tx.py | |
parent | f44e66c9c21062037db19b8fd98f33984dff36e0 (diff) | |
parent | 688ca0d1749d6dcfe6a24bfa13a6d5bb2ceefedf (diff) |
Merge remote-tracking branch 'tom/nbfm' into maint
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Diffstat (limited to 'gr-analog/python/analog/nbfm_tx.py')
-rw-r--r-- | gr-analog/python/analog/nbfm_tx.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gr-analog/python/analog/nbfm_tx.py b/gr-analog/python/analog/nbfm_tx.py index 62b56bae52..ffd539ec55 100644 --- a/gr-analog/python/analog/nbfm_tx.py +++ b/gr-analog/python/analog/nbfm_tx.py @@ -50,8 +50,8 @@ class nbfm_tx(gr.hier_block2): gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature # FIXME audio_rate and quad_rate ought to be exact rationals - audio_rate = int(audio_rate) - quad_rate = int(quad_rate) + self._audio_rate = audio_rate = int(audio_rate) + self._quad_rate = quad_rate = int(quad_rate) if quad_rate % audio_rate != 0: raise ValueError, "quad_rate is not an integer multiple of audio_rate" @@ -81,6 +81,11 @@ class nbfm_tx(gr.hier_block2): else: self.connect(self, self.preemph, self.modulator, self) + def set_max_deviation(self, max_dev): + k = 2 * math.pi * max_dev / self._quad_rate + self.modulator.set_sensitivity(k) + + class ctcss_gen_f(gr.hier_block2): def __init__(self, sample_rate, tone_freq): |