[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5991 - gnuradio/branches/developers/trondeau/ofdm_mod
From: |
trondeau |
Subject: |
[Commit-gnuradio] r5991 - gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl |
Date: |
Mon, 16 Jul 2007 14:24:02 -0600 (MDT) |
Author: trondeau
Date: 2007-07-16 14:24:01 -0600 (Mon, 16 Jul 2007)
New Revision: 5991
Modified:
gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl/ofdm.py
gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl/psk.py
Log:
using new ofdm mapper using psk.py to auto-generate PSK constellations
Modified:
gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl/ofdm.py
===================================================================
---
gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl/ofdm.py
2007-07-16 20:23:13 UTC (rev 5990)
+++
gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl/ofdm.py
2007-07-16 20:24:01 UTC (rev 5991)
@@ -86,13 +86,26 @@
mods = {"bpsk": 2, "qpsk": 4, "8psk": 8}
order = mods[self._modulation]
- const = list()
- for c in psk.constellation[order]:
- const.append(-1*c)
- print const
- self._pkt_input = gr.ofdm_mapper_bcv(const, msgq_limit,
- options.occupied_tones,
options.fft_length)
-
+ if 1:
+ const = psk.gray_constellation[order]
+ if self._modulation == "qpsk":
+ const = list()
+ for c in psk.gray_constellation[order]:
+ const.append((0.707+0.707j)*c)
+ print const
+ self._pkt_input = gr.ofdm_mapper_bcv(const, msgq_limit,
+ options.occupied_tones,
options.fft_length)
+ else:
+ if self._modulation == "bpsk":
+ self._pkt_input = gr.ofdm_bpsk_mapper(msgq_limit,
+ options.occupied_tones,
options.fft_length)
+ elif self._modulation == "qpsk":
+ self._pkt_input = gr.ofdm_qpsk_mapper(msgq_limit,
+ options.occupied_tones,
options.fft_length)
+ else:
+ print "Modulation type not supported (must be \"bpsk\" or
\"qpsk\""
+ exit(1)
+
self.preambles = gr.ofdm_insert_preamble(self._fft_length,
padded_preambles)
self.ifft = gr.fft_vcc(self._fft_length, False, win, True)
self.cp_adder = gr.ofdm_cyclic_prefixer(self._fft_length,
symbol_length)
Modified:
gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl/psk.py
===================================================================
---
gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl/psk.py
2007-07-16 20:23:13 UTC (rev 5990)
+++
gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl/psk.py
2007-07-16 20:24:01 UTC (rev 5991)
@@ -53,6 +53,12 @@
8 : make_constellation(8) # 8PSK
}
+gray_constellation = {
+ 2 : make_gray_constellation(2), # BPSK
+ 4 : make_gray_constellation(4), # QPSK
+ 8 : make_gray_constellation(8) # 8PSK
+ }
+
# -----------------------
# Do Gray code
# -----------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5991 - gnuradio/branches/developers/trondeau/ofdm_mod/gnuradio-core/src/python/gnuradio/blksimpl,
trondeau <=