aboutsummaryrefslogtreecommitdiffstats
path: root/flowgraphs
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2021-12-14 19:40:03 +0100
committerNao Pross <np@0hm.ch>2021-12-14 19:40:03 +0100
commit06f4ef810c7089c8b994f438b90b293762133bdd (patch)
tree5794b50d22b0f3db403c43adc92d04114c4dcfdb /flowgraphs
parentBER block angepasst (diff)
downloadFading-06f4ef810c7089c8b994f438b90b293762133bdd.tar.gz
Fading-06f4ef810c7089c8b994f438b90b293762133bdd.zip
Implement network_value to show BER
Diffstat (limited to 'flowgraphs')
-rw-r--r--flowgraphs/qpsk_sim.grc8
-rwxr-xr-xflowgraphs/qpsk_sim.py20
2 files changed, 21 insertions, 7 deletions
diff --git a/flowgraphs/qpsk_sim.grc b/flowgraphs/qpsk_sim.grc
index a8dd485..75bf3e1 100644
--- a/flowgraphs/qpsk_sim.grc
+++ b/flowgraphs/qpsk_sim.grc
@@ -366,9 +366,9 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
- coordinate: [568, 548.0]
+ coordinate: [592, 572.0]
rotation: 0
- state: disabled
+ state: enabled
- name: digital_cma_equalizer_cc_0
id: digital_cma_equalizer_cc
parameters:
@@ -518,7 +518,7 @@ blocks:
bus_structure: null
coordinate: [648, 740.0]
rotation: 0
- state: enabled
+ state: disabled
- name: fadingui_netsink_0
id: fadingui_netsink
parameters:
@@ -816,7 +816,7 @@ blocks:
bus_structure: null
coordinate: [1248, 1060.0]
rotation: 0
- state: enabled
+ state: disabled
- name: virtual_sink_0
id: virtual_sink
parameters:
diff --git a/flowgraphs/qpsk_sim.py b/flowgraphs/qpsk_sim.py
index 1e00180..63d8a6e 100755
--- a/flowgraphs/qpsk_sim.py
+++ b/flowgraphs/qpsk_sim.py
@@ -47,7 +47,11 @@ class qpsk_sim(gr.top_block):
# Blocks
##################################################
self.fadingui_phasecorrection_0 = fadingui.phasecorrection(frame_len)
- self.fadingui_multipath_fading_0 = fadingui.multipath_fading(amplitudes=[0.12], delays=[1.8], los =True)
+ self.fadingui_netsink_4 = fadingui.netsink(address='udp://localhost:31417', dtype="complex", vlen=1)
+ self.fadingui_netsink_3 = fadingui.netsink(address='udp://localhost:31419', dtype="complex", vlen=1)
+ self.fadingui_netsink_1 = fadingui.netsink(address='udp://localhost:31418', dtype="complex", vlen=1)
+ self.fadingui_netsink_0_0 = fadingui.netsink(address='udp://localhost:31415', dtype="float", vlen=1)
+ self.fadingui_netsink_0 = fadingui.netsink(address='udp://localhost:31416', dtype="complex", vlen=1)
self.fadingui_ber_0 = fadingui.ber(vgl=testvec + list(np.zeros(4)), vlen=frame_len,address='udp://localhost:31420')
self.digital_pfb_clock_sync_xxx_0 = digital.pfb_clock_sync_ccf(sps, 2 * np.pi / 100, rrc_taps, 32, 16, 1.5, 1)
self.digital_corr_est_cc_0 = digital.corr_est_cc(access_code_symbols, 1, len(access_code_symbols) // 2, 0.9, digital.THRESHOLD_ABSOLUTE)
@@ -61,6 +65,7 @@ class qpsk_sim(gr.top_block):
log=False)
self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(qpsk_const)
self.digital_cma_equalizer_cc_0 = digital.cma_equalizer_cc(15, 1, 2e-3, 1)
+ self.channels_selective_fading_model_0 = channels.selective_fading_model( 8, ((4*carrier_freq)/(3*10e8))/samp_rate, False, 4.0, 21, (0,1.8), (1,0.12), 8 )
self.channels_channel_model_0 = channels.channel_model(
noise_voltage=100e-3,
frequency_offset=2e-3,
@@ -74,6 +79,7 @@ class qpsk_sim(gr.top_block):
self.blocks_stream_to_vector_0 = blocks.stream_to_vector(gr.sizeof_char*1, frame_len)
self.blocks_stream_mux_0 = blocks.stream_mux(gr.sizeof_char*1, [len(testvec), 4])
self.blocks_repack_bits_bb_0 = blocks.repack_bits_bb(2, 8, "", False, gr.GR_LSB_FIRST)
+ self.blocks_complex_to_mag_0 = blocks.complex_to_mag(1)
self.analog_random_source_x_0 = blocks.vector_source_b(list(map(int, numpy.random.randint(0, 255, 400))), True)
@@ -82,20 +88,26 @@ class qpsk_sim(gr.top_block):
# Connections
##################################################
self.connect((self.analog_random_source_x_0, 0), (self.blocks_stream_mux_0, 1))
+ self.connect((self.blocks_complex_to_mag_0, 0), (self.fadingui_netsink_0_0, 0))
self.connect((self.blocks_repack_bits_bb_0, 0), (self.blocks_stream_to_vector_0, 0))
self.connect((self.blocks_stream_mux_0, 0), (self.digital_constellation_modulator_0, 0))
self.connect((self.blocks_stream_to_vector_0, 0), (self.fadingui_ber_0, 0))
self.connect((self.blocks_tagged_stream_align_0, 0), (self.blocks_repack_bits_bb_0, 0))
self.connect((self.blocks_throttle_0, 0), (self.channels_channel_model_0, 0))
self.connect((self.blocks_vector_source_x_0, 0), (self.blocks_stream_mux_0, 0))
- self.connect((self.channels_channel_model_0, 0), (self.fadingui_multipath_fading_0, 0))
+ self.connect((self.channels_channel_model_0, 0), (self.channels_selective_fading_model_0, 0))
+ self.connect((self.channels_selective_fading_model_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0))
+ self.connect((self.channels_selective_fading_model_0, 0), (self.fadingui_netsink_0, 0))
self.connect((self.digital_cma_equalizer_cc_0, 0), (self.digital_corr_est_cc_0, 0))
+ self.connect((self.digital_cma_equalizer_cc_0, 0), (self.fadingui_netsink_1, 0))
self.connect((self.digital_constellation_decoder_cb_0, 0), (self.blocks_tagged_stream_align_0, 0))
self.connect((self.digital_constellation_modulator_0, 0), (self.blocks_throttle_0, 0))
+ self.connect((self.digital_corr_est_cc_0, 1), (self.blocks_complex_to_mag_0, 0))
self.connect((self.digital_corr_est_cc_0, 0), (self.fadingui_phasecorrection_0, 0))
self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.digital_cma_equalizer_cc_0, 0))
- self.connect((self.fadingui_multipath_fading_0, 0), (self.digital_pfb_clock_sync_xxx_0, 0))
+ self.connect((self.digital_pfb_clock_sync_xxx_0, 0), (self.fadingui_netsink_4, 0))
self.connect((self.fadingui_phasecorrection_0, 0), (self.digital_constellation_decoder_cb_0, 0))
+ self.connect((self.fadingui_phasecorrection_0, 0), (self.fadingui_netsink_3, 0))
def get_testvec(self):
@@ -133,6 +145,7 @@ class qpsk_sim(gr.top_block):
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.blocks_throttle_0.set_sample_rate(self.samp_rate)
+ self.channels_selective_fading_model_0.set_fDTs(((4*self.carrier_freq)/(3*10e8))/self.samp_rate)
def get_rrc_taps(self):
return self.rrc_taps
@@ -158,6 +171,7 @@ class qpsk_sim(gr.top_block):
def set_carrier_freq(self, carrier_freq):
self.carrier_freq = carrier_freq
+ self.channels_selective_fading_model_0.set_fDTs(((4*self.carrier_freq)/(3*10e8))/self.samp_rate)
def get_access_code_symbols(self):
return self.access_code_symbols