diff options
Diffstat (limited to 'grc')
8 files changed, 119 insertions, 15 deletions
diff --git a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml index 279f65765..639f96cf4 100644 --- a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml +++ b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml @@ -76,6 +76,7 @@ self.$(id).set_lo_offset($lo_offset) <param> <name>Gain (dB)</name> <key>gain</key> + <value>0</value> <type>real</type> </param> <sink> diff --git a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml index 5ec45aeba..6c776d0ad 100644 --- a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml +++ b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml @@ -62,7 +62,7 @@ self.$(id).set_lo_offset($lo_offset) <key>frequency</key> <type>real</type> </param> - <param> + <param> <name>LO Offset (Hz)</name> <key>lo_offset</key> <value>float('inf')</value> @@ -76,6 +76,7 @@ self.$(id).set_lo_offset($lo_offset) <param> <name>Gain (dB)</name> <key>gain</key> + <value>0</value> <type>real</type> </param> <source> diff --git a/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml b/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml index d87d14703..8f418becd 100644 --- a/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml +++ b/grc/data/platforms/python/blocks/usrp_dual_sink_x.xml @@ -14,6 +14,12 @@ self.$(id).set_frequency_a($frequency_a, verbose=True) self.$(id).set_frequency_b($frequency_b, verbose=True) self.$(id).set_gain_a($gain_a) self.$(id).set_gain_b($gain_b) +#if $lo_offset_a() != float('inf') +self.$(id).set_lo_offset_a($lo_offset_a) +#end if +#if $lo_offset_b() != float('inf') +self.$(id).set_lo_offset_b($lo_offset_b) +#end if ################################################## ## Flex RF A ################################################## @@ -64,23 +70,47 @@ self.$(id).set_auto_tr_b(True) <type>int</type> </param> <param> - <name>Frequency A</name> + <name>Frequency A (Hz)</name> <key>frequency_a</key> <type>real</type> </param> <param> - <name>Frequency B</name> + <name>Frequency B (Hz)</name> <key>frequency_b</key> <type>real</type> </param> <param> - <name>Gain A</name> + <name>LO Offset A (Hz)</name> + <key>lo_offset_a</key> + <value>float('inf')</value> + <type>real</type> + <hide>#if $lo_offset_a() == float('inf') then 'part' else 'none'#</hide> + <option> + <name>Default</name> + <key>float('inf')</key> + </option> + </param> + <param> + <name>LO Offset B (Hz)</name> + <key>lo_offset_b</key> + <value>float('inf')</value> + <type>real</type> + <hide>#if $lo_offset_b() == float('inf') then 'part' else 'none'#</hide> + <option> + <name>Default</name> + <key>float('inf')</key> + </option> + </param> + <param> + <name>Gain A (dB)</name> <key>gain_a</key> + <value>0</value> <type>real</type> </param> <param> - <name>Gain B</name> + <name>Gain B (dB)</name> <key>gain_b</key> + <value>0</value> <type>real</type> </param> <!-- @@ -154,6 +184,8 @@ self.$(id).set_auto_tr_b(True) <doc> The USRP sink inputs 128 Megasamples per second / interpolation. +Input amplitude should be between 0 and 32767. + Flex RF boards only: The "Transmit Setting" must be configured. \ When set to "Enable" the transmitter is always on. \ When set to "Auto Transmit/Receive", the transmitter is disabled while receiving. diff --git a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml index cb75fcead..740895d42 100644 --- a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml +++ b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml @@ -16,7 +16,13 @@ self.$(id).set_decim_rate($decimation) self.$(id).set_frequency_a($frequency_a, verbose=True) self.$(id).set_frequency_b($frequency_b, verbose=True) self.$(id).set_gain_a($gain_a) -self.$(id).set_gain_b($gain_b)</make> +self.$(id).set_gain_b($gain_b) +#if $lo_offset_a() != float('inf') +self.$(id).set_lo_offset_a($lo_offset_a) +#end if +#if $lo_offset_b() != float('inf') +self.$(id).set_lo_offset_b($lo_offset_b) +#end if</make> <callback>set_decim_rate($decimation)</callback> <callback>set_frequency_a($frequency_a)</callback> <callback>set_frequency_b($frequency_b)</callback> @@ -68,23 +74,47 @@ self.$(id).set_gain_b($gain_b)</make> <type>int</type> </param> <param> - <name>Frequency A</name> + <name>Frequency A (Hz)</name> <key>frequency_a</key> <type>real</type> </param> <param> - <name>Frequency B</name> + <name>Frequency B (Hz)</name> <key>frequency_b</key> <type>real</type> </param> <param> - <name>Gain A</name> + <name>LO Offset A (Hz)</name> + <key>lo_offset_a</key> + <value>float('inf')</value> + <type>real</type> + <hide>#if $lo_offset_a() == float('inf') then 'part' else 'none'#</hide> + <option> + <name>Default</name> + <key>float('inf')</key> + </option> + </param> + <param> + <name>LO Offset B (Hz)</name> + <key>lo_offset_b</key> + <value>float('inf')</value> + <type>real</type> + <hide>#if $lo_offset_b() == float('inf') then 'part' else 'none'#</hide> + <option> + <name>Default</name> + <key>float('inf')</key> + </option> + </param> + <param> + <name>Gain A (dB)</name> <key>gain_a</key> + <value>0</value> <type>real</type> </param> <param> - <name>Gain B</name> + <name>Gain B (dB)</name> <key>gain_b</key> + <value>0</value> <type>real</type> </param> <!-- diff --git a/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml b/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml index 0c7fc53da..f3ccf1263 100644 --- a/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml +++ b/grc/data/platforms/python/blocks/usrp_simple_sink_x.xml @@ -17,7 +17,11 @@ self.$(id).set_enable(True) #end if #if $transmit.auto_tr self.$(id).set_auto_tr(True) +#end if +#if $lo_offset() != float('inf') +self.$(id).set_lo_offset($lo_offset) #end if</make> + <callback>set_lo_offset($lo_offset)</callback> <callback>set_interp_rate($interpolation)</callback> <callback>set_frequency($frequency)</callback> <callback>set_gain($gain)</callback> @@ -48,13 +52,25 @@ self.$(id).set_auto_tr(True) <type>int</type> </param> <param> - <name>Frequency</name> + <name>Frequency (Hz)</name> <key>frequency</key> <type>real</type> </param> <param> - <name>Gain</name> + <name>LO Offset (Hz)</name> + <key>lo_offset</key> + <value>float('inf')</value> + <type>real</type> + <hide>#if $lo_offset() == float('inf') then 'part' else 'none'#</hide> + <option> + <name>Default</name> + <key>float('inf')</key> + </option> + </param> + <param> + <name>Gain (dB)</name> <key>gain</key> + <value>0</value> <type>real</type> </param> <param> @@ -103,6 +119,8 @@ self.$(id).set_auto_tr(True) <doc> The USRP sink inputs 128 Megasamples per second / interpolation. +Input amplitude should be between 0 and 32767. + Flex RF boards only: The "Transmit Setting" must be configured. \ When set to "Enable" the transmitter is always on. \ When set to "Auto Transmit/Receive", the transmitter is disabled while receiving. diff --git a/grc/data/platforms/python/blocks/usrp_simple_source_x.xml b/grc/data/platforms/python/blocks/usrp_simple_source_x.xml index 8d7b9533d..1a777bd63 100644 --- a/grc/data/platforms/python/blocks/usrp_simple_source_x.xml +++ b/grc/data/platforms/python/blocks/usrp_simple_source_x.xml @@ -14,7 +14,11 @@ self.$(id).set_format(width=$format.width, shift=$format.shift) #end if self.$(id).set_decim_rate($decimation) self.$(id).set_frequency($frequency, verbose=True) -self.$(id).set_gain($gain)</make> +self.$(id).set_gain($gain) +#if $lo_offset() != float('inf') +self.$(id).set_lo_offset($lo_offset) +#end if</make> + <callback>set_lo_offset($lo_offset)</callback> <callback>set_decim_rate($decimation)</callback> <callback>set_frequency($frequency)</callback> <callback>set_gain($gain)</callback> @@ -64,13 +68,25 @@ self.$(id).set_gain($gain)</make> <type>int</type> </param> <param> - <name>Frequency</name> + <name>Frequency (Hz)</name> <key>frequency</key> <type>real</type> </param> <param> - <name>Gain</name> + <name>LO Offset (Hz)</name> + <key>lo_offset</key> + <value>float('inf')</value> + <type>real</type> + <hide>#if $lo_offset() == float('inf') then 'part' else 'none'#</hide> + <option> + <name>Default</name> + <key>float('inf')</key> + </option> + </param> + <param> + <name>Gain (dB)</name> <key>gain</key> + <value>0</value> <type>real</type> </param> <param> diff --git a/grc/src/grc_gnuradio/usrp/dual_usrp.py b/grc/src/grc_gnuradio/usrp/dual_usrp.py index f12b5348d..1ecf7c47f 100644 --- a/grc/src/grc_gnuradio/usrp/dual_usrp.py +++ b/grc/src/grc_gnuradio/usrp/dual_usrp.py @@ -67,6 +67,8 @@ class _dual_source(gr.hier_block2): frequency=frequency, verbose=verbose, ) + def set_lo_offset_a(self, lo_offset): self._subdev_a.set_lo_offset(lo_offset) + def set_lo_offset_b(self, lo_offset): self._subdev_b.set_lo_offset(lo_offset) def set_gain_a(self, gain): self._subdev_a.set_gain(gain) def set_gain_b(self, gain): self._subdev_b.set_gain(gain) @@ -117,6 +119,8 @@ class _dual_sink(gr.hier_block2): frequency=frequency, verbose=verbose, ) + def set_lo_offset_a(self, lo_offset): self._subdev_a.set_lo_offset(lo_offset) + def set_lo_offset_b(self, lo_offset): self._subdev_b.set_lo_offset(lo_offset) def set_gain_a(self, gain): self._subdev_a.set_gain(gain) def set_gain_b(self, gain): self._subdev_b.set_gain(gain) def set_enable_a(self, enable): self._subdev_a.set_enable(enable) diff --git a/grc/src/grc_gnuradio/usrp/simple_usrp.py b/grc/src/grc_gnuradio/usrp/simple_usrp.py index 58683433e..9065c7fe9 100644 --- a/grc/src/grc_gnuradio/usrp/simple_usrp.py +++ b/grc/src/grc_gnuradio/usrp/simple_usrp.py @@ -56,6 +56,7 @@ class _simple_source(gr.hier_block2): self._get_u().set_decim_rate(int(decim)) if self._no_hb: #set the BW to half the sample rate self._subdev.set_bw(self._get_u().converter_rate()/decim/2) + def set_lo_offset(self, lo_offset): self._subdev.set_lo_offset(lo_offset) def set_frequency(self, frequency, verbose=False): self._set_frequency( chan=0, #ddc0 @@ -102,6 +103,7 @@ class _simple_sink(gr.hier_block2): frequency=frequency, verbose=verbose, ) + def set_lo_offset(self, lo_offset): self._subdev.set_lo_offset(lo_offset) def set_gain(self, gain): self._subdev.set_gain(gain) def set_enable(self, enable): self._subdev.set_enable(enable) def set_auto_tr(self, auto_tr): self._subdev.set_auto_tr(auto_tr) |