From 97c2b93dacd1ebcfb77c2e94d60578f0831b3107 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:49:01 +0100 Subject: [PATCH 01/21] add pilots utils script --- utils/pilots.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 utils/pilots.py diff --git a/utils/pilots.py b/utils/pilots.py new file mode 100644 index 0000000..49b19e9 --- /dev/null +++ b/utils/pilots.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + + +polarity = [ + 1, 1, 1, 1,-1,-1,-1, 1,-1,-1,-1,-1, 1, 1,-1, 1, + -1,-1, 1, 1,-1, 1, 1,-1, 1, 1, 1, 1, 1, 1,-1, 1, + 1, 1,-1, 1, 1,-1,-1, 1, 1, 1,-1, 1,-1,-1,-1, 1, + -1, 1,-1,-1, 1,-1,-1, 1, 1, 1, 1, 1,-1,-1, 1, 1, + -1,-1, 1,-1, 1,-1, 1, 1,-1,-1,-1, 1, 1,-1,-1,-1, + -1, 1,-1,-1, 1,-1, 1, 1, 1, 1,-1, 1,-1, 1,-1, 1, + -1,-1,-1,-1,-1, 1,-1, 1, 1,-1, 1,-1, 1, 1, 1,-1, + -1, 1,-1,-1,-1, 1, 1, 1,-1,-1,-1,-1,-1,-1,-1] + + +print "polarity" +print tuple((x, x, x, -x) for x in polarity) + + +print "pattern" +print tuple((-21, -7, 7, 21) for x in range(127)) From d6e1a1a4d09fdc73e96b63c689b2c98267739383 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:50:17 +0100 Subject: [PATCH 02/21] add chunks to symbols block --- grc/ieee802_11_chunks_to_symbols.xml | 18 ++++ include/ieee802-11/chunks_to_symbols.h | 36 +++++++ lib/chunks_to_symbols_impl.cc | 144 +++++++++++++++++++++++++ lib/chunks_to_symbols_impl.h | 46 ++++++++ 4 files changed, 244 insertions(+) create mode 100644 grc/ieee802_11_chunks_to_symbols.xml create mode 100644 include/ieee802-11/chunks_to_symbols.h create mode 100644 lib/chunks_to_symbols_impl.cc create mode 100644 lib/chunks_to_symbols_impl.h diff --git a/grc/ieee802_11_chunks_to_symbols.xml b/grc/ieee802_11_chunks_to_symbols.xml new file mode 100644 index 0000000..2cdd2c5 --- /dev/null +++ b/grc/ieee802_11_chunks_to_symbols.xml @@ -0,0 +1,18 @@ + + + Chunks to Symbols + ieee802_11_chunks_to_symbols_xx + IEEE802.11 + import ieee802_11 + ieee802_11.chunks_to_symbols() + + in + byte + 1 + + + out + complex + 1 + + diff --git a/include/ieee802-11/chunks_to_symbols.h b/include/ieee802-11/chunks_to_symbols.h new file mode 100644 index 0000000..be6ec86 --- /dev/null +++ b/include/ieee802-11/chunks_to_symbols.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2013 Bastian Bloessl + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_H +#define INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_H + +#include +#include + +namespace gr { +namespace ieee802_11 { + +class IEEE802_11_API chunks_to_symbols : virtual public tagged_stream_block +{ +public: + typedef boost::shared_ptr sptr; + static sptr make(); +}; + +} /* namespace ieee802_11 */ +} /* namespace gr */ + +#endif /* INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_H */ diff --git a/lib/chunks_to_symbols_impl.cc b/lib/chunks_to_symbols_impl.cc new file mode 100644 index 0000000..8c532e7 --- /dev/null +++ b/lib/chunks_to_symbols_impl.cc @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2013 Bastian Bloessl + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "chunks_to_symbols_impl.h" +#include "utils.h" +#include +#include +#include + +using namespace gr::ieee802_11; + +chunks_to_symbols::sptr +chunks_to_symbols::make() +{ + return gnuradio::get_initial_sptr(new chunks_to_symbols_impl()); +} + +chunks_to_symbols_impl::chunks_to_symbols_impl() + : tagged_stream_block("wifi_chunks_to_symbols", + io_signature::make(1, 1, sizeof(char)), + io_signature::make(1, 1, sizeof(gr_complex)), "packet_len") { +} + +chunks_to_symbols_impl::~chunks_to_symbols_impl() { } + + +int +chunks_to_symbols_impl::work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) { + + const unsigned char *in = (unsigned char*)input_items[0]; + gr_complex *out = (gr_complex*)output_items[0]; + + std::vector tags; + get_tags_in_range(tags, 0, nitems_read(0), + nitems_read(0) + ninput_items[0], + pmt::mp("encoding")); + if(tags.size() != 1) { + throw std::runtime_error("no encoding in input stream"); + } + + Encoding encoding = (Encoding)pmt::to_long(tags[0].value); + + const gr_complex *mapping; + + switch (encoding) { + case BPSK_1_2: + case BPSK_3_4: + mapping = BPSK; + break; + + case QPSK_1_2: + case QPSK_3_4: + mapping = QPSK; + break; + + case QAM16_1_2: + case QAM16_3_4: + mapping = QAM16; + break; + + case QAM64_2_3: + case QAM64_3_4: + mapping = QAM64; + break; + + default: + throw std::invalid_argument("wrong encoding"); + break; + } + + for(int i = 0; i < ninput_items[0]; i++) { + out[i] = mapping[in[i]]; + } + + return ninput_items[0]; +} + +const gr_complex chunks_to_symbols_impl::BPSK[2] = { + gr_complex(-1.0, 0.0), gr_complex(1.0, 0.0)}; + +const gr_complex chunks_to_symbols_impl::QPSK[4] = { + gr_complex(-0.7071, -0.7071), gr_complex(-0.7071, 0.7071), + gr_complex(+0.7071, -0.7071), gr_complex(+0.7071, 0.7071)}; + +const gr_complex chunks_to_symbols_impl::QAM16[16] = { + gr_complex(-0.9487, -0.9487), gr_complex(-0.9487, -0.3162), + gr_complex(-0.9487, 0.9487), gr_complex(-0.9487, 0.3162), + gr_complex(-0.3162, -0.9487), gr_complex(-0.3162, -0.3162), + gr_complex(-0.3162, 0.9487), gr_complex(-0.3162, 0.3162), + gr_complex(0.9487, -0.9487), gr_complex(0.9487, -0.3162), + gr_complex(0.9487, 0.9487), gr_complex(0.9487, 0.3162), + gr_complex(0.3162, -0.9487), gr_complex(0.3162, -0.3162), + gr_complex(0.3162, 0.9487), gr_complex(0.3162, 0.3162)}; + +const gr_complex chunks_to_symbols_impl::QAM64[64] = { + gr_complex(-1.0801, -1.0801), gr_complex(-1.0801, -0.7715), + gr_complex(-1.0801, -0.1543), gr_complex(-1.0801, -0.4629), + gr_complex(-1.0801, 1.0801), gr_complex(-1.0801, 0.7715), + gr_complex(-1.0801, 0.1543), gr_complex(-1.0801, 0.4629), + gr_complex(-0.7715, -1.0801), gr_complex(-0.7715, -0.7715), + gr_complex(-0.7715, -0.1543), gr_complex(-0.7715, -0.4629), + gr_complex(-0.7715, 1.0801), gr_complex(-0.7715, 0.7715), + gr_complex(-0.7715, 0.1543), gr_complex(-0.7715, 0.4629), + gr_complex(-0.1543, -1.0801), gr_complex(-0.1543, -0.7715), + gr_complex(-0.1543, -0.1543), gr_complex(-0.1543, -0.4629), + gr_complex(-0.1543, 1.0801), gr_complex(-0.1543, 0.7715), + gr_complex(-0.1543, 0.1543), gr_complex(-0.1543, 0.4629), + gr_complex(-0.4629, -1.0801), gr_complex(-0.4629, -0.7715), + gr_complex(-0.4629, -0.1543), gr_complex(-0.4629, -0.4629), + gr_complex(-0.4629, 1.0801), gr_complex(-0.4629, 0.7715), + gr_complex(-0.4629, 0.1543), gr_complex(-0.4629, 0.4629), + gr_complex(1.0801, -1.0801), gr_complex(1.0801, -0.7715), + gr_complex(1.0801, -0.1543), gr_complex(1.0801, -0.4629), + gr_complex(1.0801, 1.0801), gr_complex(1.0801, 0.7715), + gr_complex(1.0801, 0.1543), gr_complex(1.0801, 0.4629), + gr_complex(0.7715, -1.0801), gr_complex(0.7715, -0.7715), + gr_complex(0.7715, -0.1543), gr_complex(0.7715, -0.4629), + gr_complex(0.7715, 1.0801), gr_complex(0.7715, 0.7715), + gr_complex(0.7715, 0.1543), gr_complex(0.7715, 0.4629), + gr_complex(0.1543, -1.0801), gr_complex(0.1543, -0.7715), + gr_complex(0.1543, -0.1543), gr_complex(0.1543, -0.4629), + gr_complex(0.1543, 1.0801), gr_complex(0.1543, 0.7715), + gr_complex(0.1543, 0.1543), gr_complex(0.1543, 0.4629), + gr_complex(0.4629, -1.0801), gr_complex(0.4629, -0.7715), + gr_complex(0.4629, -0.1543), gr_complex(0.4629, -0.4629), + gr_complex(0.4629, 1.0801), gr_complex(0.4629, 0.7715), + gr_complex(0.4629, 0.1543), gr_complex(0.4629, 0.4629)}; + diff --git a/lib/chunks_to_symbols_impl.h b/lib/chunks_to_symbols_impl.h new file mode 100644 index 0000000..040df2f --- /dev/null +++ b/lib/chunks_to_symbols_impl.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2013 Bastian Bloessl + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_IMPL_H +#define INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_IMPL_H + +#include + +namespace gr { +namespace ieee802_11 { + +class chunks_to_symbols_impl : public chunks_to_symbols +{ +public: + chunks_to_symbols_impl(); + ~chunks_to_symbols_impl(); + + int work(int noutput_items, + gr_vector_int &ninput_itmes, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + +protected: + static const gr_complex BPSK[2]; + static const gr_complex QPSK[4]; + static const gr_complex QAM16[16]; + static const gr_complex QAM64[64]; +}; + +} /* namespace ieee802_11 */ +} /* namespace gr */ + +#endif /* INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_IMPL_H */ From dab44836f55480708966b37cc69b031d9f868e49 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:51:19 +0100 Subject: [PATCH 03/21] add packet_header_generator --- grc/ieee802_11_packet_headergenerator.xml | 20 ++++++ include/ieee802-11/packet_headergenerator.h | 61 +++++++++++++++++ lib/packet_headergenerator_impl.cc | 75 +++++++++++++++++++++ lib/packet_headergenerator_impl.h | 50 ++++++++++++++ 4 files changed, 206 insertions(+) create mode 100644 grc/ieee802_11_packet_headergenerator.xml create mode 100644 include/ieee802-11/packet_headergenerator.h create mode 100644 lib/packet_headergenerator_impl.cc create mode 100644 lib/packet_headergenerator_impl.h diff --git a/grc/ieee802_11_packet_headergenerator.xml b/grc/ieee802_11_packet_headergenerator.xml new file mode 100644 index 0000000..87e34ab --- /dev/null +++ b/grc/ieee802_11_packet_headergenerator.xml @@ -0,0 +1,20 @@ + + Packet Header Generator + ieee802_11_packet_headergenerator + IEEE802.11 + import ieee802_11 + ieee802_11.packet_headergenerator($header_formatter) + + Formatter Object + header_formatter + raw + + + in + byte + + + out + byte + + diff --git a/include/ieee802-11/packet_headergenerator.h b/include/ieee802-11/packet_headergenerator.h new file mode 100644 index 0000000..f7397c9 --- /dev/null +++ b/include/ieee802-11/packet_headergenerator.h @@ -0,0 +1,61 @@ +/* -*- c++ -*- */ +/* Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_H +#define INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_H + +#include +#include +#include + +namespace gr { +namespace ieee802_11 { + +class IEEE802_11_API packet_headergenerator : virtual public tagged_stream_block +{ +public: + typedef boost::shared_ptr sptr; + + /* \param header_formatter A header formatter object. + * \param len_tag_key Length tag key. Note that for header generation, + * it is irrelevant which tag names are set in the + * formatter object, only this value is relevant! + */ + static sptr make( + const digital::packet_header_default::sptr &header_formatter, + const std::string &len_tag_key="packet_len" + ); + + /* \param header_len If this value is given, a packet_header_default + * object is used to generate the header. This is + * the number of bits per header. + * \param len_tag_key Length tag key. + */ + static sptr make( + long header_len, + const std::string &len_tag_key = "packet_len"); + }; + +} // namespace ieee802_11 +} // namespace gr + +#endif /* INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_H */ + diff --git a/lib/packet_headergenerator_impl.cc b/lib/packet_headergenerator_impl.cc new file mode 100644 index 0000000..fe8ce28 --- /dev/null +++ b/lib/packet_headergenerator_impl.cc @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2013 Bastian Bloessl + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include +#include +#include "packet_headergenerator_impl.h" + +using namespace gr::ieee802_11; + +packet_headergenerator::sptr packet_headergenerator::make( + const digital::packet_header_default::sptr &header_formatter, + const std::string &len_tag_key) { + return gnuradio::get_initial_sptr (new packet_headergenerator_impl(header_formatter, len_tag_key)); +} + + +packet_headergenerator::sptr packet_headergenerator::make( + long header_len, + const std::string &len_tag_key) { + const digital::packet_header_default::sptr header_formatter( + new digital::packet_header_default(header_len, len_tag_key)); + return gnuradio::get_initial_sptr (new packet_headergenerator_impl(header_formatter, len_tag_key)); +} + + + packet_headergenerator_impl::packet_headergenerator_impl( + const gr::digital::packet_header_default::sptr &header_formatter, + const std::string &len_tag_key + ) + : tagged_stream_block("packet_headergenerator_impl", + io_signature::make(1, 1, sizeof (char)), + io_signature::make(1, 1, sizeof (char)), + len_tag_key), + d_formatter(header_formatter) + { + set_output_multiple(d_formatter->header_len()); + // This is the worst case rate, because we don't know the true value, of course + set_relative_rate(d_formatter->header_len()); + set_tag_propagation_policy(TPP_DONT); + } + + packet_headergenerator_impl::~packet_headergenerator_impl() + { + } + + int + packet_headergenerator_impl::work (int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) + { + unsigned char *out = (unsigned char *) output_items[0]; + std::vector all_tags; + get_tags_in_range(all_tags, 0, nitems_read(0), nitems_read(0) + ninput_items[0]); + if (!d_formatter->header_formatter(ninput_items[0], out, all_tags)) { + GR_LOG_FATAL(d_logger, boost::format("header_formatter() returned false (this shouldn't happen). Offending header started at %1%") % nitems_read(0)); + throw std::runtime_error("header formatter returned false."); + } + + return d_formatter->header_len(); + } + diff --git a/lib/packet_headergenerator_impl.h b/lib/packet_headergenerator_impl.h new file mode 100644 index 0000000..f50a2f2 --- /dev/null +++ b/lib/packet_headergenerator_impl.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2013 Bastian Bloessl + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_IMPL_H +#define INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_IMPL_H + +#include + +namespace gr { +namespace ieee802_11 { + +class packet_headergenerator_impl : public packet_headergenerator +{ +private: + gr::digital::packet_header_default::sptr d_formatter; + +public: + packet_headergenerator_impl( + const digital::packet_header_default::sptr &header_formatter, + const std::string &len_tag_key + ); + ~packet_headergenerator_impl(); + + void remove_length_tags(const std::vector > &tags) {}; + int calculate_output_stream_length(const gr_vector_int &ninput_items) { return d_formatter->header_len(); }; + + int work(int noutput_items, + gr_vector_int &ninput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + }; + +} // namespace ieee802_11 +} // namespace gr + +#endif /* INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_IMPL_H */ + From c64d175178c7ec04f202a9a0ab01620e89addf99 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:52:02 +0100 Subject: [PATCH 04/21] add wifi signal header --- include/ieee802-11/wifi_signal_field.h | 41 +++++++ lib/wifi_signal_field_impl.cc | 142 +++++++++++++++++++++++++ lib/wifi_signal_field_impl.h | 47 ++++++++ 3 files changed, 230 insertions(+) create mode 100644 include/ieee802-11/wifi_signal_field.h create mode 100644 lib/wifi_signal_field_impl.cc create mode 100644 lib/wifi_signal_field_impl.h diff --git a/include/ieee802-11/wifi_signal_field.h b/include/ieee802-11/wifi_signal_field.h new file mode 100644 index 0000000..3ac3da4 --- /dev/null +++ b/include/ieee802-11/wifi_signal_field.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2013 Bastian Bloessl + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INCLUDED_IEEE802_11_WIFI_SIGNAL_FIELD_H +#define INCLUDED_IEEE802_11_WIFI_SIGNAL_FIELD_H + +#include +#include + +namespace gr { +namespace ieee802_11 { + +class IEEE802_11_API wifi_signal_field : virtual public digital::packet_header_default +{ +public: + typedef boost::shared_ptr sptr; + static sptr make(); + +protected: + wifi_signal_field(); +}; + +} // namespace ieee802_11 +} // namespace gr + +#endif /* INCLUDED_IEEE802_11_WIFI_SIGNAL_FIELD_H */ + diff --git a/lib/wifi_signal_field_impl.cc b/lib/wifi_signal_field_impl.cc new file mode 100644 index 0000000..69968f4 --- /dev/null +++ b/lib/wifi_signal_field_impl.cc @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2013 Bastian Bloessl + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "wifi_signal_field_impl.h" +#include "utils.h" +#include + +using namespace gr::ieee802_11; + +wifi_signal_field::sptr +wifi_signal_field::make() { + return wifi_signal_field::sptr(new wifi_signal_field_impl()); +} + +wifi_signal_field::wifi_signal_field() : packet_header_default(48, "packet_len") {}; + + +wifi_signal_field_impl::wifi_signal_field_impl() : packet_header_default(48, "packet_len") {} + + +wifi_signal_field_impl::~wifi_signal_field_impl() {} + + +int wifi_signal_field_impl::get_bit(int b, int i) { + return (b & (1 << i) ? 1 : 0); +} + + +void wifi_signal_field_impl::generate_signal_field(char *out, tx_param &tx, ofdm_param &ofdm) { + + //data bits of the signal header + char *signal_header = (char *) malloc(sizeof(char) * 24); + + //signal header after... + //convolutional encoding + char *encoded_signal_header = (char *) malloc(sizeof(char) * 48); + //interleaving + char *interleaved_signal_header = (char *) malloc(sizeof(char) * 48); + + int length = tx.psdu_size; + + // first 4 bits represent the modulation and coding scheme + signal_header[ 0] = get_bit(ofdm.rate_field, 3); + signal_header[ 1] = get_bit(ofdm.rate_field, 2); + signal_header[ 2] = get_bit(ofdm.rate_field, 1); + signal_header[ 3] = get_bit(ofdm.rate_field, 0); + // 5th bit is reserved and must be set to 0 + signal_header[ 4] = 0; + // then 12 bits represent the length + signal_header[ 5] = get_bit(length, 0); + signal_header[ 6] = get_bit(length, 1); + signal_header[ 7] = get_bit(length, 2); + signal_header[ 8] = get_bit(length, 3); + signal_header[ 9] = get_bit(length, 4); + signal_header[10] = get_bit(length, 5); + signal_header[11] = get_bit(length, 6); + signal_header[12] = get_bit(length, 7); + signal_header[13] = get_bit(length, 8); + signal_header[14] = get_bit(length, 9); + signal_header[15] = get_bit(length, 10); + signal_header[16] = get_bit(length, 11); + //18-th bit is the parity bit for the first 17 bits + int sum = 0; + for(int i = 0; i < 17; i++) { + if(signal_header[i]) { + sum++; + } + } + signal_header[17] = sum % 2; + + // last 6 bits must be set to 0 + for (int i = 0; i < 6; i++) { + signal_header[18 + i] = 0; + } + + ofdm_param signal_ofdm(BPSK_1_2); + tx_param signal_tx(signal_ofdm, 3); + signal_tx.n_data = 24; + signal_tx.n_sym = 1; + + // convolutional encoding (scrambling is not needed) + convolutional_encoding(signal_header, encoded_signal_header, signal_tx); + // interleaving + //interleave(encoded_signal_header, interleaved_signal_header, signal_tx, signal_ofdm); + interleave(encoded_signal_header, out, signal_tx, signal_ofdm); + + free(signal_header); + free(encoded_signal_header); + free(interleaved_signal_header); +} + +bool wifi_signal_field_impl::header_formatter(long packet_len, unsigned char *out, const std::vector &tags) +{ + + bool encoding_found = false; + bool len_found = false; + int encoding = 0; + int len = 0; + + // read tags + for(int i = 0; i < tags.size(); i++) { + if(pmt::eq(tags[i].key, pmt::mp("encoding"))) { + encoding_found = true; + encoding = pmt::to_long(tags[i].value); + } else if(pmt::eq(tags[i].key, pmt::mp("psdu_len"))) { + len_found = true; + len = pmt::to_long(tags[i].value); + } + } + + // check if all tags are present + if( (!encoding_found) || (!len_found)) { + return false; + } + + ofdm_param ofdm((Encoding)encoding); + tx_param tx(ofdm, len); + + generate_signal_field((char*)out, tx, ofdm); + return true; +} + +bool wifi_signal_field_impl::header_parser( + const unsigned char *in, std::vector &tags) { + + throw std::runtime_error("not implemented yet"); + return false; +} diff --git a/lib/wifi_signal_field_impl.h b/lib/wifi_signal_field_impl.h new file mode 100644 index 0000000..b89d093 --- /dev/null +++ b/lib/wifi_signal_field_impl.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2013 Bastian Bloessl + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INCLUDED_IEEE802_11_WIFI_SIGNAL_FIELD_IMPL_H +#define INCLUDED_IEEE802_11_WIFI_SIGNAL_FIELD_IMPL_H + +#include +#include "utils.h" + +namespace gr { +namespace ieee802_11 { + +class wifi_signal_field_impl : public wifi_signal_field +{ +public: + wifi_signal_field_impl(); + ~wifi_signal_field_impl(); + + bool header_formatter(long packet_len, unsigned char *out, + const std::vector &tags); + + bool header_parser(const unsigned char *header, + std::vector &tags); +private: + int get_bit(int b, int i); + void generate_signal_field(char *out, tx_param &tx, ofdm_param &ofdm); +}; + +} // namespace ieee802_11 +} // namespace gr + +#endif /* INCLUDED_IEEE802_11_WIFI_SIGNAL_FIELD_IMPL_H */ + From cd09dbe13281caaaf65be19ae137eab6babaec53 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:53:03 +0100 Subject: [PATCH 05/21] adapt ofdm_mapper --- grc/ieee802_11_ofdm_mapper.xml | 3 +- lib/ofdm_mapper.cc | 110 +++++++++------------------------ 2 files changed, 29 insertions(+), 84 deletions(-) diff --git a/grc/ieee802_11_ofdm_mapper.xml b/grc/ieee802_11_ofdm_mapper.xml index aaaf570..73399eb 100644 --- a/grc/ieee802_11_ofdm_mapper.xml +++ b/grc/ieee802_11_ofdm_mapper.xml @@ -40,8 +40,7 @@ out - complex - 48 + byte 1 diff --git a/lib/ofdm_mapper.cc b/lib/ofdm_mapper.cc index b9aae2b..73d1336 100644 --- a/lib/ofdm_mapper.cc +++ b/lib/ofdm_mapper.cc @@ -29,7 +29,7 @@ static const int DATA_CARRIERS = 48; ofdm_mapper_impl(Encoding e, bool debug) : block ("ofdm_mapper", gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, DATA_CARRIERS * sizeof(gr_complex))), + gr::io_signature::make(1, 1, sizeof(char))), d_symbols_offset(0), d_symbols(NULL), d_debug(debug), @@ -45,6 +45,7 @@ ofdm_mapper_impl(Encoding e, bool debug) : void print_message(const char *msg, size_t len) { + dout << std::hex << "OFDM MAPPER input symbols" << std::endl << "===========================" << std::endl; @@ -55,25 +56,12 @@ void print_message(const char *msg, size_t len) { dout << std::dec << std::endl; } -void map_to_symbols(const char *bits, size_t len) { - - dout << "OFDM MAPPER complex symbols" << std::endl - << "===========================" << std::endl; - - for(int i = 0; i < len; i++) { - - // the signal field is bpsk encoded - d_symbols[i] = (i < 48) ? BPSK[bits[i]] : mapping[bits[i]]; - dout << d_symbols[i] << " "; - } - dout << std::endl; -} int general_work(int noutput, gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items ) { - gr_complex *out = (gr_complex*)output_items[0]; + unsigned char *out = (unsigned char*)output_items[0]; dout << "OFDM MAPPER called offset: " << d_symbols_offset << " length: " << d_symbols_len << std::endl; @@ -92,11 +80,8 @@ int general_work(int noutput, gr_vector_int& ninput_items, int psdu_length = pmt::blob_length(pmt::cdr(msg)); const char *psdu = static_cast(pmt::blob_data(pmt::cdr(msg))); - // ############ INSERT MAC STUFF tx_param tx(d_ofdm, psdu_length); - //tx.print_out(); - //ofdm.print_out(); //alloc memory for modulation steps char *data_bits = (char*)calloc(tx.n_data, sizeof(char)); @@ -104,7 +89,7 @@ int general_work(int noutput, gr_vector_int& ninput_items, char *encoded_data = (char*)calloc(tx.n_data * 2, sizeof(char)); char *punctured_data = (char*)calloc(tx.n_encoded_bits, sizeof(char)); char *interleaved_data = (char*)calloc(tx.n_encoded_bits, sizeof(char)); - char *symbols = (char*)calloc((tx.n_encoded_bits / d_ofdm.n_bpsc) + 48, sizeof(char)); + char *symbols = (char*)calloc((tx.n_encoded_bits / d_ofdm.n_bpsc), sizeof(char)); //generate the OFDM data field, adding service field and pad bits generate_bits(psdu, data_bits, tx); @@ -126,30 +111,28 @@ int general_work(int noutput, gr_vector_int& ninput_items, interleave(punctured_data, interleaved_data, tx, d_ofdm); //std::cout << "interleaved" << std::endl; - split_symbols(interleaved_data, symbols + 48, tx, d_ofdm); - //std::cout << "split" << std::endl; - generate_signal_field(symbols, tx, d_ofdm); - //std::cout << "signal" << std::endl; + // one byte per symbol + split_symbols(interleaved_data, symbols, tx, d_ofdm); - d_symbols_len = (tx.n_sym + 1) * 48; - assert(d_symbols_len % 48 == 0); + d_symbols_len = tx.n_sym * 48; + + d_symbols = (char*)calloc(d_symbols_len, 1); + std::memcpy(d_symbols, symbols, d_symbols_len); - // ############ INSERT MAC STUFF + // add tags + pmt::pmt_t key = pmt::string_to_symbol("packet_len"); + pmt::pmt_t value = pmt::from_long(d_symbols_len); + pmt::pmt_t srcid = pmt::string_to_symbol(alias()); + add_item_tag(0, nitems_written(0), key, value, srcid); - d_symbols = static_cast(std::malloc(d_symbols_len * sizeof(gr_complex))); + pmt::pmt_t psdu_bytes = pmt::from_long(psdu_length); + add_item_tag(0, nitems_written(0), pmt::mp("psdu_len"), + psdu_bytes, srcid); - - print_message(static_cast(symbols), d_symbols_len); - map_to_symbols(static_cast(symbols), d_symbols_len); - - - - // add tag to indicate start of odfm frame - const pmt::pmt_t key = pmt::string_to_symbol("ofdm_start"); - const pmt::pmt_t value = pmt::from_uint64((d_symbols_len / DATA_CARRIERS)); - const pmt::pmt_t srcid = pmt::string_to_symbol(this->name()); - add_item_tag(0, this->nitems_written(0), key, value, srcid); + pmt::pmt_t encoding = pmt::from_long(d_ofdm.encoding); + add_item_tag(0, nitems_written(0), pmt::mp("encoding"), + encoding, srcid); free(data_bits); @@ -163,24 +146,15 @@ int general_work(int noutput, gr_vector_int& ninput_items, } } - int i = 0; - while(i < noutput) { + int i = std::min(noutput, d_symbols_len - d_symbols_offset); + std::memcpy(out, d_symbols + d_symbols_offset, i); + d_symbols_offset += i; - memcpy(out, d_symbols + d_symbols_offset, DATA_CARRIERS * sizeof(gr_complex)); - - i++; - d_symbols_offset += DATA_CARRIERS; - out += DATA_CARRIERS; - - if(d_symbols_offset == d_symbols_len) { - d_symbols_offset = 0; - free(d_symbols); - break; - } + if(d_symbols_offset == d_symbols_len) { + d_symbols_offset = 0; + free(d_symbols); } - dout << "OFDM MAPPER: output size: " << noutput << - " produced items: " << i << std::endl; return i; } @@ -190,43 +164,15 @@ void set_encoding(Encoding encoding) { gr::thread::scoped_lock lock(d_mutex); d_ofdm = ofdm_param(encoding); - - switch (encoding) { - case BPSK_1_2: - case BPSK_3_4: - mapping = BPSK; - break; - - case QPSK_1_2: - case QPSK_3_4: - mapping = QPSK; - break; - - case QAM16_1_2: - case QAM16_3_4: - mapping = QAM16; - break; - - case QAM64_2_3: - case QAM64_3_4: - mapping = QAM64; - break; - - default: - throw std::invalid_argument("wrong encoding"); - break; - } } private: bool d_debug; - gr_complex* d_symbols; + char* d_symbols; int d_symbols_offset; int d_symbols_len; ofdm_param d_ofdm; gr::thread::mutex d_mutex; - - const gr_complex *mapping; }; ofdm_mapper::sptr From 2609e454949adcdff3c8731a75543b4b5424f9f0 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:53:33 +0100 Subject: [PATCH 06/21] adapt ofdm_preamble --- include/ieee802-11/ofdm_preamble.h | 4 +- lib/ofdm_preamble.cc | 143 ++++------------------------- 2 files changed, 19 insertions(+), 128 deletions(-) diff --git a/include/ieee802-11/ofdm_preamble.h b/include/ieee802-11/ofdm_preamble.h index e22fcdd..2f7e7d6 100644 --- a/include/ieee802-11/ofdm_preamble.h +++ b/include/ieee802-11/ofdm_preamble.h @@ -18,12 +18,12 @@ #define INCLUDED_IEEE802_11_OFDM_PREAMBLE_H #include -#include +#include namespace gr { namespace ieee802_11 { -class IEEE802_11_API ofdm_preamble : virtual public block +class IEEE802_11_API ofdm_preamble : virtual public tagged_stream_block { public: diff --git a/lib/ofdm_preamble.cc b/lib/ofdm_preamble.cc index f9fd4bb..11bde5e 100644 --- a/lib/ofdm_preamble.cc +++ b/lib/ofdm_preamble.cc @@ -24,133 +24,41 @@ using namespace gr::ieee802_11; class ofdm_preamble_impl : public ofdm_preamble { -static const int SYMBOL_LENGTH = 80; - public: -ofdm_preamble_impl(bool debug) : block("ofdm_preamble", +ofdm_preamble_impl(bool debug) : tagged_stream_block("ofdm_preamble", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))), - d_debug(debug), - d_state(IDLE) { - - set_relative_rate(1); - set_output_multiple(SYMBOL_LENGTH); + gr::io_signature::make(1, 1, sizeof(gr_complex)), + "packet_len"), + d_debug(debug) { set_tag_propagation_policy(block::TPP_DONT); } ~ofdm_preamble_impl(){ } -int general_work (int noutput_items, gr_vector_int& ninput_items, +int calculate_output_stream_length(const gr_vector_int &ninput_items) { + return ninput_items[0] + 320; +} + +int work (int noutput_items, gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items) { - int ninput = ninput_items[0] / SYMBOL_LENGTH; - //assert(ninput_items[0] % SYMBOL_LENGTH == 0); - int noutput = noutput_items / SYMBOL_LENGTH; - const gr_complex *in = (const gr_complex*)input_items[0]; gr_complex *out = (gr_complex*)output_items[0]; - int written = 0; - int consumed = 0; + std::memcpy(out, PREAMBLE, 320 * sizeof(gr_complex)); + std::memcpy(out + 320, in, ninput_items[0] * sizeof(gr_complex)); - const uint64_t nread = this->nitems_read(0); - std::vector tags; - pmt::pmt_t key = pmt::string_to_symbol("tx_sob"); - pmt::pmt_t srcid = pmt::string_to_symbol(this->name()); - dout << "OFDM PREAMBLE: input size: " << ninput_items[0] << " output size: " - << noutput_items << std::endl; + int produced = ninput_items[0] + 320; + const pmt::pmt_t value = pmt::PMT_T; + const pmt::pmt_t src = pmt::string_to_symbol(alias()); - while(written < noutput) { + add_item_tag(0, nitems_written(0), pmt::mp("tx_sob"), value, src); + add_item_tag(0, nitems_written(0) + produced - 1, pmt::mp("tx_eob"), value, src); - // debug - dout << "OFDM PREAMBLE: iteration - consumed: " << consumed << - " written:" << written << std::endl; - //assert((consumed + 1) * SYMBOL_LENGTH <= ninput_items[0]); - - switch(d_state) { - - case IDLE: - - if(consumed >= ninput) { - goto out; - } - - dout << "OFDM PREAMBLE: start of new frame" << std::endl; - - get_tags_in_range(tags, 0, nread + consumed * SYMBOL_LENGTH, - nread + (consumed + 1) * SYMBOL_LENGTH - 1, - pmt::string_to_symbol("ofdm_start")); - - // looks like we changed to modulation scheme during the frame - if(tags.size() != 1) { - std::cout << "PREAMBLE: frame is longer than expected" << std::endl; - throw std::runtime_error("PREAMBLE: frame is too long"); - break; - } - d_frame_left = pmt::to_uint64(tags[0].value); - d_preamble_left = 4; - d_state = PRE; - - // add tag to indicate start of odfm frame - add_item_tag(0, this->nitems_written(0) + written * SYMBOL_LENGTH, key, pmt::PMT_T, srcid); - - // FALL THROUGH !!!!! - - case PRE: - - dout << "OFDM PREAMBLE: copy preamble" << std::endl; - - memcpy(out, PREAMBLE + (4 - d_preamble_left) * SYMBOL_LENGTH, - SYMBOL_LENGTH * sizeof(gr_complex)); - - out += SYMBOL_LENGTH; - written++; - d_preamble_left--; - - if(!d_preamble_left) { - d_state = FRAME; - } - - break; - - case FRAME: - if(consumed >= ninput) { - goto out; - } - - dout << "OFDM PREAMBLE: copy frame" << std::endl; - - memcpy(out, in, SYMBOL_LENGTH * sizeof(gr_complex)); - - consumed++; - in += SYMBOL_LENGTH; - out += SYMBOL_LENGTH; - written++; - d_frame_left--; - - if(!d_frame_left) { - d_state = IDLE; - insert_eob(nitems_written(0) + written * SYMBOL_LENGTH -1); - goto out; - } - - break; - - default: - assert(false); - break; - } - } - -out: - - dout << "PREAMBLE: consumed " << consumed * SYMBOL_LENGTH; - dout << " written " << written * SYMBOL_LENGTH << std::endl; - consume(0, consumed * SYMBOL_LENGTH); - return written * SYMBOL_LENGTH; + return produced; } void insert_eob(uint64_t item) { @@ -159,27 +67,10 @@ void insert_eob(uint64_t item) { const pmt::pmt_t eob_key = pmt::string_to_symbol("tx_eob"); const pmt::pmt_t value = pmt::PMT_T; const pmt::pmt_t srcid = pmt::string_to_symbol(this->name()); - add_item_tag(0, item, eob_key, value, srcid); -} - -void -forecast (int noutput_items, gr_vector_int &ninput_items_required) -{ - if(d_state == PRE) { - ninput_items_required[0] = 0; - } else { - ninput_items_required[0] = noutput_items; - } - - dout << "forecast noutput_items: " << noutput_items << " required: " << ninput_items_required[0] << std::endl; } private: bool d_debug; - size_t d_preamble_left; - size_t d_frame_left; - enum {IDLE, PRE, FRAME} d_state; - static gr_complex PREAMBLE[320]; }; From 797ecad685037ed3e13d90f0d87d968ba939cefc Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:53:52 +0100 Subject: [PATCH 07/21] adapt utils --- lib/utils.cc | 127 ++++----------------------------------------------- lib/utils.h | 7 --- 2 files changed, 10 insertions(+), 124 deletions(-) diff --git a/lib/utils.cc b/lib/utils.cc index 5ae7a87..f476af8 100644 --- a/lib/utils.cc +++ b/lib/utils.cc @@ -21,32 +21,15 @@ #include // constellations for different modulations (normalized to avg power 1) -const std::complex BPSK[2] = { - std::complex(-1.0, 0.0), std::complex(1.0, 0.0)}; - const std::complex BPSK_D[2] = { std::complex(-1.0, 0.0), std::complex(1.0, 0.0)}; -const std::complex QPSK[4] = { - std::complex(-0.7071, -0.7071), std::complex(-0.7071, 0.7071), - std::complex(+0.7071, -0.7071), std::complex(+0.7071, 0.7071)}; - const std::complex QPSK_D[4] = { std::complex(-0.7071, -0.7071), std::complex(-0.7071, 0.7071), std::complex(+0.7071, -0.7071), std::complex(+0.7071, 0.7071)}; -const std::complex QAM16[16] = { - std::complex(-0.9487, -0.9487), std::complex(-0.9487, -0.3162), - std::complex(-0.9487, 0.9487), std::complex(-0.9487, 0.3162), - std::complex(-0.3162, -0.9487), std::complex(-0.3162, -0.3162), - std::complex(-0.3162, 0.9487), std::complex(-0.3162, 0.3162), - std::complex(0.9487, -0.9487), std::complex(0.9487, -0.3162), - std::complex(0.9487, 0.9487), std::complex(0.9487, 0.3162), - std::complex(0.3162, -0.9487), std::complex(0.3162, -0.3162), - std::complex(0.3162, 0.9487), std::complex(0.3162, 0.3162)}; - const std::complex QAM16_D[16] = { std::complex(-0.9487, -0.9487), std::complex(-0.9487, -0.3162), std::complex(-0.9487, 0.9487), std::complex(-0.9487, 0.3162), @@ -58,40 +41,6 @@ const std::complex QAM16_D[16] = { std::complex(0.3162, 0.9487), std::complex(0.3162, 0.3162)}; -const std::complex QAM64[64] = { - std::complex(-1.0801, -1.0801), std::complex(-1.0801, -0.7715), - std::complex(-1.0801, -0.1543), std::complex(-1.0801, -0.4629), - std::complex(-1.0801, 1.0801), std::complex(-1.0801, 0.7715), - std::complex(-1.0801, 0.1543), std::complex(-1.0801, 0.4629), - std::complex(-0.7715, -1.0801), std::complex(-0.7715, -0.7715), - std::complex(-0.7715, -0.1543), std::complex(-0.7715, -0.4629), - std::complex(-0.7715, 1.0801), std::complex(-0.7715, 0.7715), - std::complex(-0.7715, 0.1543), std::complex(-0.7715, 0.4629), - std::complex(-0.1543, -1.0801), std::complex(-0.1543, -0.7715), - std::complex(-0.1543, -0.1543), std::complex(-0.1543, -0.4629), - std::complex(-0.1543, 1.0801), std::complex(-0.1543, 0.7715), - std::complex(-0.1543, 0.1543), std::complex(-0.1543, 0.4629), - std::complex(-0.4629, -1.0801), std::complex(-0.4629, -0.7715), - std::complex(-0.4629, -0.1543), std::complex(-0.4629, -0.4629), - std::complex(-0.4629, 1.0801), std::complex(-0.4629, 0.7715), - std::complex(-0.4629, 0.1543), std::complex(-0.4629, 0.4629), - std::complex(1.0801, -1.0801), std::complex(1.0801, -0.7715), - std::complex(1.0801, -0.1543), std::complex(1.0801, -0.4629), - std::complex(1.0801, 1.0801), std::complex(1.0801, 0.7715), - std::complex(1.0801, 0.1543), std::complex(1.0801, 0.4629), - std::complex(0.7715, -1.0801), std::complex(0.7715, -0.7715), - std::complex(0.7715, -0.1543), std::complex(0.7715, -0.4629), - std::complex(0.7715, 1.0801), std::complex(0.7715, 0.7715), - std::complex(0.7715, 0.1543), std::complex(0.7715, 0.4629), - std::complex(0.1543, -1.0801), std::complex(0.1543, -0.7715), - std::complex(0.1543, -0.1543), std::complex(0.1543, -0.4629), - std::complex(0.1543, 1.0801), std::complex(0.1543, 0.7715), - std::complex(0.1543, 0.1543), std::complex(0.1543, 0.4629), - std::complex(0.4629, -1.0801), std::complex(0.4629, -0.7715), - std::complex(0.4629, -0.1543), std::complex(0.4629, -0.4629), - std::complex(0.4629, 1.0801), std::complex(0.4629, 0.7715), - std::complex(0.4629, 0.1543), std::complex(0.4629, 0.4629)}; - const std::complex QAM64_D[64] = { std::complex(-1.0801, -1.0801), std::complex(-1.0801, -0.7715), std::complex(-1.0801, -0.1543), std::complex(-1.0801, -0.4629), @@ -192,6 +141,7 @@ ofdm_param::ofdm_param(Encoding e) { } } + void ofdm_param::print() { std::cout << "OFDM Parameters:" << std::endl; @@ -202,6 +152,7 @@ ofdm_param::print() { std::cout << "n_dbps :" << n_dbps << std::endl; } + tx_param::tx_param(ofdm_param &ofdm, int psdu_length) { psdu_size = psdu_length; @@ -226,9 +177,6 @@ tx_param::print() { std::cout << "n_pad: " << n_pad << std::endl; } -int get_bit(int b, int i) { - return (b & (1 << i) ? 1 : 0); -} void scramble(const char *in, char *out, tx_param &tx, char initial_state) { @@ -243,10 +191,12 @@ void scramble(const char *in, char *out, tx_param &tx, char initial_state) { } } + void reset_tail_bits(char *scrambled_data, tx_param &tx) { memset(scrambled_data + tx.n_data - tx.n_pad - 6, 0, 6 * sizeof(char)); } + int ones(int n) { int sum = 0; for(int i = 0; i < 8; i++) { @@ -257,6 +207,7 @@ int ones(int n) { return sum; } + void convolutional_encoding(const char *in, char *out, tx_param &tx) { int state = 0; @@ -269,6 +220,7 @@ void convolutional_encoding(const char *in, char *out, tx_param &tx) { } } + void puncturing(const char *in, char *out, tx_param &tx, ofdm_param &ofdm) { int mod; @@ -306,6 +258,7 @@ void puncturing(const char *in, char *out, tx_param &tx, ofdm_param &ofdm) { } } + void interleave(const char *in, char *out, tx_param &tx, ofdm_param &ofdm, bool reverse) { int n_cbps = ofdm.n_cbps; @@ -332,6 +285,7 @@ void interleave(const char *in, char *out, tx_param &tx, ofdm_param &ofdm, bool } } + void interleave(const double *in, double *out, tx_param &tx, ofdm_param &ofdm, bool reverse) { int n_cbps = ofdm.n_cbps; @@ -357,6 +311,8 @@ void interleave(const double *in, double *out, tx_param &tx, ofdm_param &ofdm, b } } } + + void split_symbols(const char *in, char *out, tx_param &tx, ofdm_param &ofdm) { int symbols = tx.n_sym * 48; @@ -372,69 +328,6 @@ void split_symbols(const char *in, char *out, tx_param &tx, ofdm_param &ofdm) { } -void generate_signal_field(char *out, tx_param &tx, ofdm_param &ofdm) { - - //data bits of the signal header - char *signal_header = (char *) malloc(sizeof(char) * 24); - - //signal header after... - //convolutional encoding - char *encoded_signal_header = (char *) malloc(sizeof(char) * 48); - //interleaving - char *interleaved_signal_header = (char *) malloc(sizeof(char) * 48); - - int length = tx.psdu_size; - - // first 4 bits represent the modulation and coding scheme - signal_header[ 0] = get_bit(ofdm.rate_field, 3); - signal_header[ 1] = get_bit(ofdm.rate_field, 2); - signal_header[ 2] = get_bit(ofdm.rate_field, 1); - signal_header[ 3] = get_bit(ofdm.rate_field, 0); - // 5th bit is reserved and must be set to 0 - signal_header[ 4] = 0; - // then 12 bits represent the length - signal_header[ 5] = get_bit(length, 0); - signal_header[ 6] = get_bit(length, 1); - signal_header[ 7] = get_bit(length, 2); - signal_header[ 8] = get_bit(length, 3); - signal_header[ 9] = get_bit(length, 4); - signal_header[10] = get_bit(length, 5); - signal_header[11] = get_bit(length, 6); - signal_header[12] = get_bit(length, 7); - signal_header[13] = get_bit(length, 8); - signal_header[14] = get_bit(length, 9); - signal_header[15] = get_bit(length, 10); - signal_header[16] = get_bit(length, 11); - //18-th bit is the parity bit for the first 17 bits - int sum = 0; - for(int i = 0; i < 17; i++) { - if(signal_header[i]) { - sum++; - } - } - signal_header[17] = sum % 2; - - // last 6 bits must be set to 0 - for (int i = 0; i < 6; i++) { - signal_header[18 + i] = 0; - } - - ofdm_param signal_ofdm(BPSK_1_2); - tx_param signal_tx(signal_ofdm, 3); - signal_tx.n_data = 24; - signal_tx.n_sym = 1; - - // convolutional encoding (scrambling is not needed) - convolutional_encoding(signal_header, encoded_signal_header, signal_tx); - // interleaving - //interleave(encoded_signal_header, interleaved_signal_header, signal_tx, signal_ofdm); - interleave(encoded_signal_header, out, signal_tx, signal_ofdm); - - free(signal_header); - free(encoded_signal_header); - free(interleaved_signal_header); -} - void generate_bits(const char *psdu, char *data_bits, tx_param &tx) { // first 16 bits are zero (SERVICE/DATA field) diff --git a/lib/utils.h b/lib/utils.h index 7f665ca..47ab7ec 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -31,11 +31,6 @@ #define mylog(msg) do { d_log && std::cout << msg << std::endl; } while(0); #endif -extern const std::complex BPSK[2]; -extern const std::complex QPSK[4]; -extern const std::complex QAM16[16]; -extern const std::complex QAM64[64]; - // same mappings in double (itpp sucks) extern const std::complex BPSK_D[2]; extern const std::complex QPSK_D[4]; @@ -120,8 +115,6 @@ void interleave(const double *input, double *out, tx_param &tx, ofdm_param &ofdm void split_symbols(const char *input, char *out, tx_param &tx, ofdm_param &ofdm); -void generate_signal_field(char *out, tx_param &tx, ofdm_param &ofdm); - void generate_bits(const char *psdu, char *data_bits, tx_param &tx); #endif /* INCLUDED_IEEE802_11_OFDM_UTILS_H */ From ac52829655e179fc01a037eb5bd22bb3e239b7e4 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:54:19 +0100 Subject: [PATCH 08/21] adapt build --- CMakeLists.txt | 2 +- include/ieee802-11/CMakeLists.txt | 4 +++- lib/CMakeLists.txt | 5 ++++- swig/ieee802_11_swig.i | 22 +++++++++++++++++++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 020ab7e..daa483f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,7 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## # Find gnuradio build dependencies ######################################################################## -set(GR_REQUIRED_COMPONENTS RUNTIME FILTER FFT PMT) +set(GR_REQUIRED_COMPONENTS RUNTIME FILTER FFT PMT DIGITAL) find_package(Gnuradio) find_package(CppUnit) diff --git a/include/ieee802-11/CMakeLists.txt b/include/ieee802-11/CMakeLists.txt index 5b0e007..e92cf8c 100644 --- a/include/ieee802-11/CMakeLists.txt +++ b/include/ieee802-11/CMakeLists.txt @@ -69,6 +69,7 @@ add_custom_target(ieee802_11_generated_includes DEPENDS list(APPEND include_sources ${generated_includes} api.h + chunks_to_symbols.h ether_encap.h ofdm_decode_mac.h ofdm_decode_signal.h @@ -77,10 +78,11 @@ list(APPEND include_sources ofdm_mac.h ofdm_mapper.h ofdm_parse_mac.h - ofdm_pilot.h ofdm_preamble.h ofdm_sync_long.h ofdm_sync_short.h + packet_headergenerator.h + wifi_signal_field.h ) install( diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 32e1d56..418d420 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -101,6 +101,7 @@ include_directories( ######################################################################## list(APPEND gr_ieee802_11_sources ${generated_sources} + chunks_to_symbols_impl.cc ether_encap_impl.cc ofdm_decode_mac.cc ofdm_decode_signal.cc @@ -109,11 +110,12 @@ list(APPEND gr_ieee802_11_sources ofdm_mac.cc ofdm_mapper.cc ofdm_parse_mac.cc - ofdm_pilot.cc ofdm_preamble.cc ofdm_sync_long.cc ofdm_sync_short.cc + packet_headergenerator_impl.cc utils.cc + wifi_signal_field_impl.cc ) list(APPEND gr_ieee802_11_libs @@ -122,6 +124,7 @@ list(APPEND gr_ieee802_11_libs ${GNURADIO_FFT_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} + ${GNURADIO_DIGITAL_LIBRARIES} ) add_library(gnuradio-ieee802_11 SHARED ${gr_ieee802_11_sources}) diff --git a/swig/ieee802_11_swig.i b/swig/ieee802_11_swig.i index c0c1b9b..161a337 100644 --- a/swig/ieee802_11_swig.i +++ b/swig/ieee802_11_swig.i @@ -15,12 +15,17 @@ * along with this program. If not, see . */ #define IEEE802_11_API +#define DIGITAL_API %include "gnuradio.i" +//%include "digital_swig.i" %include "ieee802_11_swig_doc.i" %{ +#include "gnuradio/digital/packet_header_default.h" + +#include "ieee802-11/chunks_to_symbols.h" #include "ieee802-11/ether_encap.h" #include "ieee802-11/moving_average_cc.h" #include "ieee802-11/moving_average_ff.h" @@ -31,12 +36,16 @@ #include "ieee802-11/ofdm_mac.h" #include "ieee802-11/ofdm_mapper.h" #include "ieee802-11/ofdm_parse_mac.h" -#include "ieee802-11/ofdm_pilot.h" #include "ieee802-11/ofdm_preamble.h" #include "ieee802-11/ofdm_sync_long.h" #include "ieee802-11/ofdm_sync_short.h" +#include "ieee802-11/packet_headergenerator.h" +#include "ieee802-11/wifi_signal_field.h" %} +%include "gnuradio/digital/packet_header_default.h" + +%include "ieee802-11/chunks_to_symbols.h" %include "ieee802-11/ether_encap.h" %include "ieee802-11/moving_average_cc.h" %include "ieee802-11/moving_average_ff.h" @@ -47,11 +56,13 @@ %include "ieee802-11/ofdm_mac.h" %include "ieee802-11/ofdm_mapper.h" %include "ieee802-11/ofdm_parse_mac.h" -%include "ieee802-11/ofdm_pilot.h" %include "ieee802-11/ofdm_preamble.h" %include "ieee802-11/ofdm_sync_long.h" %include "ieee802-11/ofdm_sync_short.h" +%include "ieee802-11/packet_headergenerator.h" +%include "ieee802-11/wifi_signal_field.h" +GR_SWIG_BLOCK_MAGIC2(ieee802_11, chunks_to_symbols); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ether_encap); GR_SWIG_BLOCK_MAGIC2(ieee802_11, moving_average_cc); GR_SWIG_BLOCK_MAGIC2(ieee802_11, moving_average_ff); @@ -62,8 +73,13 @@ GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_freq_est); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_mac); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_mapper); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_parse_mac); -GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_pilot); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_preamble); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_sync_long); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_sync_short); +GR_SWIG_BLOCK_MAGIC2(ieee802_11, packet_headergenerator); +%template(wifi_signal_field_sptr) boost::shared_ptr; +%pythoncode %{ +wifi_signal_field_sptr.__repr__ = lambda self: "" +wifi_signal_field = wifi_signal_field .make; +%} From f1401a29aaf1468445bcfa8b255b3201cc8878e5 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 31 Dec 2013 12:55:42 +0100 Subject: [PATCH 09/21] rename and update flow graphs --- .../{ofdm_loopback.grc => wifi_loopback.grc} | 1238 +++++----- .../{ofdm_phy_hier.grc => wifi_phy_hier.grc} | 2144 +++++++++-------- examples/{ofdm_rx.grc => wifi_rx.grc} | 50 +- ...m_transceiver.grc => wifi_transceiver.grc} | 900 ++++--- examples/{ofdm_tx.grc => wifi_tx.grc} | 384 ++- 5 files changed, 2363 insertions(+), 2353 deletions(-) rename examples/{ofdm_loopback.grc => wifi_loopback.grc} (91%) rename examples/{ofdm_phy_hier.grc => wifi_phy_hier.grc} (72%) rename examples/{ofdm_rx.grc => wifi_rx.grc} (97%) rename examples/{ofdm_transceiver.grc => wifi_transceiver.grc} (96%) rename examples/{ofdm_tx.grc => wifi_tx.grc} (95%) diff --git a/examples/ofdm_loopback.grc b/examples/wifi_loopback.grc similarity index 91% rename from examples/ofdm_loopback.grc rename to examples/wifi_loopback.grc index 81257dd..b1b3e3c 100644 --- a/examples/ofdm_loopback.grc +++ b/examples/wifi_loopback.grc @@ -1,11 +1,11 @@ - Thu Dec 5 14:23:25 2013 + Tue Dec 31 11:44:27 2013 options id - ofdm_loopback + wifi_loopback _enabled @@ -134,52 +134,6 @@ 0 - - blocks_ctrlport_monitor_performance - - id - blocks_ctrlport_monitor_performance_0 - - - _enabled - False - - - en - True - - - _coordinate - (1055, 164) - - - _rotation - 0 - - - - blocks_ctrlport_monitor - - id - blocks_ctrlport_monitor_0 - - - _enabled - False - - - en - True - - - _coordinate - (1089, 216) - - - _rotation - 0 - - variable_slider @@ -235,479 +189,6 @@ 0 - - blocks_add_xx - - id - blocks_add_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (583, 278) - - - _rotation - 180 - - - - ieee802_11_ofdm_parse_mac - - id - ieee802_11_ofdm_parse_mac_0 - - - _enabled - True - - - log - False - - - debug - True - - - affinity - - - - _coordinate - (113, 249) - - - _rotation - 180 - - - - ofdm_phy_hier - - id - ofdm_phy_hier_1 - - - _enabled - True - - - encoding - encoding - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (359, 261) - - - _rotation - 180 - - - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (374, 147) - - - _rotation - 0 - - - - blocks_message_strobe - - id - blocks_message_strobe_0 - - - _enabled - True - - - msg - pmt.intern("Hello World") - - - period - 200 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (83, 135) - - - _rotation - 0 - - - - foo_packet_pad - - id - foo_packet_pad_0 - - - _enabled - True - - - debug - False - - - pad_front - 60000 - - - pad_tail - 20000 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (353, 408) - - - _rotation - 0 - - - - blocks_multiply_xx - - id - blocks_multiply_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (544, 428) - - - _rotation - 0 - - - - analog_sig_source_x - - id - analog_sig_source_x_0 - - - _enabled - True - - - type - complex - - - samp_rate - samp_rate - - - waveform - analog.GR_COS_WAVE - - - freq - freq_offset - - - amp - 1 - - - offset - 0 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (339, 547) - - - _rotation - 0 - - - - variable_slider - - id - signal_power - - - _enabled - True - - - label - - - - value - 0.39 - - - min - 0 - - - max - 3 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (693, 7) - - - _rotation - 0 - - - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - signal_power**.5 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (696, 441) - - - _rotation - 0 - - - - variable_slider - - id - noise_power - - - _enabled - True - - - label - - - - value - 0.01 - - - min - 0.01 - - - max - 5 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (829, 5) - - - _rotation - 0 - - import @@ -774,92 +255,6 @@ 0 - - analog_noise_source_x - - id - analog_noise_source_x_0 - - - _enabled - True - - - type - complex - - - noise_type - analog.GR_GAUSSIAN - - - amp - (noise_power/2.0)**0.5 - - - seed - 0 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (872, 258) - - - _rotation - 180 - - - - foo_wireshark_connector - - id - foo_wireshark_connector_0 - - - _enabled - False - - - tech - 127 - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (628, 169) - - - _rotation - 0 - - blocks_file_sink @@ -903,6 +298,573 @@ 0 + + ieee802_11_ofdm_mac + + id + ieee802_11_ofdm_mac_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (374, 147) + + + _rotation + 0 + + + + blocks_add_xx + + id + blocks_add_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (583, 278) + + + _rotation + 180 + + + + blocks_multiply_xx + + id + blocks_multiply_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (544, 440) + + + _rotation + 0 + + + + analog_sig_source_x + + id + analog_sig_source_x_0 + + + _enabled + True + + + type + complex + + + samp_rate + samp_rate + + + waveform + analog.GR_COS_WAVE + + + freq + freq_offset + + + amp + 1 + + + offset + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (338, 548) + + + _rotation + 0 + + + + foo_wireshark_connector + + id + foo_wireshark_connector_0 + + + _enabled + False + + + tech + 127 + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (628, 169) + + + _rotation + 0 + + + + ieee802_11_ofdm_parse_mac + + id + ieee802_11_ofdm_parse_mac_0 + + + _enabled + True + + + log + False + + + debug + True + + + affinity + + + + _coordinate + (110, 251) + + + _rotation + 180 + + + + foo_packet_pad + + id + foo_packet_pad_0 + + + _enabled + True + + + debug + False + + + delay + False + + + delay_sec + 0.001 + + + pad_front + 60000 + + + pad_tail + 20000 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (308, 408) + + + _rotation + 0 + + + + variable_slider + + id + noise_power + + + _enabled + True + + + label + + + + value + 0.01 + + + min + 0.01 + + + max + 5 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (814, 8) + + + _rotation + 0 + + + + blocks_message_strobe + + id + blocks_message_strobe_0 + + + _enabled + True + + + msg + pmt.intern("Hello World!") + + + period + 300 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (83, 136) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + encoding + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (360, 262) + + + _rotation + 180 + + + + analog_noise_source_x + + id + analog_noise_source_x_0 + + + _enabled + True + + + type + complex + + + noise_type + analog.GR_GAUSSIAN + + + amp + (noise_power/2.0)**0.5 + + + seed + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (865, 260) + + + _rotation + 180 + + + + blocks_multiply_const_vxx + + id + blocks_multiply_const_vxx_0 + + + _enabled + True + + + type + complex + + + const + signal_power**.5 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (696, 452) + + + _rotation + 0 + + + + variable_slider + + id + signal_power + + + _enabled + True + + + label + + + + value + 2.0 + + + min + 0 + + + max + 3 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (693, 7) + + + _rotation + 0 + + foo_wireshark_connector_0 blocks_file_sink_0 @@ -921,24 +883,12 @@ 0 0 - - ofdm_phy_hier_1 - foo_packet_pad_0 - 0 - 0 - analog_noise_source_x_0 blocks_add_xx_0 0 1 - - blocks_add_xx_0 - ofdm_phy_hier_1 - 0 - 0 - blocks_multiply_xx_0 blocks_multiply_const_vxx_0 @@ -952,7 +902,37 @@ 0 - ofdm_phy_hier_1 + ieee802_11_ofdm_mac_0 + foo_wireshark_connector_0 + phy out + in + + + ieee802_11_ofdm_mac_0 + wifi_phy_hier_0 + phy out + mac_in + + + blocks_add_xx_0 + wifi_phy_hier_0 + 0 + 0 + + + wifi_phy_hier_0 + foo_packet_pad_0 + 0 + 0 + + + wifi_phy_hier_0 + ieee802_11_ofdm_mac_0 + mac_out + phy in + + + wifi_phy_hier_0 ieee802_11_ofdm_parse_mac_0 mac_out in @@ -963,22 +943,4 @@ strobe app in - - ofdm_phy_hier_1 - ieee802_11_ofdm_mac_0 - mac_out - phy in - - - ieee802_11_ofdm_mac_0 - ofdm_phy_hier_1 - phy out - mac_in - - - ieee802_11_ofdm_mac_0 - foo_wireshark_connector_0 - phy out - in - diff --git a/examples/ofdm_phy_hier.grc b/examples/wifi_phy_hier.grc similarity index 72% rename from examples/ofdm_phy_hier.grc rename to examples/wifi_phy_hier.grc index fe7dad5..db4af1c 100644 --- a/examples/ofdm_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -1,11 +1,11 @@ - Wed Nov 27 17:35:35 2013 + Tue Dec 31 11:49:08 2013 options id - ofdm_phy_hier + wifi_phy_hier _enabled @@ -13,7 +13,7 @@ title - OFDM PHY Hier + WiFi PHY Hier author @@ -64,7 +64,7 @@ variable id - sync_length + header_formatter _enabled @@ -72,11 +72,11 @@ value - 320 + ieee802_11.wifi_signal_field() _coordinate - (213, 13) + (518, 18) _rotation @@ -107,157 +107,28 @@ - pad_source + variable id - pad_source_0 + sync_length _enabled True - label - samp_in - - - type - complex - - - vlen - 1 - - - num_streams - 1 - - - optional - False + value + 320 _coordinate - (48, 386) + (196, 14) _rotation 0 - - blocks_conjugate_cc - - id - blocks_conjugate_cc_0 - - - _enabled - True - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (370, 480) - - - _rotation - 0 - - - - blocks_delay - - id - blocks_delay_0_0 - - - _enabled - True - - - type - complex - - - delay - 16 - - - num_ports - 1 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (224, 476) - - - _rotation - 0 - - - - ieee802_11_ofdm_equalize_symbols - - id - ieee802_11_ofdm_equalize_symbols_0 - - - _enabled - True - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (754, 809) - - - _rotation - 180 - - parameter @@ -293,588 +164,6 @@ 0 - - blocks_stream_to_vector - - id - blocks_stream_to_vector_0 - - - _enabled - True - - - type - complex - - - num_items - 64 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (1013, 661) - - - _rotation - 0 - - - - blocks_delay - - id - blocks_delay_0 - - - _enabled - True - - - type - complex - - - delay - sync_length - - - num_ports - 1 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (449, 678) - - - _rotation - 0 - - - - blocks_multiply_xx - - id - blocks_multiply_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (596, 446) - - - _rotation - 0 - - - - blocks_complex_to_mag - - id - blocks_complex_to_mag_0 - - - _enabled - True - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (960, 463) - - - _rotation - 0 - - - - blocks_complex_to_mag_squared - - id - blocks_complex_to_mag_squared_0 - - - _enabled - True - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (586, 390) - - - _rotation - 0 - - - - blocks_divide_xx - - id - blocks_divide_xx_0 - - - _enabled - True - - - type - float - - - vlen - 1 - - - num_inputs - 2 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (1116, 540) - - - _rotation - 270 - - - - digital_ofdm_cyclic_prefixer - - id - digital_ofdm_cyclic_prefixer_0 - - - _enabled - True - - - input_size - 64 - - - cp_len - 16 - - - rolloff - 2 - - - tagname - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (956, 238) - - - _rotation - 180 - - - - ieee802_11_ofdm_preamble - - id - ieee802_11_ofdm_preamble_0 - - - _enabled - True - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (491, 254) - - - _rotation - 180 - - - - ieee802_11_ofdm_pilot - - id - ieee802_11_ofdm_pilot_0 - - - _enabled - True - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (630, 116) - - - _rotation - 0 - - - - fft_vxx - - id - fft_vxx_0 - - - _enabled - True - - - type - complex - - - fft_size - 64 - - - forward - False - - - window - window.rectangular(64) - - - shift - True - - - nthreads - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (850, 84) - - - _rotation - 0 - - - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - 1/52**0.5 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (741, 254) - - - _rotation - 180 - - - - ieee802_11_moving_average_xx - - id - ieee802_11_moving_average_xx_1 - - - _enabled - True - - - type - complex - - - length - window_size - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (759, 459) - - - _rotation - 0 - - - - ieee802_11_moving_average_xx - - id - ieee802_11_moving_average_xx_0 - - - _enabled - True - - - type - float - - - length - window_size - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (867, 386) - - - _rotation - 0 - - - - ieee802_11_ofdm_sync_long - - id - sync_long - - - _enabled - True - - - log - False - - - debug - False - - - sync_length - sync_length - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (669, 645) - - - _rotation - 0 - - ieee802_11_ofdm_sync_short @@ -919,7 +208,237 @@ _coordinate - (169, 612) + (178, 775) + + + _rotation + 0 + + + + ieee802_11_moving_average_xx + + id + ieee802_11_moving_average_xx_0 + + + _enabled + True + + + type + float + + + length + window_size + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (876, 549) + + + _rotation + 0 + + + + ieee802_11_moving_average_xx + + id + ieee802_11_moving_average_xx_1 + + + _enabled + True + + + type + complex + + + length + window_size + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (768, 622) + + + _rotation + 0 + + + + blocks_divide_xx + + id + blocks_divide_xx_0 + + + _enabled + True + + + type + float + + + vlen + 1 + + + num_inputs + 2 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1125, 703) + + + _rotation + 270 + + + + blocks_complex_to_mag_squared + + id + blocks_complex_to_mag_squared_0 + + + _enabled + True + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (595, 553) + + + _rotation + 0 + + + + blocks_complex_to_mag + + id + blocks_complex_to_mag_0 + + + _enabled + True + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (969, 626) + + + _rotation + 0 + + + + pad_source + + id + pad_source_0 + + + _enabled + True + + + label + samp_in + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (57, 549) _rotation @@ -974,7 +493,7 @@ _coordinate - (1000, 777) + (1009, 908) _rotation @@ -982,19 +501,15 @@ - ieee802_11_ofdm_decode_signal + ieee802_11_ofdm_equalize_symbols id - ieee802_11_ofdm_decode_signal_0 + ieee802_11_ofdm_equalize_symbols_0 _enabled True - - log - False - debug False @@ -1013,130 +528,13 @@ _coordinate - (511, 801) + (757, 936) _rotation 180 - - pad_sink - - id - pad_sink_0 - - - _enabled - True - - - label - samp_out - - - type - complex - - - vlen - 1 - - - num_streams - 1 - - - optional - False - - - _coordinate - (175, 254) - - - _rotation - 180 - - - - pad_source - - id - pad_source_1 - - - _enabled - True - - - label - mac_in - - - type - message - - - vlen - 1 - - - num_streams - 1 - - - optional - False - - - _coordinate - (131, 116) - - - _rotation - 0 - - - - ieee802_11_ofdm_mapper - - id - ieee802_11_ofdm_mapper_0 - - - _enabled - True - - - encoding - encoding - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (382, 108) - - - _rotation - 0 - - ieee802_11_ofdm_decode_mac @@ -1169,7 +567,7 @@ _coordinate - (260, 801) + (276, 929) _rotation @@ -1208,124 +606,846 @@ _coordinate - (65, 809) + (63, 936) _rotation 180 + + pad_source + + id + pad_source_1 + + + _enabled + True + + + label + mac_in + + + type + message + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (390, 130) + + + _rotation + 180 + + + + digital_ofdm_carrier_allocator_cvc + + id + digital_ofdm_carrier_allocator_cvc_0 + + + _enabled + True + + + fft_len + 64 + + + occupied_carriers + (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),) + + + pilot_carriers + ((-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21)) + + + pilot_symbols + ((1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1)) + + + sync_words + () + + + len_tag_key + "packet_len" + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (993, 246) + + + _rotation + 0 + + + + digital_ofdm_cyclic_prefixer + + id + digital_ofdm_cyclic_prefixer_0 + + + _enabled + True + + + input_size + 64 + + + cp_len + 16 + + + rolloff + 2 + + + tagname + "packet_len" + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (741, 410) + + + _rotation + 180 + + + + ieee802_11_ofdm_preamble + + id + ieee802_11_ofdm_preamble_0 + + + _enabled + True + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (498, 424) + + + _rotation + 180 + + + + pad_sink + + id + pad_sink_0 + + + _enabled + True + + + label + samp_out + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (280, 424) + + + _rotation + 180 + + + + digital_chunks_to_symbols_xx + + id + digital_chunks_to_symbols_xx_0 + + + _enabled + True + + + in_type + byte + + + out_type + complex + + + symbol_table + [-1, 1] + + + dimension + 1 + + + num_ports + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (494, 230) + + + _rotation + 0 + + + + ieee802_11_packet_headergenerator + + id + ieee802_11_packet_headergenerator_0 + + + _enabled + True + + + header_formatter + header_formatter.formatter() + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (181, 237) + + + _rotation + 0 + + + + ieee802_11_ofdm_sync_long + + id + sync_long + + + _enabled + True + + + log + False + + + debug + False + + + sync_length + sync_length + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (678, 805) + + + _rotation + 0 + + + + blocks_delay + + id + blocks_delay_0 + + + _enabled + True + + + type + complex + + + delay + sync_length + + + num_ports + 1 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (458, 835) + + + _rotation + 0 + + + + blocks_stream_to_vector + + id + blocks_stream_to_vector_0 + + + _enabled + True + + + type + complex + + + num_items + 64 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1017, 819) + + + _rotation + 0 + + + + ieee802_11_ofdm_decode_signal + + id + ieee802_11_ofdm_decode_signal_0 + + + _enabled + True + + + log + False + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (522, 929) + + + _rotation + 180 + + + + blocks_multiply_xx + + id + blocks_multiply_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (607, 610) + + + _rotation + 0 + + + + blocks_conjugate_cc + + id + blocks_conjugate_cc_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (379, 642) + + + _rotation + 0 + + + + blocks_delay + + id + blocks_delay_0_0 + + + _enabled + True + + + type + complex + + + delay + 16 + + + num_ports + 1 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (233, 638) + + + _rotation + 0 + + + + ieee802_11_ofdm_mapper + + id + ieee802_11_ofdm_mapper_0 + + + _enabled + True + + + encoding + encoding + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (135, 123) + + + _rotation + 180 + + + + fft_vxx + + id + fft_vxx_0 + + + _enabled + True + + + type + complex + + + fft_size + 64 + + + forward + False + + + window + tuple([1/52**.5] * 64) + + + shift + True + + + nthreads + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (973, 396) + + + _rotation + 180 + + + + blocks_tagged_stream_mux + + id + blocks_tagged_stream_mux_0 + + + _enabled + True + + + type + complex + + + ninputs + 2 + + + lengthtagname + "packet_len" + + + vlen + 1 + + + tag_preserve_head_pos + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (743, 269) + + + _rotation + 0 + + + + ieee802_11_chunks_to_symbols_xx + + id + ieee802_11_chunks_to_symbols_xx_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (495, 301) + + + _rotation + 0 + + fft_vxx_0 digital_ofdm_cyclic_prefixer_0 0 0 - - blocks_complex_to_mag_0 - blocks_divide_xx_0 - 0 - 0 - - - blocks_conjugate_cc_0 - blocks_multiply_xx_0 - 0 - 1 - - - blocks_delay_0_0 - blocks_conjugate_cc_0 - 0 - 0 - - - pad_source_0 - blocks_delay_0_0 - 0 - 0 - - - pad_source_0 - blocks_complex_to_mag_squared_0 - 0 - 0 - - - pad_source_0 - blocks_multiply_xx_0 - 0 - 0 - - - blocks_stream_to_vector_0 - fft_vxx_0_1 - 0 - 0 - - - digital_ofdm_cyclic_prefixer_0 - blocks_multiply_const_vxx_0 - 0 - 0 - - - blocks_delay_0_0 - sync_short - 0 - 0 - - - sync_long - blocks_stream_to_vector_0 - 0 - 0 - - - ieee802_11_ofdm_decode_signal_0 - ieee802_11_ofdm_decode_mac_0 - 0 - 0 - - - ieee802_11_ofdm_equalize_symbols_0 - ieee802_11_ofdm_decode_signal_0 - 0 - 0 - - - fft_vxx_0_1 - ieee802_11_ofdm_equalize_symbols_0 - 0 - 0 - - - blocks_multiply_const_vxx_0 - ieee802_11_ofdm_preamble_0 - 0 - 0 - - - ieee802_11_ofdm_mapper_0 - ieee802_11_ofdm_pilot_0 - 0 - 0 - - - ieee802_11_ofdm_pilot_0 - fft_vxx_0 - 0 - 0 - ieee802_11_ofdm_preamble_0 pad_sink_0 0 0 + + pad_source_1 + ieee802_11_ofdm_mapper_0 + 0 + in + + + digital_chunks_to_symbols_xx_0 + blocks_tagged_stream_mux_0 + 0 + 0 + + + ieee802_11_ofdm_decode_mac_0 + pad_sink_1 + out + 0 + + + ieee802_11_moving_average_xx_0 + blocks_divide_xx_0 + 0 + 1 + + + blocks_complex_to_mag_squared_0 + ieee802_11_moving_average_xx_0 + 0 + 0 + + + ieee802_11_moving_average_xx_1 + blocks_complex_to_mag_0 + 0 + 0 + + + blocks_multiply_xx_0 + ieee802_11_moving_average_xx_1 + 0 + 0 + + + blocks_divide_xx_0 + sync_short + 0 + 1 + sync_short - blocks_delay_0 + sync_long 0 0 @@ -1337,50 +1457,122 @@ sync_short - sync_long + blocks_delay_0 0 0 - blocks_divide_xx_0 + fft_vxx_0_1 + ieee802_11_ofdm_equalize_symbols_0 + 0 + 0 + + + ieee802_11_ofdm_equalize_symbols_0 + ieee802_11_ofdm_decode_signal_0 + 0 + 0 + + + ieee802_11_ofdm_decode_signal_0 + ieee802_11_ofdm_decode_mac_0 + 0 + 0 + + + sync_long + blocks_stream_to_vector_0 + 0 + 0 + + + blocks_delay_0_0 sync_short 0 + 0 + + + blocks_stream_to_vector_0 + fft_vxx_0_1 + 0 + 0 + + + pad_source_0 + blocks_multiply_xx_0 + 0 + 0 + + + pad_source_0 + blocks_complex_to_mag_squared_0 + 0 + 0 + + + pad_source_0 + blocks_delay_0_0 + 0 + 0 + + + blocks_delay_0_0 + blocks_conjugate_cc_0 + 0 + 0 + + + blocks_conjugate_cc_0 + blocks_multiply_xx_0 + 0 1 - blocks_multiply_xx_0 - ieee802_11_moving_average_xx_1 - 0 - 0 - - - ieee802_11_moving_average_xx_1 - blocks_complex_to_mag_0 - 0 - 0 - - - blocks_complex_to_mag_squared_0 - ieee802_11_moving_average_xx_0 - 0 - 0 - - - ieee802_11_moving_average_xx_0 + blocks_complex_to_mag_0 blocks_divide_xx_0 0 + 0 + + + digital_ofdm_carrier_allocator_cvc_0 + fft_vxx_0 + 0 + 0 + + + blocks_tagged_stream_mux_0 + digital_ofdm_carrier_allocator_cvc_0 + 0 + 0 + + + digital_ofdm_cyclic_prefixer_0 + ieee802_11_ofdm_preamble_0 + 0 + 0 + + + ieee802_11_packet_headergenerator_0 + digital_chunks_to_symbols_xx_0 + 0 + 0 + + + ieee802_11_ofdm_mapper_0 + ieee802_11_packet_headergenerator_0 + 0 + 0 + + + ieee802_11_chunks_to_symbols_xx_0 + blocks_tagged_stream_mux_0 + 0 1 - pad_source_1 - ieee802_11_ofdm_mapper_0 + ieee802_11_ofdm_mapper_0 + ieee802_11_chunks_to_symbols_xx_0 0 - in - - - ieee802_11_ofdm_decode_mac_0 - pad_sink_1 - out 0 diff --git a/examples/ofdm_rx.grc b/examples/wifi_rx.grc similarity index 97% rename from examples/ofdm_rx.grc rename to examples/wifi_rx.grc index 9c94790..bfb105c 100644 --- a/examples/ofdm_rx.grc +++ b/examples/wifi_rx.grc @@ -1,11 +1,11 @@ - Thu Dec 5 14:06:08 2013 + Mon Dec 30 11:05:22 2013 options id - ofdm_rx + wifi_rx _enabled @@ -618,52 +618,6 @@ 0 - - blocks_ctrlport_monitor - - id - blocks_ctrlport_monitor_0 - - - _enabled - False - - - en - True - - - _coordinate - (828, 166) - - - _rotation - 0 - - - - blocks_ctrlport_monitor_performance - - id - blocks_ctrlport_monitor_performance_0 - - - _enabled - False - - - en - True - - - _coordinate - (972, 169) - - - _rotation - 0 - - blocks_delay diff --git a/examples/ofdm_transceiver.grc b/examples/wifi_transceiver.grc similarity index 96% rename from examples/ofdm_transceiver.grc rename to examples/wifi_transceiver.grc index bee6a69..5c5de1e 100644 --- a/examples/ofdm_transceiver.grc +++ b/examples/wifi_transceiver.grc @@ -1,51 +1,59 @@ - Fri Dec 6 17:59:08 2013 + Mon Dec 30 10:04:24 2013 - variable_chooser + options id - encoding + wifi_transceiver _enabled True - label - Encoding - - - value - 0 - - - choices - [0,1,2,3,4,5,6,7] - - - labels - ["BPSK 1/2", "BPSK 3/4", "QPSK 1/2", "QPSK 3/4", "16QAM 1/2", "16QAM 3/4", "64QAM 2/3", "64QAM 3/4"] - - - type - radio_buttons - - - style - wx.RA_HORIZONTAL - - - grid_pos + title - notebook + author + + + + description + + + + window_size + 1280, 1024 + + + generate_options + wx_gui + + + category + Custom + + + run_options + prompt + + + run + True + + + max_nouts + 0 + + + realtime_scheduling _coordinate - (1111, 6) + (12, 33) _rotation @@ -103,162 +111,6 @@ 0 - - blocks_ctrlport_monitor_performance - - id - blocks_ctrlport_monitor_performance_0 - - - _enabled - False - - - en - True - - - _coordinate - (611, 163) - - - _rotation - 0 - - - - blocks_ctrlport_monitor - - id - blocks_ctrlport_monitor_0 - - - _enabled - False - - - en - True - - - _coordinate - (807, 164) - - - _rotation - 0 - - - - variable_slider - - id - tx_gain - - - _enabled - True - - - label - - - - value - 15 - - - min - 0 - - - max - 100 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (1050, 134) - - - _rotation - 0 - - - - variable_slider - - id - rx_gain - - - _enabled - True - - - label - - - - value - 5 - - - min - 0 - - - max - 100 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (1162, 133) - - - _rotation - 0 - - variable_chooser @@ -435,68 +287,6 @@ 0 - - ieee802_11_ofdm_parse_mac - - id - ieee802_11_ofdm_parse_mac_0 - - - _enabled - True - - - log - False - - - debug - True - - - affinity - - - - _coordinate - (94, 308) - - - _rotation - 180 - - - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (339, 257) - - - _rotation - 0 - - foo_wireshark_connector @@ -579,139 +369,6 @@ 0 - - ofdm_phy_hier - - id - ofdm_phy_hier_1 - - - _enabled - True - - - encoding - encoding - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (324, 355) - - - _rotation - 180 - - - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - mult - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (104, 385) - - - _rotation - 180 - - - - variable_slider - - id - mult - - - _enabled - True - - - label - - - - value - 0.38 - - - min - 0 - - - max - 1 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (1140, 247) - - - _rotation - 0 - - uhd_usrp_sink @@ -1383,6 +1040,197 @@ 0 + + foo_packet_pad + + id + foo_packet_pad_0 + + + _enabled + True + + + debug + False + + + delay + True + + + delay_sec + 0.001 + + + pad_front + 0 + + + pad_tail + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (73, 479) + + + _rotation + 0 + + + + ieee802_11_ofdm_mac + + id + ieee802_11_ofdm_mac_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (339, 257) + + + _rotation + 0 + + + + ieee802_11_ofdm_parse_mac + + id + ieee802_11_ofdm_parse_mac_0 + + + _enabled + True + + + log + False + + + debug + True + + + affinity + + + + _coordinate + (90, 304) + + + _rotation + 180 + + + + blocks_multiply_const_vxx + + id + blocks_multiply_const_vxx_0 + + + _enabled + True + + + type + complex + + + const + mult + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (106, 388) + + + _rotation + 180 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (334, 360) + + + _rotation + 180 + + uhd_usrp_source @@ -2063,50 +1911,54 @@ - foo_packet_pad + variable_slider id - foo_packet_pad_0 + mult _enabled True - debug - False - - - delay - True - - - delay_sec - 0.001 - - - pad_front - 0 - - - pad_tail - 0 - - - affinity + label - minoutbuf + value + 0.38 + + + min 0 - maxoutbuf - 0 + max + 1 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + _coordinate - (73, 479) + (963, 247) _rotation @@ -2114,58 +1966,160 @@ - options + variable_slider id - ofdm_transceiver + tx_gain _enabled True - title + label - author - + value + 15 - description - - - - window_size - 1280, 1024 - - - generate_options - wx_gui - - - category - Custom - - - run_options - prompt - - - run - True - - - max_nouts + min 0 - realtime_scheduling + max + 100 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook _coordinate - (12, 33) + (642, 132) + + + _rotation + 0 + + + + variable_slider + + id + rx_gain + + + _enabled + True + + + label + + + + value + 5 + + + min + 0 + + + max + 100 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (759, 132) + + + _rotation + 0 + + + + variable_chooser + + id + encoding + + + _enabled + True + + + label + Encoding + + + value + 0 + + + choices + [0,1,2,3,4,5,6,7] + + + labels + ["BPSK 1/2", "BPSK 3/4", "QPSK 1/2", "QPSK 3/4", "16QAM 1/2", "16QAM 3/4", "64QAM 2/3", "64QAM 3/4"] + + + type + radio_buttons + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + _coordinate + (929, 123) _rotation @@ -2184,24 +2138,6 @@ 0 0 - - uhd_usrp_source_0 - ofdm_phy_hier_1 - 0 - 0 - - - ieee802_11_ofdm_mac_0 - ofdm_phy_hier_1 - phy out - mac_in - - - ofdm_phy_hier_1 - ieee802_11_ofdm_mac_0 - mac_out - phy in - ieee802_11_ether_encap_0 blocks_tuntap_pdu_0 @@ -2226,34 +2162,46 @@ to wifi app in - - ofdm_phy_hier_1 - ieee802_11_ofdm_parse_mac_0 - mac_out - in - ieee802_11_ofdm_mac_0 foo_wireshark_connector_0 phy out in - - ofdm_phy_hier_1 - foo_wireshark_connector_0 - mac_out - in - - - ofdm_phy_hier_1 - blocks_multiply_const_vxx_0 - 0 - 0 - blocks_multiply_const_vxx_0 foo_packet_pad_0 0 0 + + wifi_phy_hier_0 + blocks_multiply_const_vxx_0 + 0 + 0 + + + wifi_phy_hier_0 + ieee802_11_ofdm_parse_mac_0 + mac_out + in + + + wifi_phy_hier_0 + ieee802_11_ofdm_mac_0 + mac_out + phy in + + + ieee802_11_ofdm_mac_0 + wifi_phy_hier_0 + phy out + mac_in + + + uhd_usrp_source_0 + wifi_phy_hier_0 + 0 + 0 + diff --git a/examples/ofdm_tx.grc b/examples/wifi_tx.grc similarity index 95% rename from examples/ofdm_tx.grc rename to examples/wifi_tx.grc index 38251d4..8dffed8 100644 --- a/examples/ofdm_tx.grc +++ b/examples/wifi_tx.grc @@ -1,11 +1,11 @@ - Fri Dec 6 18:16:38 2013 + Mon Dec 30 10:03:51 2013 options id - ofdm_tx + wifi_tx _enabled @@ -115,68 +115,6 @@ 0 - - blocks_ctrlport_monitor_performance - - id - blocks_ctrlport_monitor_performance_0 - - - _enabled - False - - - en - True - - - _coordinate - (982, 299) - - - _rotation - 0 - - - - blocks_null_source - - id - blocks_null_source_0 - - - _enabled - True - - - type - complex - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (692, 334) - - - _rotation - 180 - - variable_chooser @@ -283,95 +221,6 @@ 0 - - blocks_ctrlport_monitor - - id - blocks_ctrlport_monitor_0 - - - _enabled - False - - - en - True - - - _coordinate - (980, 366) - - - _rotation - 0 - - - - ofdm_phy_hier - - id - ofdm_phy_hier_0 - - - _enabled - True - - - encoding - encoding - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (449, 300) - - - _rotation - 180 - - - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (465, 191) - - - _rotation - 0 - - variable_chooser @@ -474,49 +323,6 @@ 0 - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_1 - - - _enabled - True - - - type - complex - - - const - mult - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (162, 330) - - - _rotation - 180 - - uhd_usrp_sink @@ -1329,30 +1135,166 @@ 0 + + blocks_multiply_const_vxx + + id + blocks_multiply_const_vxx_1 + + + _enabled + True + + + type + complex + + + const + mult + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (162, 330) + + + _rotation + 180 + + + + blocks_null_source + + id + blocks_null_source_0 + + + _enabled + True + + + type + complex + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (692, 334) + + + _rotation + 180 + + + + ieee802_11_ofdm_mac + + id + ieee802_11_ofdm_mac_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (465, 191) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (445, 302) + + + _rotation + 180 + + blocks_multiply_const_vxx_1 foo_packet_pad_0 0 0 - - ofdm_phy_hier_0 - blocks_multiply_const_vxx_1 - 0 - 0 - foo_packet_pad_0 uhd_usrp_sink_0 0 0 - - blocks_null_source_0 - ofdm_phy_hier_0 - 0 - 0 - blocks_message_strobe_0 ieee802_11_ofdm_mac_0 @@ -1360,15 +1302,27 @@ app in - ofdm_phy_hier_0 + wifi_phy_hier_0 + blocks_multiply_const_vxx_1 + 0 + 0 + + + blocks_null_source_0 + wifi_phy_hier_0 + 0 + 0 + + + ieee802_11_ofdm_mac_0 + wifi_phy_hier_0 + phy out + mac_in + + + wifi_phy_hier_0 ieee802_11_ofdm_mac_0 mac_out phy in - - ieee802_11_ofdm_mac_0 - ofdm_phy_hier_0 - phy out - mac_in - From 3ca6a2ccfe85c53f19e4a94a80f408c886827301 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Thu, 16 Jan 2014 07:28:14 +0100 Subject: [PATCH 10/21] delete files from obsolete pilot block --- grc/ieee802_11_ofdm_pilot.xml | 40 ---------- include/ieee802-11/ofdm_pilot.h | 38 --------- lib/ofdm_pilot.cc | 136 -------------------------------- 3 files changed, 214 deletions(-) delete mode 100644 grc/ieee802_11_ofdm_pilot.xml delete mode 100644 include/ieee802-11/ofdm_pilot.h delete mode 100644 lib/ofdm_pilot.cc diff --git a/grc/ieee802_11_ofdm_pilot.xml b/grc/ieee802_11_ofdm_pilot.xml deleted file mode 100644 index a87c250..0000000 --- a/grc/ieee802_11_ofdm_pilot.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - OFDM Pilot - ieee802_11_ofdm_pilot - IEEE802.11 - import ieee802_11 - ieee802_11.ofdm_pilot($debug) - - - Debug - debug - False - bool - - - - - - - in - complex - 48 - 1 - - - - out - complex - 64 - 1 - - - diff --git a/include/ieee802-11/ofdm_pilot.h b/include/ieee802-11/ofdm_pilot.h deleted file mode 100644 index fb9f6c7..0000000 --- a/include/ieee802-11/ofdm_pilot.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013 Bastian Bloessl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef INCLUDED_IEEE802_11_PILOT_H -#define INCLUDED_IEEE802_11_PILOT_H - -#include -#include - -namespace gr { -namespace ieee802_11 { - -class IEEE802_11_API ofdm_pilot : virtual public sync_block -{ -public: - - typedef boost::shared_ptr sptr; - static sptr make(bool debug = false); - -}; - -} // namespace ieee802_11 -} // namespace gr - -#endif /* INCLUDED_IEEE802_11_PILOT_H */ diff --git a/lib/ofdm_pilot.cc b/lib/ofdm_pilot.cc deleted file mode 100644 index 99e47c0..0000000 --- a/lib/ofdm_pilot.cc +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2013 Bastian Bloessl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include - -#include "utils.h" -#include - -using namespace gr::ieee802_11; - - -class ofdm_pilot_impl : public ofdm_pilot { - -static const int TONES = 48; -static const int FFT_SIZE = 64; - -public: - -ofdm_pilot_impl(bool debug) : - sync_block ("ofdm_pilot", - gr::io_signature::make(1, 1, TONES * sizeof(gr_complex)), - gr::io_signature::make(1, 1, FFT_SIZE * sizeof(gr_complex))), - d_offset(0), - d_debug(debug) { - -} - -~ofdm_pilot_impl() { - -} - -int work (int noutput_items, gr_vector_const_void_star& input_items, - gr_vector_void_star& output_items) { - - const gr_complex *in = (const gr_complex*)input_items[0]; - gr_complex *out = (gr_complex*)output_items[0]; - - int i = 0; - int count = 0; - const uint64_t nread = nitems_read(0); - std::vector tags; - - while (count < noutput_items) { - - get_tags_in_range(tags, 0, nread + count, nread + count + 1, pmt::string_to_symbol("ofdm_start")); - - if(tags.size()) { - d_offset = 0; - dout << "OFDM PILOT: start of OFDM frame" << std::endl; - } - - // guard band - memset(out, 0, 6 * sizeof(gr_complex)); - - // subcarriers -26 to -22 - memcpy(out + 6, in, 5 * sizeof(gr_complex)); - - // pilot 1 - out[11] = POLARITY[d_offset]; - - // subcarriers -20 to -8 - memcpy(out + 12, in + 5, 13 * sizeof(gr_complex)); - - // pilot 2 - out[25] = POLARITY[d_offset]; - - // subcarriers -6 to -1 - memcpy(out + 26, in + 18, 6 * sizeof(gr_complex)); - - // DC - out[32] = 0; - - // subcarriers 1 to 6 - memcpy(out + 33, in + 24, 6 * sizeof(gr_complex)); - - // pilot 3 - out[39] = POLARITY[d_offset]; - - // pubcarriers 8 to 20 - memcpy(out + 40, in + 30, 13 * sizeof(gr_complex)); - - // pilot 4 - out[53] = -POLARITY[d_offset]; - - // subcarriers 22 to 26 - memcpy(out + 54, in + 43, 5 * sizeof(gr_complex)); - - // guard band - memset(out + 59, 0, 5 * sizeof(gr_complex)); - - - count++; - out += FFT_SIZE; - in += TONES; - d_offset = (d_offset + 1) % 127; - } - - dout << "OFDM PILOT: produced items: " << noutput_items << std::endl; - - return noutput_items; -} - -private: - bool d_debug; - int d_offset; - static const gr_complex POLARITY[127]; -}; - -const gr_complex ofdm_pilot_impl::POLARITY[127] = { - 1, 1, 1, 1,-1,-1,-1, 1,-1,-1,-1,-1, 1, 1,-1, 1, - -1,-1, 1, 1,-1, 1, 1,-1, 1, 1, 1, 1, 1, 1,-1, 1, - 1, 1,-1, 1, 1,-1,-1, 1, 1, 1,-1, 1,-1,-1,-1, 1, - -1, 1,-1,-1, 1,-1,-1, 1, 1, 1, 1, 1,-1,-1, 1, 1, - -1,-1, 1,-1, 1,-1, 1, 1,-1,-1,-1, 1, 1,-1,-1,-1, - -1, 1,-1,-1, 1,-1, 1, 1, 1, 1,-1, 1,-1, 1,-1, 1, - -1,-1,-1,-1,-1, 1,-1, 1, 1,-1, 1,-1, 1, 1, 1,-1, - -1, 1,-1,-1,-1, 1, 1, 1,-1,-1,-1,-1,-1,-1,-1 }; - -ofdm_pilot::sptr -ofdm_pilot::make(bool debug) { - return gnuradio::get_initial_sptr(new ofdm_pilot_impl(debug)); -} - From c1528152782fb50153c4f531f97aef0344b53dc3 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Thu, 16 Jan 2014 07:58:34 +0100 Subject: [PATCH 11/21] flow graphs: use upstream blocks again --- examples/wifi_loopback.grc | 80 +- examples/wifi_phy_hier.grc | 1446 ++++++++++++++++++------------------ 2 files changed, 765 insertions(+), 761 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index b1b3e3c..b44e065 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -1,6 +1,6 @@ - Tue Dec 31 11:44:27 2013 + Thu Jan 16 07:37:38 2014 options @@ -646,45 +646,6 @@ 0 - - blocks_message_strobe - - id - blocks_message_strobe_0 - - - _enabled - True - - - msg - pmt.intern("Hello World!") - - - period - 300 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (83, 136) - - - _rotation - 0 - - wifi_phy_hier @@ -865,6 +826,45 @@ 0 + + blocks_message_strobe + + id + blocks_message_strobe_0 + + + _enabled + True + + + msg + pmt.intern("Hello World!") + + + period + 300 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (83, 136) + + + _rotation + 0 + + foo_wireshark_connector_0 blocks_file_sink_0 diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index db4af1c..443c04f 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -1,6 +1,6 @@ - Tue Dec 31 11:49:08 2013 + Thu Jan 16 07:41:05 2014 options @@ -64,7 +64,7 @@ variable id - header_formatter + sync_length _enabled @@ -72,11 +72,11 @@ value - ieee802_11.wifi_signal_field() + 320 _coordinate - (518, 18) + (196, 14) _rotation @@ -110,7 +110,7 @@ variable id - sync_length + header_formatter _enabled @@ -118,11 +118,11 @@ value - 320 + ieee802_11.wifi_signal_field() _coordinate - (196, 14) + (518, 18) _rotation @@ -254,45 +254,6 @@ 0 - - ieee802_11_moving_average_xx - - id - ieee802_11_moving_average_xx_1 - - - _enabled - True - - - type - complex - - - length - window_size - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (768, 622) - - - _rotation - 0 - - blocks_divide_xx @@ -371,41 +332,6 @@ 0 - - blocks_complex_to_mag - - id - blocks_complex_to_mag_0 - - - _enabled - True - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (969, 626) - - - _rotation - 0 - - pad_source @@ -500,119 +426,6 @@ 180 - - ieee802_11_ofdm_equalize_symbols - - id - ieee802_11_ofdm_equalize_symbols_0 - - - _enabled - True - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (757, 936) - - - _rotation - 180 - - - - ieee802_11_ofdm_decode_mac - - id - ieee802_11_ofdm_decode_mac_0 - - - _enabled - True - - - log - True - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (276, 929) - - - _rotation - 180 - - - - pad_sink - - id - pad_sink_1 - - - _enabled - True - - - label - mac_out - - - type - message - - - vlen - 1 - - - num_streams - 1 - - - optional - False - - - _coordinate - (63, 936) - - - _rotation - 180 - - pad_source @@ -652,483 +465,6 @@ 180 - - digital_ofdm_carrier_allocator_cvc - - id - digital_ofdm_carrier_allocator_cvc_0 - - - _enabled - True - - - fft_len - 64 - - - occupied_carriers - (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),) - - - pilot_carriers - ((-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21), (-21, -7, 7, 21)) - - - pilot_symbols - ((1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1)) - - - sync_words - () - - - len_tag_key - "packet_len" - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (993, 246) - - - _rotation - 0 - - - - digital_ofdm_cyclic_prefixer - - id - digital_ofdm_cyclic_prefixer_0 - - - _enabled - True - - - input_size - 64 - - - cp_len - 16 - - - rolloff - 2 - - - tagname - "packet_len" - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (741, 410) - - - _rotation - 180 - - - - ieee802_11_ofdm_preamble - - id - ieee802_11_ofdm_preamble_0 - - - _enabled - True - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (498, 424) - - - _rotation - 180 - - - - pad_sink - - id - pad_sink_0 - - - _enabled - True - - - label - samp_out - - - type - complex - - - vlen - 1 - - - num_streams - 1 - - - optional - False - - - _coordinate - (280, 424) - - - _rotation - 180 - - - - digital_chunks_to_symbols_xx - - id - digital_chunks_to_symbols_xx_0 - - - _enabled - True - - - in_type - byte - - - out_type - complex - - - symbol_table - [-1, 1] - - - dimension - 1 - - - num_ports - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (494, 230) - - - _rotation - 0 - - - - ieee802_11_packet_headergenerator - - id - ieee802_11_packet_headergenerator_0 - - - _enabled - True - - - header_formatter - header_formatter.formatter() - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (181, 237) - - - _rotation - 0 - - - - ieee802_11_ofdm_sync_long - - id - sync_long - - - _enabled - True - - - log - False - - - debug - False - - - sync_length - sync_length - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (678, 805) - - - _rotation - 0 - - - - blocks_delay - - id - blocks_delay_0 - - - _enabled - True - - - type - complex - - - delay - sync_length - - - num_ports - 1 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (458, 835) - - - _rotation - 0 - - - - blocks_stream_to_vector - - id - blocks_stream_to_vector_0 - - - _enabled - True - - - type - complex - - - num_items - 64 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (1017, 819) - - - _rotation - 0 - - - - ieee802_11_ofdm_decode_signal - - id - ieee802_11_ofdm_decode_signal_0 - - - _enabled - True - - - log - False - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (522, 929) - - - _rotation - 180 - - - - blocks_multiply_xx - - id - blocks_multiply_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (607, 610) - - - _rotation - 0 - - blocks_conjugate_cc @@ -1208,18 +544,147 @@ - ieee802_11_ofdm_mapper + ieee802_11_ofdm_sync_long id - ieee802_11_ofdm_mapper_0 + sync_long _enabled True - encoding - encoding + log + False + + + debug + False + + + sync_length + sync_length + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (682, 808) + + + _rotation + 0 + + + + blocks_delay + + id + blocks_delay_0 + + + _enabled + True + + + type + complex + + + delay + sync_length + + + num_ports + 1 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (463, 841) + + + _rotation + 0 + + + + blocks_stream_to_vector + + id + blocks_stream_to_vector_0 + + + _enabled + True + + + type + complex + + + num_items + 64 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1022, 824) + + + _rotation + 0 + + + + ieee802_11_ofdm_equalize_symbols + + id + ieee802_11_ofdm_equalize_symbols_0 + + + _enabled + True debug @@ -1239,7 +704,7 @@ _coordinate - (135, 123) + (762, 940) _rotation @@ -1247,10 +712,158 @@ - fft_vxx + ieee802_11_ofdm_decode_signal id - fft_vxx_0 + ieee802_11_ofdm_decode_signal_0 + + + _enabled + True + + + log + False + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (525, 932) + + + _rotation + 180 + + + + ieee802_11_ofdm_decode_mac + + id + ieee802_11_ofdm_decode_mac_0 + + + _enabled + True + + + log + True + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (283, 932) + + + _rotation + 180 + + + + pad_sink + + id + pad_sink_1 + + + _enabled + True + + + label + mac_out + + + type + message + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (69, 940) + + + _rotation + 180 + + + + ieee802_11_chunks_to_symbols_xx + + id + ieee802_11_chunks_to_symbols_xx_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (499, 303) + + + _rotation + 0 + + + + blocks_multiply_xx + + id + blocks_multiply_xx_0 _enabled @@ -1261,23 +874,11 @@ complex - fft_size - 64 + num_inputs + 2 - forward - False - - - window - tuple([1/52**.5] * 64) - - - shift - True - - - nthreads + vlen 1 @@ -1294,7 +895,202 @@ _coordinate - (973, 396) + (609, 608) + + + _rotation + 0 + + + + ieee802_11_moving_average_xx + + id + ieee802_11_moving_average_xx_1 + + + _enabled + True + + + type + complex + + + length + window_size + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (764, 621) + + + _rotation + 0 + + + + blocks_complex_to_mag + + id + blocks_complex_to_mag_0 + + + _enabled + True + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (973, 625) + + + _rotation + 0 + + + + digital_ofdm_cyclic_prefixer + + id + digital_ofdm_cyclic_prefixer_0 + + + _enabled + True + + + input_size + 64 + + + cp_len + 16 + + + rolloff + 2 + + + tagname + "packet_len" + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (731, 412) + + + _rotation + 180 + + + + ieee802_11_ofdm_preamble + + id + ieee802_11_ofdm_preamble_0 + + + _enabled + True + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (510, 428) + + + _rotation + 180 + + + + pad_sink + + id + pad_sink_0 + + + _enabled + True + + + label + samp_out + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (305, 428) _rotation @@ -1353,15 +1149,39 @@ - ieee802_11_chunks_to_symbols_xx + fft_vxx id - ieee802_11_chunks_to_symbols_xx_0 + fft_vxx_0 _enabled True + + type + complex + + + fft_size + 64 + + + forward + False + + + window + tuple([1/52**.5] * 64) + + + shift + True + + + nthreads + 1 + affinity @@ -1376,7 +1196,191 @@ _coordinate - (495, 301) + (973, 396) + + + _rotation + 180 + + + + ieee802_11_ofdm_mapper + + id + ieee802_11_ofdm_mapper_0 + + + _enabled + True + + + encoding + encoding + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (135, 123) + + + _rotation + 180 + + + + digital_chunks_to_symbols_xx + + id + digital_chunks_to_symbols_xx_0 + + + _enabled + True + + + in_type + byte + + + out_type + complex + + + symbol_table + [-1, 1] + + + dimension + 1 + + + num_ports + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (494, 230) + + + _rotation + 0 + + + + digital_ofdm_carrier_allocator_cvc + + id + digital_ofdm_carrier_allocator_cvc_0_0 + + + _enabled + True + + + fft_len + 64 + + + occupied_carriers + (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),) + + + pilot_carriers + ((-21, -7, 7, 21), ) + + + pilot_symbols + ((1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1)) + + + sync_words + () + + + len_tag_key + "packet_len" + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1021, 242) + + + _rotation + 0 + + + + digital_packet_headergenerator_bb + + id + digital_packet_headergenerator_bb_0 + + + _enabled + True + + + header_formatter + header_formatter.formatter() + + + len_tag_key + "packet_len" + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (222, 230) _rotation @@ -1533,36 +1537,12 @@ 0 0 - - digital_ofdm_carrier_allocator_cvc_0 - fft_vxx_0 - 0 - 0 - - - blocks_tagged_stream_mux_0 - digital_ofdm_carrier_allocator_cvc_0 - 0 - 0 - digital_ofdm_cyclic_prefixer_0 ieee802_11_ofdm_preamble_0 0 0 - - ieee802_11_packet_headergenerator_0 - digital_chunks_to_symbols_xx_0 - 0 - 0 - - - ieee802_11_ofdm_mapper_0 - ieee802_11_packet_headergenerator_0 - 0 - 0 - ieee802_11_chunks_to_symbols_xx_0 blocks_tagged_stream_mux_0 @@ -1575,4 +1555,28 @@ 0 0 + + blocks_tagged_stream_mux_0 + digital_ofdm_carrier_allocator_cvc_0_0 + 0 + 0 + + + digital_ofdm_carrier_allocator_cvc_0_0 + fft_vxx_0 + 0 + 0 + + + ieee802_11_ofdm_mapper_0 + digital_packet_headergenerator_bb_0 + 0 + 0 + + + digital_packet_headergenerator_bb_0 + digital_chunks_to_symbols_xx_0 + 0 + 0 + From 187ef602a080b89257c6d3a364ad86278c1d7ea0 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Thu, 16 Jan 2014 08:07:18 +0100 Subject: [PATCH 12/21] use upstream packet header generator again --- grc/ieee802_11_packet_headergenerator.xml | 20 ------ include/ieee802-11/CMakeLists.txt | 1 - include/ieee802-11/packet_headergenerator.h | 61 ----------------- lib/CMakeLists.txt | 1 - lib/packet_headergenerator_impl.cc | 75 --------------------- lib/packet_headergenerator_impl.h | 50 -------------- swig/ieee802_11_swig.i | 4 -- 7 files changed, 212 deletions(-) delete mode 100644 grc/ieee802_11_packet_headergenerator.xml delete mode 100644 include/ieee802-11/packet_headergenerator.h delete mode 100644 lib/packet_headergenerator_impl.cc delete mode 100644 lib/packet_headergenerator_impl.h diff --git a/grc/ieee802_11_packet_headergenerator.xml b/grc/ieee802_11_packet_headergenerator.xml deleted file mode 100644 index 87e34ab..0000000 --- a/grc/ieee802_11_packet_headergenerator.xml +++ /dev/null @@ -1,20 +0,0 @@ - - Packet Header Generator - ieee802_11_packet_headergenerator - IEEE802.11 - import ieee802_11 - ieee802_11.packet_headergenerator($header_formatter) - - Formatter Object - header_formatter - raw - - - in - byte - - - out - byte - - diff --git a/include/ieee802-11/CMakeLists.txt b/include/ieee802-11/CMakeLists.txt index e92cf8c..f4492dd 100644 --- a/include/ieee802-11/CMakeLists.txt +++ b/include/ieee802-11/CMakeLists.txt @@ -81,7 +81,6 @@ list(APPEND include_sources ofdm_preamble.h ofdm_sync_long.h ofdm_sync_short.h - packet_headergenerator.h wifi_signal_field.h ) diff --git a/include/ieee802-11/packet_headergenerator.h b/include/ieee802-11/packet_headergenerator.h deleted file mode 100644 index f7397c9..0000000 --- a/include/ieee802-11/packet_headergenerator.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- c++ -*- */ -/* Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_H -#define INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_H - -#include -#include -#include - -namespace gr { -namespace ieee802_11 { - -class IEEE802_11_API packet_headergenerator : virtual public tagged_stream_block -{ -public: - typedef boost::shared_ptr sptr; - - /* \param header_formatter A header formatter object. - * \param len_tag_key Length tag key. Note that for header generation, - * it is irrelevant which tag names are set in the - * formatter object, only this value is relevant! - */ - static sptr make( - const digital::packet_header_default::sptr &header_formatter, - const std::string &len_tag_key="packet_len" - ); - - /* \param header_len If this value is given, a packet_header_default - * object is used to generate the header. This is - * the number of bits per header. - * \param len_tag_key Length tag key. - */ - static sptr make( - long header_len, - const std::string &len_tag_key = "packet_len"); - }; - -} // namespace ieee802_11 -} // namespace gr - -#endif /* INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_H */ - diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 418d420..3e7f61f 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -113,7 +113,6 @@ list(APPEND gr_ieee802_11_sources ofdm_preamble.cc ofdm_sync_long.cc ofdm_sync_short.cc - packet_headergenerator_impl.cc utils.cc wifi_signal_field_impl.cc ) diff --git a/lib/packet_headergenerator_impl.cc b/lib/packet_headergenerator_impl.cc deleted file mode 100644 index fe8ce28..0000000 --- a/lib/packet_headergenerator_impl.cc +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2013 Bastian Bloessl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include -#include -#include "packet_headergenerator_impl.h" - -using namespace gr::ieee802_11; - -packet_headergenerator::sptr packet_headergenerator::make( - const digital::packet_header_default::sptr &header_formatter, - const std::string &len_tag_key) { - return gnuradio::get_initial_sptr (new packet_headergenerator_impl(header_formatter, len_tag_key)); -} - - -packet_headergenerator::sptr packet_headergenerator::make( - long header_len, - const std::string &len_tag_key) { - const digital::packet_header_default::sptr header_formatter( - new digital::packet_header_default(header_len, len_tag_key)); - return gnuradio::get_initial_sptr (new packet_headergenerator_impl(header_formatter, len_tag_key)); -} - - - packet_headergenerator_impl::packet_headergenerator_impl( - const gr::digital::packet_header_default::sptr &header_formatter, - const std::string &len_tag_key - ) - : tagged_stream_block("packet_headergenerator_impl", - io_signature::make(1, 1, sizeof (char)), - io_signature::make(1, 1, sizeof (char)), - len_tag_key), - d_formatter(header_formatter) - { - set_output_multiple(d_formatter->header_len()); - // This is the worst case rate, because we don't know the true value, of course - set_relative_rate(d_formatter->header_len()); - set_tag_propagation_policy(TPP_DONT); - } - - packet_headergenerator_impl::~packet_headergenerator_impl() - { - } - - int - packet_headergenerator_impl::work (int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - unsigned char *out = (unsigned char *) output_items[0]; - std::vector all_tags; - get_tags_in_range(all_tags, 0, nitems_read(0), nitems_read(0) + ninput_items[0]); - if (!d_formatter->header_formatter(ninput_items[0], out, all_tags)) { - GR_LOG_FATAL(d_logger, boost::format("header_formatter() returned false (this shouldn't happen). Offending header started at %1%") % nitems_read(0)); - throw std::runtime_error("header formatter returned false."); - } - - return d_formatter->header_len(); - } - diff --git a/lib/packet_headergenerator_impl.h b/lib/packet_headergenerator_impl.h deleted file mode 100644 index f50a2f2..0000000 --- a/lib/packet_headergenerator_impl.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2013 Bastian Bloessl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#ifndef INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_IMPL_H -#define INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_IMPL_H - -#include - -namespace gr { -namespace ieee802_11 { - -class packet_headergenerator_impl : public packet_headergenerator -{ -private: - gr::digital::packet_header_default::sptr d_formatter; - -public: - packet_headergenerator_impl( - const digital::packet_header_default::sptr &header_formatter, - const std::string &len_tag_key - ); - ~packet_headergenerator_impl(); - - void remove_length_tags(const std::vector > &tags) {}; - int calculate_output_stream_length(const gr_vector_int &ninput_items) { return d_formatter->header_len(); }; - - int work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - -} // namespace ieee802_11 -} // namespace gr - -#endif /* INCLUDED_IEEE802_11_PACKET_HEADERGENERATOR_IMPL_H */ - diff --git a/swig/ieee802_11_swig.i b/swig/ieee802_11_swig.i index 161a337..4fb6f7e 100644 --- a/swig/ieee802_11_swig.i +++ b/swig/ieee802_11_swig.i @@ -18,7 +18,6 @@ #define DIGITAL_API %include "gnuradio.i" -//%include "digital_swig.i" %include "ieee802_11_swig_doc.i" @@ -39,7 +38,6 @@ #include "ieee802-11/ofdm_preamble.h" #include "ieee802-11/ofdm_sync_long.h" #include "ieee802-11/ofdm_sync_short.h" -#include "ieee802-11/packet_headergenerator.h" #include "ieee802-11/wifi_signal_field.h" %} @@ -59,7 +57,6 @@ %include "ieee802-11/ofdm_preamble.h" %include "ieee802-11/ofdm_sync_long.h" %include "ieee802-11/ofdm_sync_short.h" -%include "ieee802-11/packet_headergenerator.h" %include "ieee802-11/wifi_signal_field.h" GR_SWIG_BLOCK_MAGIC2(ieee802_11, chunks_to_symbols); @@ -76,7 +73,6 @@ GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_parse_mac); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_preamble); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_sync_long); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_sync_short); -GR_SWIG_BLOCK_MAGIC2(ieee802_11, packet_headergenerator); %template(wifi_signal_field_sptr) boost::shared_ptr; %pythoncode %{ From 92693de2007e38eb7bb410ff6fa87c526f8be234 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Mon, 20 Jan 2014 14:21:33 +0100 Subject: [PATCH 13/21] start script: change flow graph name --- apps/nic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nic.sh b/apps/nic.sh index cc02948..ec6b614 100755 --- a/apps/nic.sh +++ b/apps/nic.sh @@ -1,7 +1,7 @@ #!/bin/bash FILE="/tmp/ofdm.pcap" -FLOWGRAPH="ofdm_transceiver.py" +FLOWGRAPH="wifi_transceiver.py" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ### create fifo From 02ab43fe167935c32f3b0d59ec905e61c82635c7 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Mon, 20 Jan 2014 14:22:15 +0100 Subject: [PATCH 14/21] flow graphs: change min output item --- examples/wifi_loopback.grc | 90 +- examples/wifi_phy_hier.grc | 492 ++++---- examples/wifi_transceiver.grc | 2164 +++++++++++++++++---------------- examples/wifi_tx.grc | 563 +++++---- 4 files changed, 1679 insertions(+), 1630 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index b44e065..5e60db3 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -1,6 +1,6 @@ - Thu Jan 16 07:37:38 2014 + Mon Jan 20 12:59:27 2014 options @@ -329,49 +329,6 @@ 0 - - blocks_add_xx - - id - blocks_add_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (583, 278) - - - _rotation - 180 - - blocks_multiply_xx @@ -858,13 +815,56 @@ _coordinate - (83, 136) + (92, 135) _rotation 0 + + blocks_add_xx + + id + blocks_add_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (581, 279) + + + _rotation + 180 + + foo_wireshark_connector_0 blocks_file_sink_0 diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index 443c04f..e944652 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -1,6 +1,6 @@ - Thu Jan 16 07:41:05 2014 + Mon Jan 20 14:02:22 2014 options @@ -60,6 +60,29 @@ 0 + + variable + + id + header_formatter + + + _enabled + True + + + value + ieee802_11.wifi_signal_field() + + + _coordinate + (518, 18) + + + _rotation + 0 + + variable @@ -106,29 +129,6 @@ 0 - - variable - - id - header_formatter - - - _enabled - True - - - value - ieee802_11.wifi_signal_field() - - - _coordinate - (518, 18) - - - _rotation - 0 - - parameter @@ -828,37 +828,6 @@ 180 - - ieee802_11_chunks_to_symbols_xx - - id - ieee802_11_chunks_to_symbols_xx_0 - - - _enabled - True - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (499, 303) - - - _rotation - 0 - - blocks_multiply_xx @@ -976,88 +945,6 @@ 0 - - digital_ofdm_cyclic_prefixer - - id - digital_ofdm_cyclic_prefixer_0 - - - _enabled - True - - - input_size - 64 - - - cp_len - 16 - - - rolloff - 2 - - - tagname - "packet_len" - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (731, 412) - - - _rotation - 180 - - - - ieee802_11_ofdm_preamble - - id - ieee802_11_ofdm_preamble_0 - - - _enabled - True - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (510, 428) - - - _rotation - 180 - - pad_sink @@ -1098,33 +985,111 @@ - blocks_tagged_stream_mux + ieee802_11_ofdm_mapper id - blocks_tagged_stream_mux_0 + ieee802_11_ofdm_mapper_0 _enabled True - type - complex + encoding + encoding - ninputs - 2 + debug + False - lengthtagname + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (135, 123) + + + _rotation + 180 + + + + digital_packet_headergenerator_bb + + id + digital_packet_headergenerator_bb_0 + + + _enabled + True + + + header_formatter + header_formatter.formatter() + + + len_tag_key "packet_len" - vlen + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (222, 230) + + + _rotation + 0 + + + + digital_chunks_to_symbols_xx + + id + digital_chunks_to_symbols_xx_0 + + + _enabled + True + + + in_type + byte + + + out_type + complex + + + symbol_table + [-1, 1] + + + dimension 1 - tag_preserve_head_pos + num_ports 1 @@ -1141,7 +1106,38 @@ _coordinate - (743, 269) + (494, 230) + + + _rotation + 0 + + + + ieee802_11_chunks_to_symbols_xx + + id + ieee802_11_chunks_to_symbols_xx_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 48000 + + + maxoutbuf + 0 + + + _coordinate + (499, 303) _rotation @@ -1203,96 +1199,6 @@ 180 - - ieee802_11_ofdm_mapper - - id - ieee802_11_ofdm_mapper_0 - - - _enabled - True - - - encoding - encoding - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (135, 123) - - - _rotation - 180 - - - - digital_chunks_to_symbols_xx - - id - digital_chunks_to_symbols_xx_0 - - - _enabled - True - - - in_type - byte - - - out_type - complex - - - symbol_table - [-1, 1] - - - dimension - 1 - - - num_ports - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (494, 230) - - - _rotation - 0 - - digital_ofdm_carrier_allocator_cvc @@ -1333,7 +1239,7 @@ minoutbuf - 0 + 1000 maxoutbuf @@ -1341,7 +1247,7 @@ _coordinate - (1021, 242) + (1023, 242) _rotation @@ -1349,21 +1255,64 @@ - digital_packet_headergenerator_bb + ieee802_11_ofdm_preamble id - digital_packet_headergenerator_bb_0 + ieee802_11_ofdm_preamble_0 _enabled True - header_formatter - header_formatter.formatter() + debug + False - len_tag_key + affinity + + + + minoutbuf + 48000 + + + maxoutbuf + 0 + + + _coordinate + (510, 428) + + + _rotation + 180 + + + + digital_ofdm_cyclic_prefixer + + id + digital_ofdm_cyclic_prefixer_0 + + + _enabled + True + + + input_size + 64 + + + cp_len + 16 + + + rolloff + 2 + + + tagname "packet_len" @@ -1372,7 +1321,7 @@ minoutbuf - 0 + 48000 maxoutbuf @@ -1380,7 +1329,58 @@ _coordinate - (222, 230) + (731, 412) + + + _rotation + 180 + + + + blocks_tagged_stream_mux + + id + blocks_tagged_stream_mux_0 + + + _enabled + True + + + type + complex + + + ninputs + 2 + + + lengthtagname + "packet_len" + + + vlen + 1 + + + tag_preserve_head_pos + 1 + + + affinity + + + + minoutbuf + 48000 + + + maxoutbuf + 0 + + + _coordinate + (743, 269) _rotation diff --git a/examples/wifi_transceiver.grc b/examples/wifi_transceiver.grc index 5c5de1e..dd13b60 100644 --- a/examples/wifi_transceiver.grc +++ b/examples/wifi_transceiver.grc @@ -1,6 +1,6 @@ - Mon Dec 30 10:04:24 2013 + Mon Jan 20 14:04:11 2014 options @@ -287,45 +287,6 @@ 0 - - foo_wireshark_connector - - id - foo_wireshark_connector_0 - - - _enabled - True - - - tech - 127 - - - debug - False - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (580, 308) - - - _rotation - 0 - - blocks_file_sink @@ -369,6 +330,1080 @@ 0 + + ieee802_11_ofdm_mac + + id + ieee802_11_ofdm_mac_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (339, 257) + + + _rotation + 0 + + + + variable_slider + + id + mult + + + _enabled + True + + + label + + + + value + 0.38 + + + min + 0 + + + max + 1 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (963, 247) + + + _rotation + 0 + + + + variable_slider + + id + tx_gain + + + _enabled + True + + + label + + + + value + 15 + + + min + 0 + + + max + 100 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (642, 132) + + + _rotation + 0 + + + + variable_slider + + id + rx_gain + + + _enabled + True + + + label + + + + value + 5 + + + min + 0 + + + max + 100 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (759, 132) + + + _rotation + 0 + + + + variable_chooser + + id + encoding + + + _enabled + True + + + label + Encoding + + + value + 0 + + + choices + [0,1,2,3,4,5,6,7] + + + labels + ["BPSK 1/2", "BPSK 3/4", "QPSK 1/2", "QPSK 3/4", "16QAM 1/2", "16QAM 3/4", "64QAM 2/3", "64QAM 3/4"] + + + type + radio_buttons + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + _coordinate + (929, 123) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (334, 360) + + + _rotation + 180 + + + + foo_wireshark_connector + + id + foo_wireshark_connector_0 + + + _enabled + True + + + tech + 127 + + + debug + False + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (580, 308) + + + _rotation + 0 + + + + uhd_usrp_source + + id + uhd_usrp_source_0 + + + _enabled + True + + + type + fc32 + + + otw + + + + stream_args + + + + stream_chans + [] + + + dev_addr + + + + sync + pc_clock + + + clock_rate + 0.0 + + + num_mboards + 1 + + + clock_source0 + + + + time_source0 + + + + sd_spec0 + + + + clock_source1 + + + + time_source1 + + + + sd_spec1 + + + + clock_source2 + + + + time_source2 + + + + sd_spec2 + + + + clock_source3 + + + + time_source3 + + + + sd_spec3 + + + + clock_source4 + + + + time_source4 + + + + sd_spec4 + + + + clock_source5 + + + + time_source5 + + + + sd_spec5 + + + + clock_source6 + + + + time_source6 + + + + sd_spec6 + + + + clock_source7 + + + + time_source7 + + + + sd_spec7 + + + + nchan + 1 + + + samp_rate + samp_rate + + + center_freq0 + uhd.tune_request(freq - lo_offset, lo_offset) + + + gain0 + rx_gain + + + ant0 + + + + bw0 + 0 + + + center_freq1 + 0 + + + gain1 + 0 + + + ant1 + + + + bw1 + 0 + + + center_freq2 + 0 + + + gain2 + 0 + + + ant2 + + + + bw2 + 0 + + + center_freq3 + 0 + + + gain3 + 0 + + + ant3 + + + + bw3 + 0 + + + center_freq4 + 0 + + + gain4 + 0 + + + ant4 + + + + bw4 + 0 + + + center_freq5 + 0 + + + gain5 + 0 + + + ant5 + + + + bw5 + 0 + + + center_freq6 + 0 + + + gain6 + 0 + + + ant6 + + + + bw6 + 0 + + + center_freq7 + 0 + + + gain7 + 0 + + + ant7 + + + + bw7 + 0 + + + center_freq8 + 0 + + + gain8 + 0 + + + ant8 + + + + bw8 + 0 + + + center_freq9 + 0 + + + gain9 + 0 + + + ant9 + + + + bw9 + 0 + + + center_freq10 + 0 + + + gain10 + 0 + + + ant10 + + + + bw10 + 0 + + + center_freq11 + 0 + + + gain11 + 0 + + + ant11 + + + + bw11 + 0 + + + center_freq12 + 0 + + + gain12 + 0 + + + ant12 + + + + bw12 + 0 + + + center_freq13 + 0 + + + gain13 + 0 + + + ant13 + + + + bw13 + 0 + + + center_freq14 + 0 + + + gain14 + 0 + + + ant14 + + + + bw14 + 0 + + + center_freq15 + 0 + + + gain15 + 0 + + + ant15 + + + + bw15 + 0 + + + center_freq16 + 0 + + + gain16 + 0 + + + ant16 + + + + bw16 + 0 + + + center_freq17 + 0 + + + gain17 + 0 + + + ant17 + + + + bw17 + 0 + + + center_freq18 + 0 + + + gain18 + 0 + + + ant18 + + + + bw18 + 0 + + + center_freq19 + 0 + + + gain19 + 0 + + + ant19 + + + + bw19 + 0 + + + center_freq20 + 0 + + + gain20 + 0 + + + ant20 + + + + bw20 + 0 + + + center_freq21 + 0 + + + gain21 + 0 + + + ant21 + + + + bw21 + 0 + + + center_freq22 + 0 + + + gain22 + 0 + + + ant22 + + + + bw22 + 0 + + + center_freq23 + 0 + + + gain23 + 0 + + + ant23 + + + + bw23 + 0 + + + center_freq24 + 0 + + + gain24 + 0 + + + ant24 + + + + bw24 + 0 + + + center_freq25 + 0 + + + gain25 + 0 + + + ant25 + + + + bw25 + 0 + + + center_freq26 + 0 + + + gain26 + 0 + + + ant26 + + + + bw26 + 0 + + + center_freq27 + 0 + + + gain27 + 0 + + + ant27 + + + + bw27 + 0 + + + center_freq28 + 0 + + + gain28 + 0 + + + ant28 + + + + bw28 + 0 + + + center_freq29 + 0 + + + gain29 + 0 + + + ant29 + + + + bw29 + 0 + + + center_freq30 + 0 + + + gain30 + 0 + + + ant30 + + + + bw30 + 0 + + + center_freq31 + 0 + + + gain31 + 0 + + + ant31 + + + + bw31 + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (460, 483) + + + _rotation + 0 + + + + ieee802_11_ofdm_parse_mac + + id + ieee802_11_ofdm_parse_mac_0 + + + _enabled + True + + + log + False + + + debug + True + + + affinity + + + + _coordinate + (93, 296) + + + _rotation + 180 + + + + blocks_multiply_const_vxx + + id + blocks_multiply_const_vxx_0 + + + _enabled + True + + + type + complex + + + const + mult + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (108, 390) + + + _rotation + 180 + + uhd_usrp_sink @@ -1056,19 +2091,19 @@ delay - True + False delay_sec - 0.001 + 0.0005 pad_front - 0 + 10000 pad_tail - 0 + 10000 affinity @@ -1091,1041 +2126,6 @@ 0 - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (339, 257) - - - _rotation - 0 - - - - ieee802_11_ofdm_parse_mac - - id - ieee802_11_ofdm_parse_mac_0 - - - _enabled - True - - - log - False - - - debug - True - - - affinity - - - - _coordinate - (90, 304) - - - _rotation - 180 - - - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - mult - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (106, 388) - - - _rotation - 180 - - - - wifi_phy_hier - - id - wifi_phy_hier_0 - - - _enabled - True - - - encoding - 0 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (334, 360) - - - _rotation - 180 - - - - uhd_usrp_source - - id - uhd_usrp_source_0 - - - _enabled - True - - - type - fc32 - - - otw - - - - stream_args - - - - stream_chans - [] - - - dev_addr - - - - sync - pc_clock - - - clock_rate - 0.0 - - - num_mboards - 1 - - - clock_source0 - - - - time_source0 - - - - sd_spec0 - - - - clock_source1 - - - - time_source1 - - - - sd_spec1 - - - - clock_source2 - - - - time_source2 - - - - sd_spec2 - - - - clock_source3 - - - - time_source3 - - - - sd_spec3 - - - - clock_source4 - - - - time_source4 - - - - sd_spec4 - - - - clock_source5 - - - - time_source5 - - - - sd_spec5 - - - - clock_source6 - - - - time_source6 - - - - sd_spec6 - - - - clock_source7 - - - - time_source7 - - - - sd_spec7 - - - - nchan - 1 - - - samp_rate - samp_rate - - - center_freq0 - uhd.tune_request(freq - lo_offset, lo_offset) - - - gain0 - rx_gain - - - ant0 - - - - bw0 - 0 - - - center_freq1 - 0 - - - gain1 - 0 - - - ant1 - - - - bw1 - 0 - - - center_freq2 - 0 - - - gain2 - 0 - - - ant2 - - - - bw2 - 0 - - - center_freq3 - 0 - - - gain3 - 0 - - - ant3 - - - - bw3 - 0 - - - center_freq4 - 0 - - - gain4 - 0 - - - ant4 - - - - bw4 - 0 - - - center_freq5 - 0 - - - gain5 - 0 - - - ant5 - - - - bw5 - 0 - - - center_freq6 - 0 - - - gain6 - 0 - - - ant6 - - - - bw6 - 0 - - - center_freq7 - 0 - - - gain7 - 0 - - - ant7 - - - - bw7 - 0 - - - center_freq8 - 0 - - - gain8 - 0 - - - ant8 - - - - bw8 - 0 - - - center_freq9 - 0 - - - gain9 - 0 - - - ant9 - - - - bw9 - 0 - - - center_freq10 - 0 - - - gain10 - 0 - - - ant10 - - - - bw10 - 0 - - - center_freq11 - 0 - - - gain11 - 0 - - - ant11 - - - - bw11 - 0 - - - center_freq12 - 0 - - - gain12 - 0 - - - ant12 - - - - bw12 - 0 - - - center_freq13 - 0 - - - gain13 - 0 - - - ant13 - - - - bw13 - 0 - - - center_freq14 - 0 - - - gain14 - 0 - - - ant14 - - - - bw14 - 0 - - - center_freq15 - 0 - - - gain15 - 0 - - - ant15 - - - - bw15 - 0 - - - center_freq16 - 0 - - - gain16 - 0 - - - ant16 - - - - bw16 - 0 - - - center_freq17 - 0 - - - gain17 - 0 - - - ant17 - - - - bw17 - 0 - - - center_freq18 - 0 - - - gain18 - 0 - - - ant18 - - - - bw18 - 0 - - - center_freq19 - 0 - - - gain19 - 0 - - - ant19 - - - - bw19 - 0 - - - center_freq20 - 0 - - - gain20 - 0 - - - ant20 - - - - bw20 - 0 - - - center_freq21 - 0 - - - gain21 - 0 - - - ant21 - - - - bw21 - 0 - - - center_freq22 - 0 - - - gain22 - 0 - - - ant22 - - - - bw22 - 0 - - - center_freq23 - 0 - - - gain23 - 0 - - - ant23 - - - - bw23 - 0 - - - center_freq24 - 0 - - - gain24 - 0 - - - ant24 - - - - bw24 - 0 - - - center_freq25 - 0 - - - gain25 - 0 - - - ant25 - - - - bw25 - 0 - - - center_freq26 - 0 - - - gain26 - 0 - - - ant26 - - - - bw26 - 0 - - - center_freq27 - 0 - - - gain27 - 0 - - - ant27 - - - - bw27 - 0 - - - center_freq28 - 0 - - - gain28 - 0 - - - ant28 - - - - bw28 - 0 - - - center_freq29 - 0 - - - gain29 - 0 - - - ant29 - - - - bw29 - 0 - - - center_freq30 - 0 - - - gain30 - 0 - - - ant30 - - - - bw30 - 0 - - - center_freq31 - 0 - - - gain31 - 0 - - - ant31 - - - - bw31 - 0 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (460, 483) - - - _rotation - 0 - - - - variable_slider - - id - mult - - - _enabled - True - - - label - - - - value - 0.38 - - - min - 0 - - - max - 1 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (963, 247) - - - _rotation - 0 - - - - variable_slider - - id - tx_gain - - - _enabled - True - - - label - - - - value - 15 - - - min - 0 - - - max - 100 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (642, 132) - - - _rotation - 0 - - - - variable_slider - - id - rx_gain - - - _enabled - True - - - label - - - - value - 5 - - - min - 0 - - - max - 100 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (759, 132) - - - _rotation - 0 - - - - variable_chooser - - id - encoding - - - _enabled - True - - - label - Encoding - - - value - 0 - - - choices - [0,1,2,3,4,5,6,7] - - - labels - ["BPSK 1/2", "BPSK 3/4", "QPSK 1/2", "QPSK 3/4", "16QAM 1/2", "16QAM 3/4", "64QAM 2/3", "64QAM 3/4"] - - - type - radio_buttons - - - style - wx.RA_HORIZONTAL - - - grid_pos - - - - notebook - - - - _coordinate - (929, 123) - - - _rotation - 0 - - foo_wireshark_connector_0 blocks_file_sink_0 @@ -2204,4 +2204,10 @@ 0 0 + + wifi_phy_hier_0 + foo_wireshark_connector_0 + mac_out + in + diff --git a/examples/wifi_tx.grc b/examples/wifi_tx.grc index 8dffed8..43c828e 100644 --- a/examples/wifi_tx.grc +++ b/examples/wifi_tx.grc @@ -1,6 +1,6 @@ - Mon Dec 30 10:03:51 2013 + Mon Jan 20 13:49:51 2014 options @@ -166,61 +166,6 @@ 0 - - variable_slider - - id - mult - - - _enabled - True - - - label - - - - value - 0.35 - - - min - 0 - - - max - 2 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (979, 10) - - - _rotation - 0 - - variable_chooser @@ -323,6 +268,127 @@ 0 + + variable_chooser + + id + freq + + + _enabled + True + + + label + Channel + + + value + 5.22e9 + + + choices + [2412000000.0, 2417000000.0, 2422000000.0, 2427000000.0, 2432000000.0, 2437000000.0, 2442000000.0, 2447000000.0, 2452000000.0, 2457000000.0, 2462000000.0, 2467000000.0, 2472000000.0, 2484000000.0, 5170000000.0, 5180000000.0, 5190000000.0, 5200000000.0, 5210000000.0, 5220000000.0, 5230000000.0, 5240000000.0, 5260000000.0, 5280000000.0, 5300000000.0, 5320000000.0, 5500000000.0, 5520000000.0, 5540000000.0, 5560000000.0, 5580000000.0, 5600000000.0, 5620000000.0, 5640000000.0, 5660000000.0, 5680000000.0, 5700000000.0, 5745000000.0, 5765000000.0, 5785000000.0, 5805000000.0, 5825000000.0, 5860000000.0, 5870000000.0, 5880000000.0, 5890000000.0, 5900000000.0, 5910000000.0, 5920000000.0] + + + labels + [' 1 | 2412.0 | 11g', ' 2 | 2417.0 | 11g', ' 3 | 2422.0 | 11g', ' 4 | 2427.0 | 11g', ' 5 | 2432.0 | 11g', ' 6 | 2437.0 | 11g', ' 7 | 2442.0 | 11g', ' 8 | 2447.0 | 11g', ' 9 | 2452.0 | 11g', ' 10 | 2457.0 | 11g', ' 11 | 2462.0 | 11g', ' 12 | 2467.0 | 11g', ' 13 | 2472.0 | 11g', ' 14 | 2484.0 | 11g', ' 34 | 5170.0 | 11a', ' 36 | 5180.0 | 11a', ' 38 | 5190.0 | 11a', ' 40 | 5200.0 | 11a', ' 42 | 5210.0 | 11a', ' 44 | 5220.0 | 11a', ' 46 | 5230.0 | 11a', ' 48 | 5240.0 | 11a', ' 52 | 5260.0 | 11a', ' 56 | 5280.0 | 11a', ' 58 | 5300.0 | 11a', ' 60 | 5320.0 | 11a', '100 | 5500.0 | 11a', '104 | 5520.0 | 11a', '108 | 5540.0 | 11a', '112 | 5560.0 | 11a', '116 | 5580.0 | 11a', '120 | 5600.0 | 11a', '124 | 5620.0 | 11a', '128 | 5640.0 | 11a', '132 | 5660.0 | 11a', '136 | 5680.0 | 11a', '140 | 5700.0 | 11a', '149 | 5745.0 | 11a', '153 | 5765.0 | 11a', '157 | 5785.0 | 11a', '161 | 5805.0 | 11a', '165 | 5825.0 | 11a', '172 | 5860.0 | 11p', '174 | 5870.0 | 11p', '176 | 5880.0 | 11p', '178 | 5890.0 | 11p', '180 | 5900.0 | 11p', '182 | 5910.0 | 11p', '184 | 5920.0 | 11p'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + _coordinate + (419, 11) + + + _rotation + 0 + + + + blocks_null_source + + id + blocks_null_source_0 + + + _enabled + True + + + type + complex + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (692, 334) + + + _rotation + 180 + + + + ieee802_11_ofdm_mac + + id + ieee802_11_ofdm_mac_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (465, 191) + + + _rotation + 0 + + uhd_usrp_sink @@ -339,7 +405,7 @@ otw - sc16 + stream_args @@ -987,7 +1053,183 @@ _coordinate - (307, 420) + (279, 428) + + + _rotation + 0 + + + + variable_slider + + id + mult + + + _enabled + True + + + label + + + + value + 1 + + + min + 0 + + + max + 2 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (979, 10) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (443, 300) + + + _rotation + 180 + + + + blocks_multiply_const_vxx + + id + blocks_multiply_const_vxx_1 + + + _enabled + True + + + type + complex + + + const + mult + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (172, 330) + + + _rotation + 180 + + + + blocks_file_sink + + id + blocks_file_sink_0 + + + _enabled + False + + + file + /tmp/ofdm.bin + + + type + complex + + + vlen + 1 + + + unbuffered + True + + + append + False + + + affinity + + + + _coordinate + (592, 430) _rotation @@ -1010,7 +1252,7 @@ period - 100 + 300 affinity @@ -1057,11 +1299,11 @@ pad_front - 0 + 100000 pad_tail - 0 + 100000 affinity @@ -1084,205 +1326,6 @@ 0 - - variable_chooser - - id - freq - - - _enabled - True - - - label - Channel - - - value - 5.22e9 - - - choices - [2412000000.0, 2417000000.0, 2422000000.0, 2427000000.0, 2432000000.0, 2437000000.0, 2442000000.0, 2447000000.0, 2452000000.0, 2457000000.0, 2462000000.0, 2467000000.0, 2472000000.0, 2484000000.0, 5170000000.0, 5180000000.0, 5190000000.0, 5200000000.0, 5210000000.0, 5220000000.0, 5230000000.0, 5240000000.0, 5260000000.0, 5280000000.0, 5300000000.0, 5320000000.0, 5500000000.0, 5520000000.0, 5540000000.0, 5560000000.0, 5580000000.0, 5600000000.0, 5620000000.0, 5640000000.0, 5660000000.0, 5680000000.0, 5700000000.0, 5745000000.0, 5765000000.0, 5785000000.0, 5805000000.0, 5825000000.0, 5860000000.0, 5870000000.0, 5880000000.0, 5890000000.0, 5900000000.0, 5910000000.0, 5920000000.0] - - - labels - [' 1 | 2412.0 | 11g', ' 2 | 2417.0 | 11g', ' 3 | 2422.0 | 11g', ' 4 | 2427.0 | 11g', ' 5 | 2432.0 | 11g', ' 6 | 2437.0 | 11g', ' 7 | 2442.0 | 11g', ' 8 | 2447.0 | 11g', ' 9 | 2452.0 | 11g', ' 10 | 2457.0 | 11g', ' 11 | 2462.0 | 11g', ' 12 | 2467.0 | 11g', ' 13 | 2472.0 | 11g', ' 14 | 2484.0 | 11g', ' 34 | 5170.0 | 11a', ' 36 | 5180.0 | 11a', ' 38 | 5190.0 | 11a', ' 40 | 5200.0 | 11a', ' 42 | 5210.0 | 11a', ' 44 | 5220.0 | 11a', ' 46 | 5230.0 | 11a', ' 48 | 5240.0 | 11a', ' 52 | 5260.0 | 11a', ' 56 | 5280.0 | 11a', ' 58 | 5300.0 | 11a', ' 60 | 5320.0 | 11a', '100 | 5500.0 | 11a', '104 | 5520.0 | 11a', '108 | 5540.0 | 11a', '112 | 5560.0 | 11a', '116 | 5580.0 | 11a', '120 | 5600.0 | 11a', '124 | 5620.0 | 11a', '128 | 5640.0 | 11a', '132 | 5660.0 | 11a', '136 | 5680.0 | 11a', '140 | 5700.0 | 11a', '149 | 5745.0 | 11a', '153 | 5765.0 | 11a', '157 | 5785.0 | 11a', '161 | 5805.0 | 11a', '165 | 5825.0 | 11a', '172 | 5860.0 | 11p', '174 | 5870.0 | 11p', '176 | 5880.0 | 11p', '178 | 5890.0 | 11p', '180 | 5900.0 | 11p', '182 | 5910.0 | 11p', '184 | 5920.0 | 11p'] - - - type - drop_down - - - style - wx.RA_HORIZONTAL - - - grid_pos - - - - notebook - - - - _coordinate - (419, 11) - - - _rotation - 0 - - - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_1 - - - _enabled - True - - - type - complex - - - const - mult - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (162, 330) - - - _rotation - 180 - - - - blocks_null_source - - id - blocks_null_source_0 - - - _enabled - True - - - type - complex - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (692, 334) - - - _rotation - 180 - - - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (465, 191) - - - _rotation - 0 - - - - wifi_phy_hier - - id - wifi_phy_hier_0 - - - _enabled - True - - - encoding - 0 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (445, 302) - - - _rotation - 180 - - blocks_multiply_const_vxx_1 foo_packet_pad_0 From ebdcdb651d4edb23bd7e719fc1428b24d06a3cf0 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Mon, 20 Jan 2014 14:22:34 +0100 Subject: [PATCH 15/21] utils: add power measure script --- utils/power.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 utils/power.R diff --git a/utils/power.R b/utils/power.R new file mode 100644 index 0000000..e1682da --- /dev/null +++ b/utils/power.R @@ -0,0 +1,13 @@ +library(TTR) +library(ggplot2) + +### test file +in.file <- file('/tmp/ofdm.bin', 'rb') + +sig <- readBin(in.file, double(), n=10000, size=4, endian='little') + +sig <- sig[seq(1, length(sig), 2)] + 1i * sig[seq(2, length(sig), 2)] + +pow <- abs(sig)^2 + +plot(SMA(pow, 1600), type='l') From ed0643e4e10da607653b58f2d7f120b7ec95c64e Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Sat, 1 Feb 2014 18:31:54 +0100 Subject: [PATCH 16/21] utils: calc sync words --- utils/sync_words.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 utils/sync_words.py diff --git a/utils/sync_words.py b/utils/sync_words.py new file mode 100644 index 0000000..7a9412f --- /dev/null +++ b/utils/sync_words.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + + +short = tuple([(52**.5/24**.5) * x for x in [0, 0, 0, 0, 0, 0, 0, 0, 1+1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, -1-1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, 0, 0, 0, 0, -1-1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 0, 0, 0, 0]]) + +long_norm = tuple([0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 0, 0, 0, 0]) + + +mul = tuple([1, -1j, -1, 1j] * 16) +long_rot = tuple([x * y for x, y in zip(long_norm, mul)]) + + +sync = tuple([short, short, long_rot, long_norm]) + + +assert(len(short) == 64) +assert(len(long_norm) == 64) +assert(len(long_rot) == 64) +assert(len(sync) == 4) + +print "power short: " + str(sum([abs(x)**2 for x in short])) +print "power long: " + str(sum([abs(x)**2 for x in long_norm])) + +print "sync sequence" +print sync +print "len sync: " + str(len(sync)) + + + + + + + From 2960d00bc5982fc51a515102d13bb2733308fc06 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Sat, 1 Feb 2014 18:36:06 +0100 Subject: [PATCH 17/21] flow graphs: use packet pad2 to insert sob/eob the preamble block did this before, but is deleted meanwhile --- examples/wifi_loopback.grc | 504 ++++++++++++++--------------- examples/wifi_phy_hier.grc | 587 ++++++++++++++++------------------ examples/wifi_transceiver.grc | 146 ++++----- examples/wifi_tx.grc | 389 ++++++++++------------ 4 files changed, 772 insertions(+), 854 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index 5e60db3..a994e13 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -1,6 +1,6 @@ - Mon Jan 20 12:59:27 2014 + Sat Feb 1 18:28:19 2014 options @@ -134,61 +134,6 @@ 0 - - variable_slider - - id - freq_offset - - - _enabled - True - - - label - - - - value - 500 - - - min - -10000 - - - max - 10000 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (947, 7) - - - _rotation - 0 - - import @@ -329,49 +274,6 @@ 0 - - blocks_multiply_xx - - id - blocks_multiply_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (544, 440) - - - _rotation - 0 - - analog_sig_source_x @@ -497,147 +399,6 @@ 180 - - foo_packet_pad - - id - foo_packet_pad_0 - - - _enabled - True - - - debug - False - - - delay - False - - - delay_sec - 0.001 - - - pad_front - 60000 - - - pad_tail - 20000 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (308, 408) - - - _rotation - 0 - - - - variable_slider - - id - noise_power - - - _enabled - True - - - label - - - - value - 0.01 - - - min - 0.01 - - - max - 5 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (814, 8) - - - _rotation - 0 - - - - wifi_phy_hier - - id - wifi_phy_hier_0 - - - _enabled - True - - - encoding - encoding - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (360, 262) - - - _rotation - 180 - - analog_noise_source_x @@ -865,6 +626,245 @@ 180 + + blocks_multiply_xx + + id + blocks_multiply_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (544, 440) + + + _rotation + 0 + + + + variable_slider + + id + freq_offset + + + _enabled + True + + + label + + + + value + 0 + + + min + -10000 + + + max + 10000 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (947, 7) + + + _rotation + 0 + + + + variable_slider + + id + noise_power + + + _enabled + True + + + label + + + + value + 0.1 + + + min + 0.01 + + + max + 5 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (814, 8) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + encoding + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (360, 262) + + + _rotation + 180 + + + + foo_packet_pad2 + + id + foo_packet_pad2_0 + + + _enabled + True + + + debug + False + + + delay + False + + + delay_sec + 0.001 + + + pad_front + 10000 + + + pad_tail + 10000 + + + affinity + + + + minoutbuf + 48000 + + + maxoutbuf + 0 + + + _coordinate + (315, 404) + + + _rotation + 0 + + foo_wireshark_connector_0 blocks_file_sink_0 @@ -877,12 +877,6 @@ 0 1 - - foo_packet_pad_0 - blocks_multiply_xx_0 - 0 - 0 - analog_noise_source_x_0 blocks_add_xx_0 @@ -919,12 +913,6 @@ 0 0 - - wifi_phy_hier_0 - foo_packet_pad_0 - 0 - 0 - wifi_phy_hier_0 ieee802_11_ofdm_mac_0 @@ -943,4 +931,16 @@ strobe app in + + foo_packet_pad2_0 + blocks_multiply_xx_0 + 0 + 0 + + + wifi_phy_hier_0 + foo_packet_pad2_0 + 0 + 0 + diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index e944652..75ce41d 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -1,6 +1,6 @@ - Mon Jan 20 14:02:22 2014 + Sat Feb 1 18:33:23 2014 options @@ -64,7 +64,7 @@ variable id - header_formatter + window_size _enabled @@ -72,11 +72,11 @@ value - ieee802_11.wifi_signal_field() + 48 _coordinate - (518, 18) + (323, 14) _rotation @@ -110,7 +110,7 @@ variable id - window_size + header_formatter _enabled @@ -118,11 +118,11 @@ value - 48 + ieee802_11.wifi_signal_field() _coordinate - (323, 14) + (518, 18) _rotation @@ -332,45 +332,6 @@ 0 - - pad_source - - id - pad_source_0 - - - _enabled - True - - - label - samp_in - - - type - complex - - - vlen - 1 - - - num_streams - 1 - - - optional - False - - - _coordinate - (57, 549) - - - _rotation - 0 - - fft_vxx @@ -945,45 +906,6 @@ 0 - - pad_sink - - id - pad_sink_0 - - - _enabled - True - - - label - samp_out - - - type - complex - - - vlen - 1 - - - num_streams - 1 - - - optional - False - - - _coordinate - (305, 428) - - - _rotation - 180 - - ieee802_11_ofdm_mapper @@ -1144,198 +1066,6 @@ 0 - - fft_vxx - - id - fft_vxx_0 - - - _enabled - True - - - type - complex - - - fft_size - 64 - - - forward - False - - - window - tuple([1/52**.5] * 64) - - - shift - True - - - nthreads - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (973, 396) - - - _rotation - 180 - - - - digital_ofdm_carrier_allocator_cvc - - id - digital_ofdm_carrier_allocator_cvc_0_0 - - - _enabled - True - - - fft_len - 64 - - - occupied_carriers - (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),) - - - pilot_carriers - ((-21, -7, 7, 21), ) - - - pilot_symbols - ((1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1)) - - - sync_words - () - - - len_tag_key - "packet_len" - - - affinity - - - - minoutbuf - 1000 - - - maxoutbuf - 0 - - - _coordinate - (1023, 242) - - - _rotation - 0 - - - - ieee802_11_ofdm_preamble - - id - ieee802_11_ofdm_preamble_0 - - - _enabled - True - - - debug - False - - - affinity - - - - minoutbuf - 48000 - - - maxoutbuf - 0 - - - _coordinate - (510, 428) - - - _rotation - 180 - - - - digital_ofdm_cyclic_prefixer - - id - digital_ofdm_cyclic_prefixer_0 - - - _enabled - True - - - input_size - 64 - - - cp_len - 16 - - - rolloff - 2 - - - tagname - "packet_len" - - - affinity - - - - minoutbuf - 48000 - - - maxoutbuf - 0 - - - _coordinate - (731, 412) - - - _rotation - 180 - - blocks_tagged_stream_mux @@ -1380,25 +1110,248 @@ _coordinate - (743, 269) + (744, 269) + + + _rotation + 0 + + + + digital_ofdm_carrier_allocator_cvc + + id + digital_ofdm_carrier_allocator_cvc_0_0_0 + + + _enabled + True + + + fft_len + 64 + + + occupied_carriers + (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),) + + + pilot_carriers + ((-21, -7, 7, 21), ) + + + pilot_symbols + ((1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (1, 1, 1, -1), (1, 1, 1, -1), (1, 1, 1, -1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1), (-1, -1, -1, 1)) + + + sync_words + ((0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (-1.4719601443879746-1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, (1.4719601443879746+1.4719601443879746j), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), (0, 0j, 0, 0j, 0, 0j, -1, 1j, -1, 1j, -1, 1j, -1, -1j, 1, 1j, 1, -1j, -1, 1j, 1, 1j, 1, 1j, 1, 1j, -1, (-0-1j), 1, -1j, -1, 1j, 0, -1j, 1, (-0-1j), 1, -1j, 1, 1j, -1, -1j, 1, (-0-1j), -1, 1j, 1, 1j, 1, 1j, 1, 1j, -1, -1j, 1, 1j, 1, -1j, -1, 0j, 0, 0j, 0, 0j), (0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 0, 0, 0, 0)) + + + len_tag_key + "packet_len" + + + affinity + + + + minoutbuf + 1000 + + + maxoutbuf + 0 + + + _coordinate + (1005, 242) + + + _rotation + 0 + + + + fft_vxx + + id + fft_vxx_0_0 + + + _enabled + True + + + type + complex + + + fft_size + 64 + + + forward + False + + + window + tuple([1/52**.5] * 64) + + + shift + True + + + nthreads + 1 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1003, 395) + + + _rotation + 180 + + + + digital_ofdm_cyclic_prefixer + + id + digital_ofdm_cyclic_prefixer_0_0 + + + _enabled + True + + + input_size + 64 + + + cp_len + 16 + + + rolloff + 2 + + + tagname + "packet_len" + + + affinity + + + + minoutbuf + 48000 + + + maxoutbuf + 0 + + + _coordinate + (703, 411) + + + _rotation + 180 + + + + pad_sink + + id + pad_sink_0 + + + _enabled + True + + + label + samp_out + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (470, 427) + + + _rotation + 180 + + + + pad_source + + id + pad_source_0 + + + _enabled + True + + + label + samp_in + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + True + + + _coordinate + (57, 549) _rotation 0 - - fft_vxx_0 - digital_ofdm_cyclic_prefixer_0 - 0 - 0 - - - ieee802_11_ofdm_preamble_0 - pad_sink_0 - 0 - 0 - pad_source_1 ieee802_11_ofdm_mapper_0 @@ -1423,12 +1376,6 @@ 0 1 - - blocks_complex_to_mag_squared_0 - ieee802_11_moving_average_xx_0 - 0 - 0 - ieee802_11_moving_average_xx_1 blocks_complex_to_mag_0 @@ -1537,12 +1484,6 @@ 0 0 - - digital_ofdm_cyclic_prefixer_0 - ieee802_11_ofdm_preamble_0 - 0 - 0 - ieee802_11_chunks_to_symbols_xx_0 blocks_tagged_stream_mux_0 @@ -1555,18 +1496,6 @@ 0 0 - - blocks_tagged_stream_mux_0 - digital_ofdm_carrier_allocator_cvc_0_0 - 0 - 0 - - - digital_ofdm_carrier_allocator_cvc_0_0 - fft_vxx_0 - 0 - 0 - ieee802_11_ofdm_mapper_0 digital_packet_headergenerator_bb_0 @@ -1579,4 +1508,34 @@ 0 0 + + blocks_complex_to_mag_squared_0 + ieee802_11_moving_average_xx_0 + 0 + 0 + + + fft_vxx_0_0 + digital_ofdm_cyclic_prefixer_0_0 + 0 + 0 + + + blocks_tagged_stream_mux_0 + digital_ofdm_carrier_allocator_cvc_0_0_0 + 0 + 0 + + + digital_ofdm_carrier_allocator_cvc_0_0_0 + fft_vxx_0_0 + 0 + 0 + + + digital_ofdm_cyclic_prefixer_0_0 + pad_sink_0 + 0 + 0 + diff --git a/examples/wifi_transceiver.grc b/examples/wifi_transceiver.grc index dd13b60..8265b68 100644 --- a/examples/wifi_transceiver.grc +++ b/examples/wifi_transceiver.grc @@ -1,6 +1,6 @@ - Mon Jan 20 14:04:11 2014 + Sat Feb 1 18:32:31 2014 options @@ -1361,49 +1361,6 @@ 180 - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - mult - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (108, 390) - - - _rotation - 180 - - uhd_usrp_sink @@ -2076,34 +2033,26 @@ - foo_packet_pad + blocks_multiply_const_vxx id - foo_packet_pad_0 + blocks_multiply_const_vxx_0 _enabled True - debug - False + type + complex - delay - False + const + mult - delay_sec - 0.0005 - - - pad_front - 10000 - - - pad_tail - 10000 + vlen + 1 affinity @@ -2119,7 +2068,58 @@ _coordinate - (73, 479) + (108, 389) + + + _rotation + 180 + + + + foo_packet_pad2 + + id + foo_packet_pad2_0 + + + _enabled + True + + + debug + False + + + delay + False + + + delay_sec + 0.001 + + + pad_front + 10000 + + + pad_tail + 0 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (78, 479) _rotation @@ -2132,12 +2132,6 @@ 0 0 - - foo_packet_pad_0 - uhd_usrp_sink_0 - 0 - 0 - ieee802_11_ether_encap_0 blocks_tuntap_pdu_0 @@ -2168,12 +2162,6 @@ phy out in - - blocks_multiply_const_vxx_0 - foo_packet_pad_0 - 0 - 0 - wifi_phy_hier_0 blocks_multiply_const_vxx_0 @@ -2210,4 +2198,16 @@ mac_out in + + foo_packet_pad2_0 + uhd_usrp_sink_0 + 0 + 0 + + + blocks_multiply_const_vxx_0 + foo_packet_pad2_0 + 0 + 0 + diff --git a/examples/wifi_tx.grc b/examples/wifi_tx.grc index 43c828e..331f4c3 100644 --- a/examples/wifi_tx.grc +++ b/examples/wifi_tx.grc @@ -1,6 +1,6 @@ - Mon Jan 20 13:49:51 2014 + Sat Feb 1 18:33:30 2014 options @@ -320,23 +320,74 @@ - blocks_null_source + variable_slider id - blocks_null_source_0 + mult _enabled True - type - complex + label + - vlen + value 1 + + min + 0 + + + max + 2 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (979, 10) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + 0 + affinity @@ -351,7 +402,7 @@ _coordinate - (692, 334) + (443, 300) _rotation @@ -389,6 +440,92 @@ 0 + + blocks_socket_pdu + + id + blocks_socket_pdu_0 + + + _enabled + True + + + type + "UDP_SERVER" + + + host + + + + port + 52001 + + + mtu + 10000 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (200, 210) + + + _rotation + 0 + + + + blocks_message_strobe + + id + blocks_message_strobe_0 + + + _enabled + True + + + msg + pmt.intern(" Hello World") + + + period + 300 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (113, 154) + + + _rotation + 0 + + uhd_usrp_sink @@ -1061,72 +1198,33 @@ - variable_slider + foo_packet_pad2 id - mult + foo_packet_pad2_0 _enabled True - label - + debug + False - value - 1 + delay + False - min + delay_sec + 0.001 + + + pad_front 0 - max - 2 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (979, 10) - - - _rotation - 0 - - - - wifi_phy_hier - - id - wifi_phy_hier_0 - - - _enabled - True - - - encoding + pad_tail 0 @@ -1143,11 +1241,11 @@ _coordinate - (443, 300) + (86, 420) _rotation - 180 + 0 @@ -1186,158 +1284,13 @@ _coordinate - (172, 330) + (199, 330) _rotation 180 - - blocks_file_sink - - id - blocks_file_sink_0 - - - _enabled - False - - - file - /tmp/ofdm.bin - - - type - complex - - - vlen - 1 - - - unbuffered - True - - - append - False - - - affinity - - - - _coordinate - (592, 430) - - - _rotation - 0 - - - - blocks_message_strobe - - id - blocks_message_strobe_0 - - - _enabled - True - - - msg - pmt.intern("Hello World") - - - period - 300 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (113, 179) - - - _rotation - 0 - - - - foo_packet_pad - - id - foo_packet_pad_0 - - - _enabled - True - - - debug - False - - - delay - True - - - delay_sec - 0.001 - - - pad_front - 100000 - - - pad_tail - 100000 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (93, 420) - - - _rotation - 0 - - - - blocks_multiply_const_vxx_1 - foo_packet_pad_0 - 0 - 0 - - - foo_packet_pad_0 - uhd_usrp_sink_0 - 0 - 0 - blocks_message_strobe_0 ieee802_11_ofdm_mac_0 @@ -1350,12 +1303,6 @@ 0 0 - - blocks_null_source_0 - wifi_phy_hier_0 - 0 - 0 - ieee802_11_ofdm_mac_0 wifi_phy_hier_0 @@ -1363,9 +1310,21 @@ mac_in - wifi_phy_hier_0 + blocks_socket_pdu_0 ieee802_11_ofdm_mac_0 - mac_out - phy in + pdus + app in + + + foo_packet_pad2_0 + uhd_usrp_sink_0 + 0 + 0 + + + blocks_multiply_const_vxx_1 + foo_packet_pad2_0 + 0 + 0 From 60cd189d265f3a72aa06ef56c72d19c096e82a24 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Sat, 1 Feb 2014 19:30:26 +0100 Subject: [PATCH 18/21] mapper: add maximum packet size currently gnu radio can not handle larger tagged stream packets --- lib/ofdm_mapper.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ofdm_mapper.cc b/lib/ofdm_mapper.cc index 73d1336..62dffe2 100644 --- a/lib/ofdm_mapper.cc +++ b/lib/ofdm_mapper.cc @@ -82,6 +82,10 @@ int general_work(int noutput, gr_vector_int& ninput_items, // ############ INSERT MAC STUFF tx_param tx(d_ofdm, psdu_length); + if(tx.n_sym > 120) { + std::cout << "packet too large" < Date: Sat, 1 Feb 2014 19:30:38 +0100 Subject: [PATCH 19/21] update flow graphs --- examples/rx_demo.grc | 114 +++--- examples/wifi_phy_hier.grc | 254 ++++++------- examples/wifi_transceiver.grc | 90 ++--- examples/wifi_tx.grc | 671 ++++++++++++++++++---------------- 4 files changed, 590 insertions(+), 539 deletions(-) diff --git a/examples/rx_demo.grc b/examples/rx_demo.grc index 345f4e6..50aaaeb 100644 --- a/examples/rx_demo.grc +++ b/examples/rx_demo.grc @@ -1,6 +1,6 @@ - Thu Dec 5 14:05:11 2013 + Sat Feb 1 18:56:56 2014 options @@ -60,29 +60,6 @@ 0 - - variable - - id - sync_length - - - _enabled - True - - - value - 320 - - - _coordinate - (601, 15) - - - _rotation - 0 - - variable @@ -107,50 +84,22 @@ - ieee802_11_ofdm_sync_short + variable id - ieee802_11_ofdm_sync_short_0 + sync_length _enabled True - log - False - - - debug - False - - - threshold - 0.8 - - - max_samples - 80 * 160 - - - min_plateau - 2 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 + value + 320 _coordinate - (212, 501) + (601, 15) _rotation @@ -1966,6 +1915,57 @@ 0 + + ieee802_11_ofdm_sync_short + + id + ieee802_11_ofdm_sync_short_0 + + + _enabled + True + + + log + False + + + debug + False + + + threshold + 0.85 + + + max_samples + 80 * 160 + + + min_plateau + 2 + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (212, 501) + + + _rotation + 0 + + blocks_stream_to_vector_0 fft_vxx_0 diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index 75ce41d..637edd2 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -1,6 +1,6 @@ - Sat Feb 1 18:33:23 2014 + Sat Feb 1 19:26:09 2014 options @@ -1117,6 +1117,84 @@ 0 + + pad_source + + id + pad_source_0 + + + _enabled + True + + + label + samp_in + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (57, 549) + + + _rotation + 0 + + + + pad_sink + + id + pad_sink_0 + + + _enabled + True + + + label + samp_out + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (470, 427) + + + _rotation + 180 + + digital_ofdm_carrier_allocator_cvc @@ -1157,7 +1235,7 @@ minoutbuf - 1000 + 10000 maxoutbuf @@ -1172,6 +1250,53 @@ 0 + + digital_ofdm_cyclic_prefixer + + id + digital_ofdm_cyclic_prefixer_0_0 + + + _enabled + True + + + input_size + 64 + + + cp_len + 16 + + + rolloff + 2 + + + tagname + "packet_len" + + + affinity + + + + minoutbuf + 100000 + + + maxoutbuf + 0 + + + _coordinate + (703, 411) + + + _rotation + 180 + + fft_vxx @@ -1227,131 +1352,6 @@ 180 - - digital_ofdm_cyclic_prefixer - - id - digital_ofdm_cyclic_prefixer_0_0 - - - _enabled - True - - - input_size - 64 - - - cp_len - 16 - - - rolloff - 2 - - - tagname - "packet_len" - - - affinity - - - - minoutbuf - 48000 - - - maxoutbuf - 0 - - - _coordinate - (703, 411) - - - _rotation - 180 - - - - pad_sink - - id - pad_sink_0 - - - _enabled - True - - - label - samp_out - - - type - complex - - - vlen - 1 - - - num_streams - 1 - - - optional - False - - - _coordinate - (470, 427) - - - _rotation - 180 - - - - pad_source - - id - pad_source_0 - - - _enabled - True - - - label - samp_in - - - type - complex - - - vlen - 1 - - - num_streams - 1 - - - optional - True - - - _coordinate - (57, 549) - - - _rotation - 0 - - pad_source_1 ieee802_11_ofdm_mapper_0 diff --git a/examples/wifi_transceiver.grc b/examples/wifi_transceiver.grc index 8265b68..e6ae492 100644 --- a/examples/wifi_transceiver.grc +++ b/examples/wifi_transceiver.grc @@ -1,6 +1,6 @@ - Sat Feb 1 18:32:31 2014 + Sat Feb 1 19:26:54 2014 options @@ -2032,49 +2032,6 @@ 0 - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - mult - - - vlen - 1 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (108, 389) - - - _rotation - 180 - - foo_packet_pad2 @@ -2111,7 +2068,7 @@ minoutbuf - 0 + 100000 maxoutbuf @@ -2126,6 +2083,49 @@ 0 + + blocks_multiply_const_vxx + + id + blocks_multiply_const_vxx_0 + + + _enabled + True + + + type + complex + + + const + mult + + + vlen + 1 + + + affinity + + + + minoutbuf + 100000 + + + maxoutbuf + 0 + + + _coordinate + (108, 389) + + + _rotation + 180 + + foo_wireshark_connector_0 blocks_file_sink_0 diff --git a/examples/wifi_tx.grc b/examples/wifi_tx.grc index 331f4c3..9fef251 100644 --- a/examples/wifi_tx.grc +++ b/examples/wifi_tx.grc @@ -1,6 +1,6 @@ - Sat Feb 1 18:33:30 2014 + Sat Feb 1 19:26:11 2014 options @@ -115,57 +115,6 @@ 0 - - variable_chooser - - id - lo_offset - - - _enabled - True - - - label - LO Offset - - - value - 0 - - - choices - [0, 6e9, 11e9] - - - labels - ['0 MHz', '6 MHz', '11 MHz'] - - - type - drop_down - - - style - wx.RA_HORIZONTAL - - - grid_pos - - - - notebook - - - - _coordinate - (697, 165) - - - _rotation - 0 - - variable_chooser @@ -217,229 +166,6 @@ 0 - - variable_chooser - - id - samp_rate - - - _enabled - True - - - label - Sample Rate - - - value - 20e6 - - - choices - [10e6, 20e6] - - - labels - ["10 Mhz", "20 Mhz"] - - - type - radio_buttons - - - style - wx.RA_HORIZONTAL - - - grid_pos - - - - notebook - - - - _coordinate - (629, 14) - - - _rotation - 0 - - - - variable_chooser - - id - freq - - - _enabled - True - - - label - Channel - - - value - 5.22e9 - - - choices - [2412000000.0, 2417000000.0, 2422000000.0, 2427000000.0, 2432000000.0, 2437000000.0, 2442000000.0, 2447000000.0, 2452000000.0, 2457000000.0, 2462000000.0, 2467000000.0, 2472000000.0, 2484000000.0, 5170000000.0, 5180000000.0, 5190000000.0, 5200000000.0, 5210000000.0, 5220000000.0, 5230000000.0, 5240000000.0, 5260000000.0, 5280000000.0, 5300000000.0, 5320000000.0, 5500000000.0, 5520000000.0, 5540000000.0, 5560000000.0, 5580000000.0, 5600000000.0, 5620000000.0, 5640000000.0, 5660000000.0, 5680000000.0, 5700000000.0, 5745000000.0, 5765000000.0, 5785000000.0, 5805000000.0, 5825000000.0, 5860000000.0, 5870000000.0, 5880000000.0, 5890000000.0, 5900000000.0, 5910000000.0, 5920000000.0] - - - labels - [' 1 | 2412.0 | 11g', ' 2 | 2417.0 | 11g', ' 3 | 2422.0 | 11g', ' 4 | 2427.0 | 11g', ' 5 | 2432.0 | 11g', ' 6 | 2437.0 | 11g', ' 7 | 2442.0 | 11g', ' 8 | 2447.0 | 11g', ' 9 | 2452.0 | 11g', ' 10 | 2457.0 | 11g', ' 11 | 2462.0 | 11g', ' 12 | 2467.0 | 11g', ' 13 | 2472.0 | 11g', ' 14 | 2484.0 | 11g', ' 34 | 5170.0 | 11a', ' 36 | 5180.0 | 11a', ' 38 | 5190.0 | 11a', ' 40 | 5200.0 | 11a', ' 42 | 5210.0 | 11a', ' 44 | 5220.0 | 11a', ' 46 | 5230.0 | 11a', ' 48 | 5240.0 | 11a', ' 52 | 5260.0 | 11a', ' 56 | 5280.0 | 11a', ' 58 | 5300.0 | 11a', ' 60 | 5320.0 | 11a', '100 | 5500.0 | 11a', '104 | 5520.0 | 11a', '108 | 5540.0 | 11a', '112 | 5560.0 | 11a', '116 | 5580.0 | 11a', '120 | 5600.0 | 11a', '124 | 5620.0 | 11a', '128 | 5640.0 | 11a', '132 | 5660.0 | 11a', '136 | 5680.0 | 11a', '140 | 5700.0 | 11a', '149 | 5745.0 | 11a', '153 | 5765.0 | 11a', '157 | 5785.0 | 11a', '161 | 5805.0 | 11a', '165 | 5825.0 | 11a', '172 | 5860.0 | 11p', '174 | 5870.0 | 11p', '176 | 5880.0 | 11p', '178 | 5890.0 | 11p', '180 | 5900.0 | 11p', '182 | 5910.0 | 11p', '184 | 5920.0 | 11p'] - - - type - drop_down - - - style - wx.RA_HORIZONTAL - - - grid_pos - - - - notebook - - - - _coordinate - (419, 11) - - - _rotation - 0 - - - - variable_slider - - id - mult - - - _enabled - True - - - label - - - - value - 1 - - - min - 0 - - - max - 2 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - _coordinate - (979, 10) - - - _rotation - 0 - - - - wifi_phy_hier - - id - wifi_phy_hier_0 - - - _enabled - True - - - encoding - 0 - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (443, 300) - - - _rotation - 180 - - - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (465, 191) - - - _rotation - 0 - - blocks_socket_pdu @@ -1198,34 +924,22 @@ - foo_packet_pad2 + blocks_null_source id - foo_packet_pad2_0 + blocks_null_source_0 _enabled True - debug - False + type + complex - delay - False - - - delay_sec - 0.001 - - - pad_front - 0 - - - pad_tail - 0 + vlen + 1 affinity @@ -1241,18 +955,18 @@ _coordinate - (86, 420) + (678, 333) _rotation - 0 + 180 blocks_multiply_const_vxx id - blocks_multiply_const_vxx_1 + blocks_multiply_const_vxx_0 _enabled @@ -1284,31 +998,344 @@ _coordinate - (199, 330) + (232, 329) _rotation 180 + + ieee802_11_ofdm_mac + + id + ieee802_11_ofdm_mac_0 + + + _enabled + True + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (465, 191) + + + _rotation + 0 + + + + variable_chooser + + id + lo_offset + + + _enabled + True + + + label + LO Offset + + + value + 6e9 + + + choices + [0, 6e9, 11e9] + + + labels + ['0 MHz', '6 MHz', '11 MHz'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + _coordinate + (697, 165) + + + _rotation + 0 + + + + variable_chooser + + id + freq + + + _enabled + True + + + label + Channel + + + value + 5.89e9 + + + choices + [2412000000.0, 2417000000.0, 2422000000.0, 2427000000.0, 2432000000.0, 2437000000.0, 2442000000.0, 2447000000.0, 2452000000.0, 2457000000.0, 2462000000.0, 2467000000.0, 2472000000.0, 2484000000.0, 5170000000.0, 5180000000.0, 5190000000.0, 5200000000.0, 5210000000.0, 5220000000.0, 5230000000.0, 5240000000.0, 5260000000.0, 5280000000.0, 5300000000.0, 5320000000.0, 5500000000.0, 5520000000.0, 5540000000.0, 5560000000.0, 5580000000.0, 5600000000.0, 5620000000.0, 5640000000.0, 5660000000.0, 5680000000.0, 5700000000.0, 5745000000.0, 5765000000.0, 5785000000.0, 5805000000.0, 5825000000.0, 5860000000.0, 5870000000.0, 5880000000.0, 5890000000.0, 5900000000.0, 5910000000.0, 5920000000.0] + + + labels + [' 1 | 2412.0 | 11g', ' 2 | 2417.0 | 11g', ' 3 | 2422.0 | 11g', ' 4 | 2427.0 | 11g', ' 5 | 2432.0 | 11g', ' 6 | 2437.0 | 11g', ' 7 | 2442.0 | 11g', ' 8 | 2447.0 | 11g', ' 9 | 2452.0 | 11g', ' 10 | 2457.0 | 11g', ' 11 | 2462.0 | 11g', ' 12 | 2467.0 | 11g', ' 13 | 2472.0 | 11g', ' 14 | 2484.0 | 11g', ' 34 | 5170.0 | 11a', ' 36 | 5180.0 | 11a', ' 38 | 5190.0 | 11a', ' 40 | 5200.0 | 11a', ' 42 | 5210.0 | 11a', ' 44 | 5220.0 | 11a', ' 46 | 5230.0 | 11a', ' 48 | 5240.0 | 11a', ' 52 | 5260.0 | 11a', ' 56 | 5280.0 | 11a', ' 58 | 5300.0 | 11a', ' 60 | 5320.0 | 11a', '100 | 5500.0 | 11a', '104 | 5520.0 | 11a', '108 | 5540.0 | 11a', '112 | 5560.0 | 11a', '116 | 5580.0 | 11a', '120 | 5600.0 | 11a', '124 | 5620.0 | 11a', '128 | 5640.0 | 11a', '132 | 5660.0 | 11a', '136 | 5680.0 | 11a', '140 | 5700.0 | 11a', '149 | 5745.0 | 11a', '153 | 5765.0 | 11a', '157 | 5785.0 | 11a', '161 | 5805.0 | 11a', '165 | 5825.0 | 11a', '172 | 5860.0 | 11p', '174 | 5870.0 | 11p', '176 | 5880.0 | 11p', '178 | 5890.0 | 11p', '180 | 5900.0 | 11p', '182 | 5910.0 | 11p', '184 | 5920.0 | 11p'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + _coordinate + (419, 11) + + + _rotation + 0 + + + + variable_slider + + id + mult + + + _enabled + True + + + label + + + + value + .38 + + + min + 0 + + + max + 2 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + _coordinate + (979, 10) + + + _rotation + 0 + + + + variable_chooser + + id + samp_rate + + + _enabled + True + + + label + Sample Rate + + + value + 10e6 + + + choices + [10e6, 20e6] + + + labels + ["10 Mhz", "20 Mhz"] + + + type + radio_buttons + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + _coordinate + (629, 14) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + encoding + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (461, 299) + + + _rotation + 180 + + + + foo_packet_pad2 + + id + foo_packet_pad2_0 + + + _enabled + True + + + debug + False + + + delay + True + + + delay_sec + 0.001 + + + pad_front + 10000 + + + pad_tail + 0 + + + affinity + + + + minoutbuf + 100000 + + + maxoutbuf + 0 + + + _coordinate + (86, 420) + + + _rotation + 0 + + blocks_message_strobe_0 ieee802_11_ofdm_mac_0 strobe app in - - wifi_phy_hier_0 - blocks_multiply_const_vxx_1 - 0 - 0 - - - ieee802_11_ofdm_mac_0 - wifi_phy_hier_0 - phy out - mac_in - blocks_socket_pdu_0 ieee802_11_ofdm_mac_0 @@ -1322,9 +1349,33 @@ 0 - blocks_multiply_const_vxx_1 + wifi_phy_hier_0 + blocks_multiply_const_vxx_0 + 0 + 0 + + + blocks_null_source_0 + wifi_phy_hier_0 + 0 + 0 + + + blocks_multiply_const_vxx_0 foo_packet_pad2_0 0 0 + + ieee802_11_ofdm_mac_0 + wifi_phy_hier_0 + phy out + mac_in + + + wifi_phy_hier_0 + ieee802_11_ofdm_mac_0 + mac_out + phy in + From faadad9838ad1767712dd19ff6e1987fd2060082 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Wed, 26 Feb 2014 14:04:49 +0100 Subject: [PATCH 20/21] utils: add script to create long preamble --- utils/create_long.R | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 utils/create_long.R diff --git a/utils/create_long.R b/utils/create_long.R new file mode 100644 index 0000000..edaa1dd --- /dev/null +++ b/utils/create_long.R @@ -0,0 +1,26 @@ + +fft.shift <- function(sym) { + + sym <- matrix(sym, ncol=64) + + # the explicit dimensions are required + # if sym contains only one row + m1 <- matrix(sym[,33:64], ncol=32) + m2 <- matrix(sym[, 1:32], ncol=32) + + return(cbind(m1, m2)) +} + +### symbols as defined in the standard +sym <- c(1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1) +freq <- c(rep(0, 6), sym, rep(0, 5)) + +pre <- fft(fft.shift(freq), inverse=T) / sqrt(52) + + +for(i in seq(1, 64, 4)) { + cat("\t\tgr_complex(", sprintf("% .4f", Re(pre[ i])), ", ", sprintf("% .4f", Im(pre[ i])), "), ", sep="") + cat( "gr_complex(", sprintf("% .4f", Re(pre[i+1])), ", ", sprintf("% .4f", Im(pre[i+1])), "), ", sep="") + cat( "gr_complex(", sprintf("% .4f", Re(pre[i+2])), ", ", sprintf("% .4f", Im(pre[i+2])), "), ", sep="") + cat( "gr_complex(", sprintf("% .4f", Re(pre[i+3])), ", ", sprintf("% .4f", Im(pre[i+3])), "),\n", sep="") +} From 9552242d7c7155c13d9aa1e3b0cd7369b29f0807 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Wed, 26 Feb 2014 14:05:00 +0100 Subject: [PATCH 21/21] sync_long: fix samples --- lib/ofdm_sync_long.cc | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/lib/ofdm_sync_long.cc b/lib/ofdm_sync_long.cc index 8dc5e59..21b6d79 100644 --- a/lib/ofdm_sync_long.cc +++ b/lib/ofdm_sync_long.cc @@ -245,25 +245,22 @@ ofdm_sync_long::make(unsigned int sync_length, bool log, bool debug) { } const std::vector ofdm_sync_long_impl::LONG = { -gr_complex( -0.04097-0.9626011), gr_complex( 0.3179976-0.8892635), gr_complex( 0.7746551+0.6623833), -gr_complex( 0.1688942+0.2230874), gr_complex( 0.4785908-0.7016541), gr_complex( -0.9210497-0.441444), -gr_complex( -0.3065277-0.8493673), gr_complex( 0.7803301-0.2071068), gr_complex( 0.4267019+0.0326106), -gr_complex( 0.0079118-0.9200371), gr_complex( -1.094439-0.379038), gr_complex( 0.1958068-0.4682544), -gr_complex( 0.4693501-0.119512), gr_complex( -0.179866+1.285259), gr_complex( 0.9539127-0.0327648), -gr_complex( 0.5-0.5), gr_complex( 0.2953435+0.7867532), gr_complex( -0.4576508+0.3143887), -gr_complex( -1.050101+0.521818), gr_complex( 0.6577466+0.7388524), gr_complex( 0.5564548+0.1129757), -gr_complex( -0.4824808+0.650289), gr_complex( -0.451641-0.1744314), gr_complex( -0.28033-1.207107), -gr_complex( -0.9750961-0.1325297), gr_complex( -1.018595-0.164011), gr_complex( 0.6005896-0.5923234), -gr_complex( -0.0224476+0.4301941), gr_complex( -0.7351004+0.9210297), gr_complex( 0.7337324+0.8469733), -gr_complex( 0.0982767+0.7807964), gr_complex( -1.25+0), gr_complex( 0.0982767-0.7807964), -gr_complex( 0.7337324-0.8469733), gr_complex( -0.7351004-0.9210297), gr_complex( -0.0224476-0.4301941), -gr_complex( 0.6005896+0.5923234), gr_complex( -1.018595+0.164011), gr_complex( -0.9750961+0.1325297), -gr_complex( -0.28033+1.207107), gr_complex( -0.451641+0.1744314), gr_complex( -0.4824808-0.650289), -gr_complex( 0.5564548-0.1129757), gr_complex( 0.6577466-0.7388524), gr_complex( -1.050101-0.521818), -gr_complex( -0.4576508-0.3143887), gr_complex( 0.2953435-0.7867532), gr_complex( 0.5+0.5), -gr_complex( 0.9539127+0.0327648), gr_complex( -0.179866-1.285259), gr_complex( 0.4693501+0.119512), -gr_complex( 0.1958068+0.4682544), gr_complex( -1.094439+0.379038), gr_complex( 0.0079118+0.9200371), -gr_complex( 0.4267019-0.0326106), gr_complex( 0.7803301+0.2071068), gr_complex( -0.3065277+0.8493673), -gr_complex( -0.9210497+0.441444), gr_complex( 0.4785908+0.7016541), gr_complex( 0.1688942-0.2230874), -gr_complex( 0.7746551-0.6623833), gr_complex( 0.3179976+0.8892635), gr_complex( -0.04097+0.9626011), -gr_complex( 1.25+0)}; + +gr_complex( 1.3868, 0.0000), gr_complex(-0.0455, -1.0679), gr_complex( 0.3528, -0.9865), gr_complex( 0.8594, 0.7348), +gr_complex( 0.1874, 0.2475), gr_complex( 0.5309, -0.7784), gr_complex(-1.0218, -0.4897), gr_complex(-0.3401, -0.9423), +gr_complex( 0.8657, -0.2298), gr_complex( 0.4734, 0.0362), gr_complex( 0.0088, -1.0207), gr_complex(-1.2142, -0.4205), +gr_complex( 0.2172, -0.5195), gr_complex( 0.5207, -0.1326), gr_complex(-0.1995, 1.4259), gr_complex( 1.0583, -0.0363), +gr_complex( 0.5547, -0.5547), gr_complex( 0.3277, 0.8728), gr_complex(-0.5077, 0.3488), gr_complex(-1.1650, 0.5789), +gr_complex( 0.7297, 0.8197), gr_complex( 0.6173, 0.1253), gr_complex(-0.5353, 0.7214), gr_complex(-0.5011, -0.1935), +gr_complex(-0.3110, -1.3392), gr_complex(-1.0818, -0.1470), gr_complex(-1.1300, -0.1820), gr_complex( 0.6663, -0.6571), +gr_complex(-0.0249, 0.4773), gr_complex(-0.8155, 1.0218), gr_complex( 0.8140, 0.9396), gr_complex( 0.1090, 0.8662), +gr_complex(-1.3868, 0.0000), gr_complex( 0.1090, -0.8662), gr_complex( 0.8140, -0.9396), gr_complex(-0.8155, -1.0218), +gr_complex(-0.0249, -0.4773), gr_complex( 0.6663, 0.6571), gr_complex(-1.1300, 0.1820), gr_complex(-1.0818, 0.1470), +gr_complex(-0.3110, 1.3392), gr_complex(-0.5011, 0.1935), gr_complex(-0.5353, -0.7214), gr_complex( 0.6173, -0.1253), +gr_complex( 0.7297, -0.8197), gr_complex(-1.1650, -0.5789), gr_complex(-0.5077, -0.3488), gr_complex( 0.3277, -0.8728), +gr_complex( 0.5547, 0.5547), gr_complex( 1.0583, 0.0363), gr_complex(-0.1995, -1.4259), gr_complex( 0.5207, 0.1326), +gr_complex( 0.2172, 0.5195), gr_complex(-1.2142, 0.4205), gr_complex( 0.0088, 1.0207), gr_complex( 0.4734, -0.0362), +gr_complex( 0.8657, 0.2298), gr_complex(-0.3401, 0.9423), gr_complex(-1.0218, 0.4897), gr_complex( 0.5309, 0.7784), +gr_complex( 0.1874, -0.2475), gr_complex( 0.8594, -0.7348), gr_complex( 0.3528, 0.9865), gr_complex(-0.0455, 1.0679) + +};