summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/ofdm_receiver.py7
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/ofdm_sync_fixed.py19
2 files changed, 15 insertions, 11 deletions
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/ofdm_receiver.py b/gnuradio-core/src/python/gnuradio/blks2impl/ofdm_receiver.py
index d315fd005..56ae0c0f0 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/ofdm_receiver.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/ofdm_receiver.py
@@ -93,9 +93,12 @@ class ofdm_receiver(gr.hier_block2):
elif SYNC == "pnac":
nco_sensitivity = -2.0/fft_length # correct for fine frequency
self.ofdm_sync = ofdm_sync_pnac(fft_length, cp_length, ks0time, logging)
- elif SYNC == "fixed":
+ elif SYNC == "fixed": # for testing only; do not user over the air
+ self.chan_filt = gr.multiply_const_cc(1.0) # remove filter and filter delay for this
+ nsymbols = 18 # enter the number of symbols per packet
+ freq_offset = 0.0 # if you use a frequency offset, enter it here
nco_sensitivity = -2.0/fft_length # correct for fine frequency
- self.ofdm_sync = ofdm_sync_fixed(fft_length, cp_length, logging)
+ self.ofdm_sync = ofdm_sync_fixed(fft_length, cp_length, nsymbols, freq_offset, logging)
# Set up blocks
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/ofdm_sync_fixed.py b/gnuradio-core/src/python/gnuradio/blks2impl/ofdm_sync_fixed.py
index 74acc8fde..9bac789bf 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/ofdm_sync_fixed.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/ofdm_sync_fixed.py
@@ -24,26 +24,27 @@ import math
from gnuradio import gr
class ofdm_sync_fixed(gr.hier_block2):
- def __init__(self, fft_length, cp_length, logging=False):
+ def __init__(self, fft_length, cp_length, nsymbols, freq_offset, logging=False):
gr.hier_block2.__init__(self, "ofdm_sync_fixed",
gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature2(2, 2, gr.sizeof_gr_complex*fft_length, gr.sizeof_char)) # Output signature
+ gr.io_signature2(2, 2, gr.sizeof_float, gr.sizeof_char)) # Output signature
# Use a fixed trigger point instead of sync block
symbol_length = fft_length + cp_length
- data = (symbol_length)*[0,]
+ pkt_length = nsymbols*symbol_length
+ data = (pkt_length)*[0,]
data[(symbol_length)-1] = 1
self.peak_trigger = gr.vector_source_b(data, True)
- self.sampler = gr.ofdm_sampler(fft_length, symbol_length)
- self.connect(self, (self.sampler,0))
- self.connect(self.peak_trigger, (self.sampler,1))
- self.connect(self.sampler, (self,0))
+ # Use a pre-defined frequency offset
+ foffset = (pkt_length)*[math.pi*freq_offset,]
+ self.frequency_offset = gr.vector_source_f(foffset, True)
+
+ self.connect(self, gr.null_sink(gr.sizeof_gr_complex))
+ self.connect(self.frequency_offset, (self,0))
self.connect(self.peak_trigger, (self,1))
if logging:
self.connect(self.peak_trigger, gr.file_sink(gr.sizeof_char, "ofdm_sync_fixed-peaks_b.dat"))
- self.connect(self.sampler, gr.file_sink(gr.sizeof_gr_complex*fft_length,
- "ofdm_sync_fixed-sampler_c.dat"))