From 72456bd1e5851bbf0ce4cb30ce3ec2b7e86c992a Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Thu, 28 Oct 2021 17:17:35 +0200 Subject: Implement QPSK TX - RX with USRP hardware And fix some small issues in QPSK simulation. The signal flow graph was tested with a coaxial cable, as well as with an 2.4 GHz antenna. The constellation diagram looked OK, but the sent data (bytes of lena512color.tiff) were neither decoded nor tested. That is because we need to synchronize data frames with a header thing or something like that (which is still not implemented yet). --- simulation/QPSK/qpks.py | 25 +++++++++++++------------ simulation/QPSK/qpsk.grc | 26 ++++++++++++-------------- 2 files changed, 25 insertions(+), 26 deletions(-) (limited to 'simulation/QPSK') diff --git a/simulation/QPSK/qpks.py b/simulation/QPSK/qpks.py index e436356..11e7004 100755 --- a/simulation/QPSK/qpks.py +++ b/simulation/QPSK/qpks.py @@ -77,16 +77,16 @@ class qpks(gr.top_block, Qt.QWidget): ################################################## self.sps = sps = 4 self.nfilts = nfilts = 32 + self.excess_bw = excess_bw = 350e-3 self.timing_loop_bw = timing_loop_bw = 2 * 3.141592653589793 / 100 self.time_offset = time_offset = 1.0 self.samp_rate = samp_rate = 32000 - self.rrc_taps = rrc_taps = firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), 0.35, 45*nfilts) + self.rrc_taps = rrc_taps = firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), excess_bw, 45*nfilts) self.qpsk_const = qpsk_const = digital.constellation_rect([0.707+0.707j, -0.707+0.707j, -0.707-0.707j, 0.707-0.707j], [0, 1, 3, 2], 4, 2, 2, 1, 1).base() self.phase_bw = phase_bw = 2 * 3.141592653589793 / 100 self.noise_volt = noise_volt = 0.0001 self.freq_offset = freq_offset = 0 - self.excess_bw = excess_bw = 350e-3 self.eq_ntaps = eq_ntaps = 15 self.eq_mod = eq_mod = 1 self.eq_gain = eq_gain = .01 @@ -179,14 +179,14 @@ class qpks(gr.top_block, Qt.QWidget): self.qtgui_time_sink_x_0.enable_tags(True) self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "") - self.qtgui_time_sink_x_0.enable_autoscale(True) + self.qtgui_time_sink_x_0.enable_autoscale(False) self.qtgui_time_sink_x_0.enable_grid(False) self.qtgui_time_sink_x_0.enable_axis_labels(True) self.qtgui_time_sink_x_0.enable_control_panel(False) self.qtgui_time_sink_x_0.enable_stem_plot(False) - labels = ['Signal 1', 'Signal 2', 'Signal 3', 'Signal 4', 'Signal 5', + labels = ['Received', 'Sent', 'Signal 3', 'Signal 4', 'Signal 5', 'Signal 6', 'Signal 7', 'Signal 8', 'Signal 9', 'Signal 10'] widths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] @@ -504,14 +504,21 @@ class qpks(gr.top_block, Qt.QWidget): def set_sps(self, sps): self.sps = sps - self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), 0.35, 45*self.nfilts)) + self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) def get_nfilts(self): return self.nfilts def set_nfilts(self, nfilts): self.nfilts = nfilts - self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), 0.35, 45*self.nfilts)) + self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) + + def get_excess_bw(self): + return self.excess_bw + + def set_excess_bw(self, excess_bw): + self.excess_bw = excess_bw + self.set_rrc_taps(firdes.root_raised_cosine(self.nfilts, self.nfilts, 1.0/float(self.sps), self.excess_bw, 45*self.nfilts)) def get_timing_loop_bw(self): return self.timing_loop_bw @@ -570,12 +577,6 @@ class qpks(gr.top_block, Qt.QWidget): self.freq_offset = freq_offset self.channels_channel_model_0.set_frequency_offset(self.freq_offset) - def get_excess_bw(self): - return self.excess_bw - - def set_excess_bw(self, excess_bw): - self.excess_bw = excess_bw - def get_eq_ntaps(self): return self.eq_ntaps diff --git a/simulation/QPSK/qpsk.grc b/simulation/QPSK/qpsk.grc index 11a2e6a..3275e96 100644 --- a/simulation/QPSK/qpsk.grc +++ b/simulation/QPSK/qpsk.grc @@ -1,7 +1,6 @@ options: parameters: author: Pross Naoki, Halter Sara Cinzia - catch_exceptions: 'True' category: '[GRC Hier Blocks]' cmake_opt: '' comment: '' @@ -23,6 +22,7 @@ options: sizing_mode: fixed thread_safe_setters: '' title: QPSK + window_size: '' states: bus_sink: false bus_source: false @@ -51,7 +51,7 @@ blocks: gui_hint: 'params@1: 0,0,1,1' label: Equalizer Rate min_len: '200' - orient: QtCore.Qt.Horizontal + orient: Qt.Horizontal rangeType: float start: '0' step: '.001' @@ -108,7 +108,7 @@ blocks: gui_hint: 'params@0: 1,0,1,1' label: Frequency Offset min_len: '200' - orient: QtCore.Qt.Horizontal + orient: Qt.Horizontal rangeType: float start: -100e-3 step: 1e-3 @@ -141,7 +141,7 @@ blocks: gui_hint: 'params@0: 0,0,1,1' label: Noise Voltage min_len: '200' - orient: QtCore.Qt.Horizontal + orient: Qt.Horizontal rangeType: float start: '0' step: '0.01' @@ -162,7 +162,7 @@ blocks: gui_hint: 'params@1: 1,0,1,1' label: Phase Bandwidth min_len: '200' - orient: QtCore.Qt.Horizontal + orient: Qt.Horizontal rangeType: float start: '0' step: '.01' @@ -200,7 +200,7 @@ blocks: id: variable parameters: comment: '' - value: firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), 0.35, 45*nfilts) + value: firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), excess_bw, 45*nfilts) states: bus_sink: false bus_source: false @@ -239,7 +239,7 @@ blocks: gui_hint: 'params@0: 0,1,1,1' label: Timing Offset min_len: '200' - orient: QtCore.Qt.Horizontal + orient: Qt.Horizontal rangeType: float start: '0.999' step: '0.0001' @@ -260,7 +260,7 @@ blocks: gui_hint: 'params@0: 1,1,1,1' label: Time Bandwidth min_len: '200' - orient: QtCore.Qt.Horizontal + orient: Qt.Horizontal rangeType: float start: '0' step: 10e-3 @@ -467,7 +467,6 @@ blocks: maxoutbuf: '0' minoutbuf: '0' samples_per_symbol: sps - truncate: 'False' verbose: 'False' states: bus_sink: false @@ -1037,7 +1036,6 @@ blocks: minoutbuf: '0' name: '"Channel"' nconnections: '1' - norm_window: 'False' showports: 'False' tr_chan: '0' tr_level: '0.0' @@ -1056,7 +1054,7 @@ blocks: width7: '1' width8: '1' width9: '1' - wintype: window.WIN_BLACKMAN_hARRIS + wintype: firdes.WIN_BLACKMAN_hARRIS ymax: '10' ymin: '-140' states: @@ -1081,7 +1079,7 @@ blocks: alpha7: '1.0' alpha8: '1.0' alpha9: '1.0' - autoscale: 'True' + autoscale: 'False' axislabels: 'True' color1: blue color10: dark blue @@ -1098,9 +1096,9 @@ blocks: entags: 'True' grid: 'False' gui_hint: 'plots@2: 0,0,1,1' - label1: Signal 1 + label1: Received label10: Signal 10 - label2: Signal 2 + label2: Sent label3: Signal 3 label4: Signal 4 label5: Signal 5 -- cgit v1.2.1