diff --git a/apps/osmosdr_source.grc b/apps/osmosdr_source.grc index e661ae1..446f015 100644 --- a/apps/osmosdr_source.grc +++ b/apps/osmosdr_source.grc @@ -1,6 +1,6 @@ - Fri Apr 6 15:57:44 2012 + Wed Apr 11 17:53:04 2012 options @@ -56,29 +56,6 @@ 0 - - variable - - id - samp_rate - - - _enabled - True - - - value - 2048e3 - - - _coordinate - (39, 137) - - - _rotation - 0 - - variable_slider @@ -134,41 +111,6 @@ 0 - - osmosdr_source_c - - id - osmosdr_source_c_0 - - - _enabled - True - - - args - - - - freq - freq - - - rate - samp_rate - - - gain - gain - - - _coordinate - (284, 297) - - - _rotation - 0 - - variable_slider @@ -311,6 +253,123 @@ 0 + + variable + + id + samp_rate + + + _enabled + True + + + value + samplerate + + + _coordinate + (39, 137) + + + _rotation + 0 + + + + osmosdr_source_c + + id + osmosdr_source_c_0 + + + _enabled + True + + + args + + + + freq + freq + + + freq_corr + 0 + + + rate + samplerate + + + gain + gain + + + _coordinate + (278, 276) + + + _rotation + 0 + + + + variable_slider + + id + samplerate + + + _enabled + True + + + label + + + + value + 2048e3 + + + min + 1e6 + + + max + 3.2e6 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (40, 237) + + + _rotation + 0 + + osmosdr_source_c_0 wxgui_fftsink2_0 diff --git a/apps/osmosdr_source.py b/apps/osmosdr_source.py index f2ed63d..e7c3120 100755 --- a/apps/osmosdr_source.py +++ b/apps/osmosdr_source.py @@ -22,14 +22,15 @@ class osmosdr_source_c(grc_wxgui.top_block_gui): self.src = osmosdr.source_c() - self.src.set_samp_rate(1024000) - self.src.set_center_freq(392.8e6) + self.src.set_sample_rate(1024000) + self.src.set_center_freq(394.5e6) self.src.set_gain(10) ################################################## # Variables ################################################## - self.samp_rate = samp_rate = self.src.get_samp_rate() + self.sample_rate = self.src.get_sample_rate() + self.center_freq = self.src.get_center_freq() ################################################## # Blocks @@ -37,11 +38,12 @@ class osmosdr_source_c(grc_wxgui.top_block_gui): self.sink = fftsink2.fft_sink_c( self.GetWin(), fft_size=1024, - sample_rate=samp_rate, + baseband_freq=self.center_freq, + sample_rate=self.sample_rate, ref_scale=2.0, ref_level=0, y_divs=10, - fft_rate=15, + fft_rate=10, average=False, avg_alpha=0.5 ) @@ -53,10 +55,13 @@ class osmosdr_source_c(grc_wxgui.top_block_gui): ################################################## self.connect((self.src, 0), (self.sink, 0)) + def set_sample_rate(self, sample_rate): + self.sample_rate = sample_rate + self.sink.set_sample_rate(self.sample_rate) - def set_samp_rate(self, samp_rate): - self.samp_rate = samp_rate - self.sink.set_sample_rate(self.samp_rate) + def set_center_freq(self, center_freq): + self.center_freq = center_freq + self.sink.set_center_freq(self.center_freq) if __name__ == '__main__': parser = OptionParser(option_class=eng_option, usage="%prog: [options]") diff --git a/grc/osmosdr_sink_c.xml b/grc/osmosdr_sink_c.xml index 727abb2..a50cef7 100644 --- a/grc/osmosdr_sink_c.xml +++ b/grc/osmosdr_sink_c.xml @@ -5,9 +5,9 @@ OsmoSDR import osmosdr osmosdr.sink_c() - in complex + 1 diff --git a/grc/osmosdr_source_c.xml b/grc/osmosdr_source_c.xml index 6d8cb15..e343e77 100644 --- a/grc/osmosdr_source_c.xml +++ b/grc/osmosdr_source_c.xml @@ -5,15 +5,19 @@ OsmoSDR import osmosdr osmosdr.source_c($args) +self.$(id).set_sample_rate($rate) self.$(id).set_center_freq($freq) -self.$(id).set_samp_rate($rate) +self.$(id).set_freq_corr($corr) self.$(id).set_gain($gain) +self.$(id).set_antenna($antenna) set_center_freq($freq) - set_samp_rate($rate) + set_freq_corr($corr) + set_sample_rate($rate) set_gain($gain) + set_antenna($antenna) - Device specific arguments + Device arguments args string @@ -25,9 +29,15 @@ self.$(id).set_gain($gain) real - Samplerate (Hz) + Freq. corr. (ppm) + corr + 0 + real + + + Sample rate (Hz) rate - 2048000 + 1024000 real @@ -36,9 +46,41 @@ self.$(id).set_gain($gain) 20.0 real + + Antenna + antenna + + string + ($freq >= 50e6) and ($freq <= 2.2e9) + ($rate >= 1e6) and ($rate <= 3.2e6) out complex + 1 + +The OsmoSDR Source Block: + +Device Arguments: +The device address is a delimited string used to locate devices on your system. +Use the device address to specify a specific device or list of devices. +If left blank, the first device found will be used. + +Frequency: +The center frequency is the overall frequency of the RF chain. + +Frequency correction: +The frequency correction factor in parts per million (ppm). + +Sample rate: +The sample rate is the number of samples per second output by this block. + +Gain: +Overall RF gain of the device. + +Antenna: +For devices with only one antenna, this may be left blank. +Otherwise, the user should specify one of the possible antenna choices. +