Commit 7203bccc authored by Garnier Jean-Romain's avatar Garnier Jean-Romain
Browse files

Improve receiving filter for 2 users flowgraph

parent 8a891177
......@@ -483,7 +483,7 @@
</param>
<param>
<key>value</key>
<value>16</value>
<value>32</value>
</param>
</block>
<block>
......@@ -952,7 +952,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(672, 479)</value>
<value>(816, 479)</value>
</param>
<param>
<key>_rotation</key>
......@@ -1222,6 +1222,85 @@
<value>float</value>
</param>
</block>
<block>
<key>band_reject_filter</key>
<param>
<key>beta</key>
<value>6.76</value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>decim</key>
<value>1</value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>type</key>
<value>fir_filter_ccf</value>
</param>
<param>
<key>_coordinate</key>
<value>(424, 451)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>gain</key>
<value>1</value>
</param>
<param>
<key>high_cutoff_freq</key>
<value>4500</value>
</param>
<param>
<key>id</key>
<value>band_reject_filter_0</value>
</param>
<param>
<key>interp</key>
<value>1</value>
</param>
<param>
<key>low_cutoff_freq</key>
<value>3500</value>
</param>
<param>
<key>maxoutbuf</key>
<value>0</value>
</param>
<param>
<key>minoutbuf</key>
<value>0</value>
</param>
<param>
<key>samp_rate</key>
<value>samp_rate</value>
</param>
<param>
<key>width</key>
<value>512</value>
</param>
<param>
<key>win</key>
<value>firdes.WIN_HAMMING</value>
</param>
</block>
<block>
<key>blocks_add_const_vxx</key>
<param>
......@@ -1434,7 +1513,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(456, 493)</value>
<value>(616, 493)</value>
</param>
<param>
<key>_rotation</key>
......@@ -1540,7 +1619,7 @@
</param>
<param>
<key>cutoff_freq</key>
<value>2048</value>
<value>22000 * 16 / sps</value>
</param>
<param>
<key>decim</key>
......@@ -1556,7 +1635,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(256, 458)</value>
<value>(232, 458)</value>
</param>
<param>
<key>_rotation</key>
......@@ -1588,7 +1667,7 @@
</param>
<param>
<key>width</key>
<value>512</value>
<value>2048</value>
</param>
<param>
<key>win</key>
......@@ -1982,7 +2061,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(912, 303)</value>
<value>(856, 303)</value>
</param>
<param>
<key>gui_hint</key>
......@@ -2269,7 +2348,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(456, 567)</value>
<value>(624, 567)</value>
</param>
<param>
<key>gui_hint</key>
......@@ -2775,7 +2854,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(912, 191)</value>
<value>(856, 191)</value>
</param>
<param>
<key>gui_hint</key>
......@@ -3134,7 +3213,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(992, 407)</value>
<value>(1136, 407)</value>
</param>
<param>
<key>gui_hint</key>
......@@ -4248,7 +4327,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(1112, 196)</value>
<value>(1040, 196)</value>
</param>
<param>
<key>_rotation</key>
......@@ -5323,7 +5402,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(32, 458)</value>
<value>(16, 458)</value>
</param>
<param>
<key>_rotation</key>
......@@ -5486,7 +5565,7 @@
</param>
<param>
<key>_coordinate</key>
<value>(992, 500)</value>
<value>(1136, 500)</value>
</param>
<param>
<key>_rotation</key>
......@@ -5861,6 +5940,18 @@
<source_key>0</source_key>
<sink_key>1</sink_key>
</connection>
<connection>
<source_block_id>band_reject_filter_0</source_block_id>
<sink_block_id>fir_filter_xxx_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>band_reject_filter_0</source_block_id>
<sink_block_id>qtgui_freq_sink_x_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>blocks_add_const_vxx_0</source_block_id>
<sink_block_id>blocks_magphase_to_complex_0</sink_block_id>
......@@ -5917,13 +6008,7 @@
</connection>
<connection>
<source_block_id>low_pass_filter_0</source_block_id>
<sink_block_id>fir_filter_xxx_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection>
<source_block_id>low_pass_filter_0</source_block_id>
<sink_block_id>qtgui_freq_sink_x_0_0</sink_block_id>
<sink_block_id>band_reject_filter_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
......
......@@ -3,7 +3,7 @@
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
# Generated: Mon Apr 29 17:02:10 2019
# Generated: Tue Apr 30 16:42:31 2019
##################################################
if __name__ == '__main__':
......@@ -62,7 +62,7 @@ class top_block(gr.top_block, Qt.QWidget):
##################################################
# Variables
##################################################
self.sps = sps = 16
self.sps = sps = 32
self.samp_rate = samp_rate = 512000
self.Pmax = Pmax = 1
self.ntaps = ntaps = 11*sps**2
......@@ -386,7 +386,7 @@ class top_block(gr.top_block, Qt.QWidget):
self._qtgui_const_sink_x_0_win = sip.wrapinstance(self.qtgui_const_sink_x_0.pyqwidget(), Qt.QWidget)
self.tab_layout_2.addWidget(self._qtgui_const_sink_x_0_win)
self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass(
1, samp_rate, 2048, 512, firdes.WIN_HAMMING, 6.76))
1, samp_rate, 22000 * 16 / sps, 2048, firdes.WIN_HAMMING, 6.76))
self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_ccc(sps, (variable_rrc_filter_taps_0))
self.interp_fir_filter_xxx_0.declare_sample_delay(0)
self.fir_filter_xxx_0_0 = filter.fir_filter_ccc(sps, (variable_rrc_filter_taps_0))
......@@ -395,6 +395,8 @@ class top_block(gr.top_block, Qt.QWidget):
self.blocks_magphase_to_complex_0 = blocks.magphase_to_complex(1)
self.blocks_complex_to_magphase_0 = blocks.complex_to_magphase(1)
self.blocks_add_const_vxx_0 = blocks.add_const_vff((deltaPhi*pi, ))
self.band_reject_filter_0 = filter.fir_filter_ccf(1, firdes.band_reject(
1, samp_rate, 3500, 4500, 512, firdes.WIN_HAMMING, 6.76))
self.analog_const_source_x_0_1 = analog.sig_source_f(0, analog.GR_CONST_WAVE, 0, 0, P2)
self.analog_const_source_x_0_0_0 = analog.sig_source_f(0, analog.GR_CONST_WAVE, 0, 0, P1)
self.analog_const_source_x_0_0 = analog.sig_source_f(0, analog.GR_CONST_WAVE, 0, 0, P1)
......@@ -436,6 +438,8 @@ class top_block(gr.top_block, Qt.QWidget):
self.connect((self.analog_const_source_x_0_0_0, 0), (self.NOMA_decode_cc_0_0_0, 0))
self.connect((self.analog_const_source_x_0_1, 0), (self.NOMA_decode_cc_0, 1))
self.connect((self.analog_const_source_x_0_1, 0), (self.NOMA_decode_cc_0_0_0, 1))
self.connect((self.band_reject_filter_0, 0), (self.fir_filter_xxx_0_0, 0))
self.connect((self.band_reject_filter_0, 0), (self.qtgui_freq_sink_x_0_0, 0))
self.connect((self.blocks_add_const_vxx_0, 0), (self.blocks_magphase_to_complex_0, 1))
self.connect((self.blocks_complex_to_magphase_0, 1), (self.blocks_add_const_vxx_0, 0))
self.connect((self.blocks_complex_to_magphase_0, 0), (self.blocks_multiply_const_vxx_1, 0))
......@@ -445,8 +449,7 @@ class top_block(gr.top_block, Qt.QWidget):
self.connect((self.interp_fir_filter_xxx_0, 0), (self.qtgui_freq_sink_x_0, 0))
self.connect((self.interp_fir_filter_xxx_0, 0), (self.qtgui_time_sink_x_0, 0))
self.connect((self.interp_fir_filter_xxx_0, 0), (self.uhd_usrp_sink_0_0_0, 0))
self.connect((self.low_pass_filter_0, 0), (self.fir_filter_xxx_0_0, 0))
self.connect((self.low_pass_filter_0, 0), (self.qtgui_freq_sink_x_0_0, 0))
self.connect((self.low_pass_filter_0, 0), (self.band_reject_filter_0, 0))
self.connect((self.uhd_usrp_source_0_0_0, 0), (self.low_pass_filter_0, 0))
def closeEvent(self, event):
......@@ -462,6 +465,7 @@ class top_block(gr.top_block, Qt.QWidget):
self.sps = sps
self.set_freq(self.samp_rate / self.sps)
self.set_ntaps(11*self.sps**2)
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, 22000 * 16 / self.sps, 2048, firdes.WIN_HAMMING, 6.76))
def get_samp_rate(self):
return self.samp_rate
......@@ -469,13 +473,14 @@ class top_block(gr.top_block, Qt.QWidget):
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.set_freq(self.samp_rate / self.sps)
self.band_reject_filter_0.set_taps(firdes.band_reject(1, self.samp_rate, 3500, 4500, 512, firdes.WIN_HAMMING, 6.76))
self.qtgui_freq_sink_x_0.set_frequency_range(0, self.samp_rate)
self.qtgui_freq_sink_x_0_0.set_frequency_range(0, self.samp_rate)
self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate)
self.qtgui_time_sink_x_0_0.set_samp_rate(self.samp_rate)
self.uhd_usrp_sink_0_0_0.set_samp_rate(self.samp_rate)
self.uhd_usrp_source_0_0_0.set_samp_rate(self.samp_rate)
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, 2048, 512, firdes.WIN_HAMMING, 6.76))
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, 22000 * 16 / self.sps, 2048, firdes.WIN_HAMMING, 6.76))
def get_Pmax(self):
return self.Pmax
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment