Commit 9c0c616efb9da93aa25731ca28d675b108ca649e

Authored by bmarechal
1 parent 6ab860d89c
Exists in master

-

Showing 5 changed files with 49 additions and 43 deletions Side-by-side Diff

redpitaya/client/iq_pid_vco.grc
... ... @@ -305,7 +305,7 @@
305 305 </param>
306 306 <param>
307 307 <key>value</key>
308   - <value>0</value>
  308 + <value>21000000</value>
309 309 </param>
310 310 <param>
311 311 <key>_enabled</key>
... ... @@ -368,7 +368,7 @@
368 368 </param>
369 369 <param>
370 370 <key>value</key>
371   - <value>0</value>
  371 + <value>21000000</value>
372 372 </param>
373 373 <param>
374 374 <key>_enabled</key>
... ... @@ -651,7 +651,7 @@
651 651 </param>
652 652 <param>
653 653 <key>value</key>
654   - <value>0</value>
  654 + <value>42000000</value>
655 655 </param>
656 656 <param>
657 657 <key>_enabled</key>
redpitaya/client/iq_pid_vco.py
... ... @@ -3,7 +3,7 @@
3 3 ##################################################
4 4 # GNU Radio Python Flow Graph
5 5 # Title: Iq Pid Vco
6   -# Generated: Wed Apr 26 19:01:48 2017
  6 +# Generated: Thu Apr 27 16:17:01 2017
7 7 ##################################################
8 8  
9 9 if __name__ == '__main__':
10 10  
... ... @@ -62,13 +62,13 @@
62 62 self.pid_kp = pid_kp = 0
63 63 self.pid_ki = pid_ki = 0
64 64 self.pid_kd = pid_kd = 0
65   - self.demod_nco = demod_nco = 0
  65 + self.demod_nco = demod_nco = 42000000
66 66 self.dds_range = dds_range = 0
67 67 self.dds_poff_sw = dds_poff_sw = 1
68 68 self.dds_pinc_sw = dds_pinc_sw = 1
69 69 self.dds_offset = dds_offset = 0
70   - self.dds_nco = dds_nco = 0
71   - self.dds_f0 = dds_f0 = 0
  70 + self.dds_nco = dds_nco = 21000000
  71 + self.dds_f0 = dds_f0 = 21000000
72 72 self.dds_ampl = dds_ampl = 0
73 73 self.dac2_offset = dac2_offset = 0
74 74 self.addr = addr = "192.168.0.202"
... ... @@ -101,7 +101,7 @@
101 101 self._pid_kd_range = Range(0, 2**13-1, 1, 0, 200)
102 102 self._pid_kd_win = RangeWidget(self._pid_kd_range, self.set_pid_kd, 'pid_kd', "counter_slider", int)
103 103 self.top_grid_layout.addWidget(self._pid_kd_win, 4, 1)
104   - self._demod_nco_range = Range(0, 60000000, 1, 0, 200)
  104 + self._demod_nco_range = Range(0, 60000000, 1, 42000000, 200)
105 105 self._demod_nco_win = RangeWidget(self._demod_nco_range, self.set_demod_nco, 'demod_nco', "counter_slider", int)
106 106 self.top_grid_layout.addWidget(self._demod_nco_win, 3, 4)
107 107 self._dds_range_range = Range(-2**13, 2**13-1, 1, 0, 200)
108 108  
... ... @@ -124,10 +124,10 @@
124 124 self._dds_offset_range = Range(-2**13, 2**13-1, 1, 0, 200)
125 125 self._dds_offset_win = RangeWidget(self._dds_offset_range, self.set_dds_offset, 'dds_offset', "counter_slider", int)
126 126 self.top_grid_layout.addWidget(self._dds_offset_win, 3, 3)
127   - self._dds_nco_range = Range(0, 60000000, 1, 0, 200)
  127 + self._dds_nco_range = Range(0, 60000000, 1, 21000000, 200)
128 128 self._dds_nco_win = RangeWidget(self._dds_nco_range, self.set_dds_nco, 'dds_nco', "counter_slider", int)
129 129 self.top_grid_layout.addWidget(self._dds_nco_win, 2, 3)
130   - self._dds_f0_range = Range(0, 60000000, 1, 0, 200)
  130 + self._dds_f0_range = Range(0, 60000000, 1, 21000000, 200)
131 131 self._dds_f0_win = RangeWidget(self._dds_f0_range, self.set_dds_f0, 'dds_f0', "counter_slider", int)
132 132 self.top_grid_layout.addWidget(self._dds_f0_win, 4, 3)
133 133 self._dds_ampl_range = Range(0, 2**13-1, 1, 0, 200)
redpitaya/client/pid_only.py
... ... @@ -3,7 +3,7 @@
3 3 ##################################################
4 4 # GNU Radio Python Flow Graph
5 5 # Title: Pid Only
6   -# Generated: Wed Apr 19 09:35:59 2017
  6 +# Generated: Thu Apr 27 15:50:24 2017
7 7 ##################################################
8 8  
9 9 if __name__ == '__main__':
sdr/fm_radio/fm_radio.grc
... ... @@ -89,7 +89,7 @@
89 89 </param>
90 90 <param>
91 91 <key>value</key>
92   - <value>160011000</value>
  92 + <value>158000000</value>
93 93 </param>
94 94 <param>
95 95 <key>_enabled</key>
... ... @@ -215,7 +215,7 @@
215 215 </param>
216 216 <param>
217 217 <key>quad_rate</key>
218   - <value>samp_rate*10</value>
  218 + <value>samp_rate*8</value>
219 219 </param>
220 220 </block>
221 221 <block>
... ... @@ -340,7 +340,7 @@
340 340 </param>
341 341 <param>
342 342 <key>_enabled</key>
343   - <value>1</value>
  343 + <value>0</value>
344 344 </param>
345 345 <param>
346 346 <key>type</key>
... ... @@ -376,7 +376,7 @@
376 376 </param>
377 377 <param>
378 378 <key>samp_rate</key>
379   - <value>samp_rate*10*4</value>
  379 + <value>samp_rate*8*4</value>
380 380 </param>
381 381 <param>
382 382 <key>width</key>
... ... @@ -415,7 +415,7 @@
415 415 </param>
416 416 <param>
417 417 <key>_enabled</key>
418   - <value>1</value>
  418 + <value>0</value>
419 419 </param>
420 420 <param>
421 421 <key>type</key>
... ... @@ -451,7 +451,7 @@
451 451 </param>
452 452 <param>
453 453 <key>samp_rate</key>
454   - <value>samp_rate*10</value>
  454 + <value>samp_rate*8</value>
455 455 </param>
456 456 <param>
457 457 <key>width</key>
... ... @@ -466,7 +466,7 @@
466 466 <key>qtgui_sink_x</key>
467 467 <param>
468 468 <key>bw</key>
469   - <value>samp_rate*10*4</value>
  469 + <value>samp_rate*8*4</value>
470 470 </param>
471 471 <param>
472 472 <key>alias</key>
... ... @@ -565,7 +565,7 @@
565 565 <key>qtgui_sink_x</key>
566 566 <param>
567 567 <key>bw</key>
568   - <value>samp_rate*10</value>
  568 + <value>samp_rate*8</value>
569 569 </param>
570 570 <param>
571 571 <key>alias</key>
... ... @@ -680,7 +680,7 @@
680 680 </param>
681 681 <param>
682 682 <key>_enabled</key>
683   - <value>0</value>
  683 + <value>1</value>
684 684 </param>
685 685 <param>
686 686 <key>fbw</key>
687 687  
... ... @@ -735,11 +735,11 @@
735 735 </param>
736 736 <param>
737 737 <key>decim</key>
738   - <value>10</value>
  738 + <value>8</value>
739 739 </param>
740 740 <param>
741 741 <key>_enabled</key>
742   - <value>0</value>
  742 + <value>1</value>
743 743 </param>
744 744 <param>
745 745 <key>fbw</key>
... ... @@ -2178,7 +2178,7 @@
2178 2178 </param>
2179 2179 <param>
2180 2180 <key>sample_rate</key>
2181   - <value>samp_rate*10*4</value>
  2181 + <value>samp_rate*8*4</value>
2182 2182 </param>
2183 2183 <param>
2184 2184 <key>sync</key>
sdr/fm_radio/fm_radio.py
... ... @@ -3,7 +3,7 @@
3 3 ##################################################
4 4 # GNU Radio Python Flow Graph
5 5 # Title: Fm Radio
6   -# Generated: Tue Apr 11 17:29:18 2017
  6 +# Generated: Thu Apr 27 16:24:59 2017
7 7 ##################################################
8 8  
9 9 if __name__ == '__main__':
10 10  
11 11  
... ... @@ -62,16 +62,16 @@
62 62 # Variables
63 63 ##################################################
64 64 self.samp_rate = samp_rate = 48e3
65   - self.freq = freq = 160011000
  65 + self.freq = freq = 158000000
66 66  
67 67 ##################################################
68 68 # Blocks
69 69 ##################################################
70   - self._freq_range = Range(52e6, 2e9, 1e3, 160011000, 200)
  70 + self._freq_range = Range(52e6, 2e9, 1e3, 158000000, 200)
71 71 self._freq_win = RangeWidget(self._freq_range, self.set_freq, "freq", "counter_slider", float)
72 72 self.top_grid_layout.addWidget(self._freq_win, 0,0)
73 73 self.rtlsdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + '' )
74   - self.rtlsdr_source_0.set_sample_rate(samp_rate*10*4)
  74 + self.rtlsdr_source_0.set_sample_rate(samp_rate*8*4)
75 75 self.rtlsdr_source_0.set_center_freq(freq, 0)
76 76 self.rtlsdr_source_0.set_freq_corr(0, 0)
77 77 self.rtlsdr_source_0.set_dc_offset_mode(0, 0)
78 78  
... ... @@ -83,11 +83,23 @@
83 83 self.rtlsdr_source_0.set_antenna('', 0)
84 84 self.rtlsdr_source_0.set_bandwidth(0, 0)
85 85  
  86 + self.rational_resampler_xxx_0_0 = filter.rational_resampler_ccc(
  87 + interpolation=1,
  88 + decimation=8,
  89 + taps=None,
  90 + fractional_bw=None,
  91 + )
  92 + self.rational_resampler_xxx_0 = filter.rational_resampler_fff(
  93 + interpolation=1,
  94 + decimation=4,
  95 + taps=None,
  96 + fractional_bw=None,
  97 + )
86 98 self.qtgui_sink_x_1 = qtgui.sink_f(
87 99 1024, #fftsize
88 100 firdes.WIN_BLACKMAN_hARRIS, #wintype
89 101 0, #fc
90   - samp_rate*10, #bw
  102 + samp_rate*8, #bw
91 103 "", #name
92 104 True, #plotfreq
93 105 True, #plotwaterfall
... ... @@ -106,7 +118,7 @@
106 118 1024, #fftsize
107 119 firdes.WIN_BLACKMAN_hARRIS, #wintype
108 120 0, #fc
109   - samp_rate*10*4, #bw
  121 + samp_rate*8*4, #bw
110 122 "", #name
111 123 True, #plotfreq
112 124 True, #plotwaterfall
113 125  
114 126  
115 127  
116 128  
... ... @@ -121,25 +133,21 @@
121 133  
122 134  
123 135  
124   - self.low_pass_filter_0_0 = filter.fir_filter_fff(10, firdes.low_pass(
125   - 1, samp_rate*10, samp_rate*2, 1e4, firdes.WIN_HAMMING, 6.76))
126   - self.low_pass_filter_0 = filter.fir_filter_ccf(4, firdes.low_pass(
127   - 1, samp_rate*10*4, 500e3, 10e3, firdes.WIN_HAMMING, 6.76))
128 136 self.audio_sink_0 = audio.sink(int(samp_rate), '', True)
129 137 self.analog_wfm_rcv_0 = analog.wfm_rcv(
130   - quad_rate=samp_rate*10,
  138 + quad_rate=samp_rate*8,
131 139 audio_decimation=1,
132 140 )
133 141  
134 142 ##################################################
135 143 # Connections
136 144 ##################################################
137   - self.connect((self.analog_wfm_rcv_0, 0), (self.low_pass_filter_0_0, 0))
138 145 self.connect((self.analog_wfm_rcv_0, 0), (self.qtgui_sink_x_1, 0))
139   - self.connect((self.low_pass_filter_0, 0), (self.analog_wfm_rcv_0, 0))
140   - self.connect((self.low_pass_filter_0_0, 0), (self.audio_sink_0, 0))
141   - self.connect((self.rtlsdr_source_0, 0), (self.low_pass_filter_0, 0))
  146 + self.connect((self.analog_wfm_rcv_0, 0), (self.rational_resampler_xxx_0, 0))
  147 + self.connect((self.rational_resampler_xxx_0, 0), (self.audio_sink_0, 0))
  148 + self.connect((self.rational_resampler_xxx_0_0, 0), (self.analog_wfm_rcv_0, 0))
142 149 self.connect((self.rtlsdr_source_0, 0), (self.qtgui_sink_x_0, 0))
  150 + self.connect((self.rtlsdr_source_0, 0), (self.rational_resampler_xxx_0_0, 0))
143 151  
144 152 def closeEvent(self, event):
145 153 self.settings = Qt.QSettings("GNU Radio", "fm_radio")
... ... @@ -151,11 +159,9 @@
151 159  
152 160 def set_samp_rate(self, samp_rate):
153 161 self.samp_rate = samp_rate
154   - self.rtlsdr_source_0.set_sample_rate(self.samp_rate*10*4)
155   - self.qtgui_sink_x_1.set_frequency_range(0, self.samp_rate*10)
156   - self.qtgui_sink_x_0.set_frequency_range(0, self.samp_rate*10*4)
157   - self.low_pass_filter_0_0.set_taps(firdes.low_pass(1, self.samp_rate*10, self.samp_rate*2, 1e4, firdes.WIN_HAMMING, 6.76))
158   - self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate*10*4, 500e3, 10e3, firdes.WIN_HAMMING, 6.76))
  162 + self.rtlsdr_source_0.set_sample_rate(self.samp_rate*8*4)
  163 + self.qtgui_sink_x_1.set_frequency_range(0, self.samp_rate*8)
  164 + self.qtgui_sink_x_0.set_frequency_range(0, self.samp_rate*8*4)
159 165  
160 166 def get_freq(self):
161 167 return self.freq