From 2c4a4e0c371b1cd0029901aa176915300a02f1b8 Mon Sep 17 00:00:00 2001 From: jblum Date: Thu, 12 Mar 2009 06:53:54 +0000 Subject: Added OFDM Mod and Demod to GRC (cough cough... kludge). Generalized the packet mod and demod stuff to accept the OFDM blocks. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10585 221aa14e-8319-0410-a670-987f0aec2ac5 --- grc/data/platforms/python/block_tree.xml | 3 + grc/data/platforms/python/blocks/Makefile.am | 2 + .../platforms/python/blocks/blks2_ofdm_demod.xml | 122 +++++++++++++++++++ .../platforms/python/blocks/blks2_ofdm_mod.xml | 135 +++++++++++++++++++++ .../python/blocks/blks2_packet_decoder.xml | 32 ++--- .../python/blocks/blks2_packet_encoder.xml | 39 +++--- 6 files changed, 291 insertions(+), 42 deletions(-) create mode 100644 grc/data/platforms/python/blocks/blks2_ofdm_demod.xml create mode 100644 grc/data/platforms/python/blocks/blks2_ofdm_mod.xml (limited to 'grc/data/platforms') diff --git a/grc/data/platforms/python/block_tree.xml b/grc/data/platforms/python/block_tree.xml index b56073bbf..bb2d681f0 100644 --- a/grc/data/platforms/python/block_tree.xml +++ b/grc/data/platforms/python/block_tree.xml @@ -213,6 +213,9 @@ blks2_qamx_mod blks2_qamx_demod + blks2_ofdm_mod + blks2_ofdm_demod + blks2_synthesis_filterbank blks2_analysis_filterbank diff --git a/grc/data/platforms/python/blocks/Makefile.am b/grc/data/platforms/python/blocks/Makefile.am index 3655b1311..6b09050f3 100644 --- a/grc/data/platforms/python/blocks/Makefile.am +++ b/grc/data/platforms/python/blocks/Makefile.am @@ -42,6 +42,8 @@ dist_ourdata_DATA = \ blks2_logpwrfft_x.xml \ blks2_nbfm_rx.xml \ blks2_nbfm_tx.xml \ + blks2_ofdm_demod.xml \ + blks2_ofdm_mod.xml \ blks2_packet_decoder.xml \ blks2_packet_encoder.xml \ blks2_qamx_demod.xml \ diff --git a/grc/data/platforms/python/blocks/blks2_ofdm_demod.xml b/grc/data/platforms/python/blocks/blks2_ofdm_demod.xml new file mode 100644 index 000000000..ac5ee4795 --- /dev/null +++ b/grc/data/platforms/python/blocks/blks2_ofdm_demod.xml @@ -0,0 +1,122 @@ + + + + OFDM Demod + blks2_ofdm_demod + from grc_gnuradio import blks2 as grc_blks2 + from gnuradio import blks2 + grc_blks2.packet_demod_$(type.fcn)(blks2.ofdm_demod( + options=grc_blks2.options( + modulation="$modulation", + fft_length=$fft_length, + occupied_tones=$occupied_tones, + cp_length=$cp_length, + snr=$snr, + log=None, + verbose=None, + ), + callback=lambda ok, payload: self.$(id).recv_pkt(ok, payload), + ), +) + + Output Type + type + float + enum + + + + + + + + Modulation + modulation + enum + + + + + + + + + + FFT Length + fft_length + 512 + int + + + Occupied Tones + occupied_tones + 200 + int + + + Cyclic Prefix Length + cp_length + 128 + int + + + SNR + snr + 10 + real + + + in + complex + + + out + $type + + Payload Length: 0 for automatic. + diff --git a/grc/data/platforms/python/blocks/blks2_ofdm_mod.xml b/grc/data/platforms/python/blocks/blks2_ofdm_mod.xml new file mode 100644 index 000000000..2c54d10f4 --- /dev/null +++ b/grc/data/platforms/python/blocks/blks2_ofdm_mod.xml @@ -0,0 +1,135 @@ + + + + OFDM Mod + blks2_ofdm_mod + from grc_gnuradio import blks2 as grc_blks2 + from gnuradio import blks2 + grc_blks2.packet_mod_$(type.fcn)(blks2.ofdm_mod( + options=grc_blks2.options( + modulation="$modulation", + fft_length=$fft_length, + occupied_tones=$occupied_tones, + cp_length=$cp_length, + pad_for_usrp=$pad_for_usrp, + log=None, + verbose=None, + ), + ), + payload_length=$payload_length, +) + + Input Type + type + float + enum + + + + + + + + Modulation + modulation + enum + + + + + + + + + + FFT Length + fft_length + 512 + int + + + Occupied Tones + occupied_tones + 200 + int + + + Cyclic Prefix Length + cp_length + 128 + int + + + Pad for USRP + pad_for_usrp + enum + + + + + Payload Length + payload_length + 0 + int + + + in + $type + + + out + complex + + Payload Length: 0 for automatic. + diff --git a/grc/data/platforms/python/blocks/blks2_packet_decoder.xml b/grc/data/platforms/python/blocks/blks2_packet_decoder.xml index d360bc177..07b0d1f2e 100644 --- a/grc/data/platforms/python/blocks/blks2_packet_decoder.xml +++ b/grc/data/platforms/python/blocks/blks2_packet_decoder.xml @@ -8,11 +8,11 @@ Packet Decoder blks2_packet_decoder from grc_gnuradio import blks2 as grc_blks2 - from gnuradio import gr - grc_blks2.packet_decoder( - item_size_out=$type.size*$vlen, - access_code=$access_code, - threshold=$threshold, + grc_blks2.packet_demod_$(type.fcn)(grc_blks2.packet_decoder( + access_code=$access_code, + threshold=$threshold, + callback=lambda ok, payload: self.$(id).recv_pkt(ok, payload), + ), ) Output Type @@ -22,27 +22,27 @@ @@ -57,13 +57,6 @@ -1 int - - Vec Length - vlen - 1 - int - - $vlen > 0 in byte @@ -71,11 +64,12 @@ out $type - $vlen Packet decoder block, for use with the gnuradio demodulator blocks: gmsk, psk, qam. -Access Code: string of 1's and 0's, leave blank for default. +Access Code: string of 1's and 0's, leave blank for automatic. + +Threshold: -1 for automatic. diff --git a/grc/data/platforms/python/blocks/blks2_packet_encoder.xml b/grc/data/platforms/python/blocks/blks2_packet_encoder.xml index ea9927225..b184ebd31 100644 --- a/grc/data/platforms/python/blocks/blks2_packet_encoder.xml +++ b/grc/data/platforms/python/blocks/blks2_packet_encoder.xml @@ -8,13 +8,12 @@ Packet Encoder blks2_packet_encoder from grc_gnuradio import blks2 as grc_blks2 - from gnuradio import gr - grc_blks2.packet_encoder( - item_size_in=$type.size*$vlen, - samples_per_symbol=$samples_per_symbol, - bits_per_symbol=$bits_per_symbol, - access_code=$access_code, - pad_for_usrp=$pad_for_usrp, + grc_blks2.packet_mod_$(type.fcn)(grc_blks2.packet_encoder( + samples_per_symbol=$samples_per_symbol, + bits_per_symbol=$bits_per_symbol, + access_code=$access_code, + pad_for_usrp=$pad_for_usrp, + ), payload_length=$payload_length, ) @@ -25,27 +24,27 @@ @@ -80,29 +79,23 @@ Payload Length payload_length - -1 + 0 int - - Vec Length - vlen - 1 - int - - $vlen > 0 in $type - $vlen out byte -Packet encoder block, for use with the gnuradio modulator blocks: gmsk, psk, qam. +Packet encoder block, for use with the gnuradio modulator blocks: gmsk, dpsk, qam. + +Access Code: string of 1's and 0's, leave blank for automatic. -Access Code: string of 1's and 0's, leave blank for default. +Payload Length: 0 for automatic. Bits/Symbol should be set accordingly: gmsk -> 1 -- cgit