aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/QPSK/qpks.py
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2021-10-28 17:17:35 +0200
committerNao Pross <np@0hm.ch>2021-10-28 17:17:35 +0200
commit72456bd1e5851bbf0ce4cb30ce3ec2b7e86c992a (patch)
tree30123f01f2c029e5844b5759c9cbb0e6db27924c /simulation/QPSK/qpks.py
parentMore typos and errors (diff)
downloadFading-72456bd1e5851bbf0ce4cb30ce3ec2b7e86c992a.tar.gz
Fading-72456bd1e5851bbf0ce4cb30ce3ec2b7e86c992a.zip
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).
Diffstat (limited to 'simulation/QPSK/qpks.py')
-rwxr-xr-xsimulation/QPSK/qpks.py25
1 files changed, 13 insertions, 12 deletions
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