summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/python
diff options
context:
space:
mode:
authortrondeau2008-04-16 17:12:13 +0000
committertrondeau2008-04-16 17:12:13 +0000
commit8bce0d9e3f61b4af7799ed519109b83b926d4e12 (patch)
tree92b7d321ae757d343195ab77da0d42d3683c5648 /gnuradio-core/src/python
parent9b1edaa957fcdf0d34b809937ce5f2960057baff (diff)
downloadgnuradio-8bce0d9e3f61b4af7799ed519109b83b926d4e12.tar.gz
gnuradio-8bce0d9e3f61b4af7799ed519109b83b926d4e12.tar.bz2
gnuradio-8bce0d9e3f61b4af7799ed519109b83b926d4e12.zip
to complete what I started, this makes the ofdm_sync_fixed block work again in the OFDM receiver. Its only used for testing in the simulation mode if you want to remove any affects of the synchronization blocks. You have to manually edit the number of symbols and any fractional frequency offset you might want to use.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8213 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/python')
-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"))