diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index 0359935..07a4e4f 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -52,10 +52,18 @@ realtime_scheduling + + thread_safe_setters + + alias + + comment + + _coordinate (7, 4) @@ -65,33 +73,6 @@ 0 - - variable - - id - samp_rate - - - _enabled - True - - - value - 20000000 - - - alias - - - - _coordinate - (179, 4) - - - _rotation - 0 - - variable @@ -110,9 +91,13 @@ alias + + comment + + _coordinate - (272, 3) + (176, 11) _rotation @@ -157,6 +142,10 @@ maxoutbuf 0 + + comment + + _coordinate (416, 139) @@ -200,6 +189,10 @@ maxoutbuf 0 + + comment + + _coordinate (136, 635) @@ -209,49 +202,6 @@ 0 - - ieee802_11_ofdm_parse_mac - - id - ieee802_11_ofdm_parse_mac_0 - - - _enabled - True - - - log - True - - - debug - True - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (104, 251) - - - _rotation - 180 - - blocks_message_strobe @@ -286,6 +236,10 @@ maxoutbuf 0 + + comment + + _coordinate (48, 131) @@ -295,53 +249,6 @@ 0 - - variable_static_text - - id - snr_text - - - _enabled - True - - - label - SNR - - - value - str(snr) - - - converver - str_converter - - - formatter - None - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (515, 8) - - - _rotation - 0 - - variable_slider @@ -392,6 +299,10 @@ alias + + comment + + _coordinate (656, 11) @@ -401,80 +312,6 @@ 0 - - import - - id - import_0 - - - _enabled - True - - - import - import math - - - alias - - - - _coordinate - (376, 3) - - - _rotation - 0 - - - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - (10**(snr/10.0))**.5 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (440, 427) - - - _rotation - 0 - - wxgui_numbersink2 @@ -561,6 +398,10 @@ affinity + + comment + + _coordinate (552, 555) @@ -604,6 +445,10 @@ maxoutbuf 0 + + comment + + _coordinate (688, 195) @@ -651,6 +496,10 @@ affinity + + comment + + _coordinate (896, 187) @@ -710,6 +559,10 @@ alias + + comment + + _coordinate (1064, 11) @@ -765,6 +618,10 @@ alias + + comment + + _coordinate (888, 11) @@ -774,203 +631,6 @@ 0 - - variable_chooser - - id - chan_est - - - _enabled - True - - - label - - - - value - 1 - - - choices - [0, 1] - - - labels - ["LMS", "Linear Comb"] - - - type - radio_buttons - - - style - wx.RA_HORIZONTAL - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (1056, 267) - - - _rotation - 0 - - - - wxgui_scopesink2 - - id - wxgui_scopesink2_0 - - - _enabled - True - - - type - complex - - - title - Scope Plot - - - samp_rate - pdu_length*8.0/24/interval - - - v_scale - 0 - - - v_offset - 0 - - - t_scale - 0 - - - ac_couple - False - - - xy_mode - True - - - num_inputs - 1 - - - win_size - - - - grid_pos - - - - notebook - - - - trig_mode - wxgui.TRIG_MODE_AUTO - - - y_axis_label - Counts - - - alias - - - - affinity - - - - _coordinate - (168, 499) - - - _rotation - 0 - - - - channels_channel_model - - id - channels_channel_model_0 - - - _enabled - True - - - noise_voltage - .5**.5 - - - freq_offset - freq_offset - - - epsilon - 1.0 - - - taps - 1.0 - - - seed - 0 - - - block_tags - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (632, 395) - - - _rotation - 0 - - variable_slider @@ -1021,6 +681,10 @@ alias + + comment + + _coordinate (776, 11) @@ -1030,6 +694,210 @@ 0 + + variable_chooser + + id + chan_est + + + _enabled + True + + + label + + + + value + 1 + + + choices + [0, 1] + + + labels + ["LMS", "Linear Comb"] + + + type + radio_buttons + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + comment + + + + _coordinate + (496, 11) + + + _rotation + 0 + + + + import + + id + import_0 + + + _enabled + True + + + import + import math + + + alias + + + + comment + + + + _coordinate + (280, 11) + + + _rotation + 0 + + + + blocks_multiply_const_vxx + + id + blocks_multiply_const_vxx_0 + + + _enabled + True + + + type + complex + + + const + (10**(snr/10.0))**.5 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (440, 427) + + + _rotation + 0 + + + + channels_channel_model + + id + channels_channel_model_0 + + + _enabled + True + + + noise_voltage + .5**.5 + + + freq_offset + freq_offset + + + epsilon + 1.0 + + + taps + 1.0 + + + seed + 0 + + + block_tags + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (664, 395) + + + _rotation + 0 + + variable_slider @@ -1081,63 +949,12 @@ - _coordinate - (1088, 147) - - - _rotation - 0 - - - - foo_packet_pad2 - - id - foo_packet_pad2_0 - - - _enabled - True - - - debug - False - - - delay - False - - - delay_sec - 0.001 - - - pad_front - 997 - - - pad_tail - 0 - - - alias + comment - - affinity - - - - minoutbuf - out_buf_size - - - maxoutbuf - 0 - _coordinate - (272, 395) + (376, 11) _rotation @@ -1178,15 +995,212 @@ maxoutbuf 0 + + comment + + _coordinate - (384, 264) + (384, 272) _rotation 180 + + ieee802_11_ofdm_parse_mac + + id + ieee802_11_ofdm_parse_mac_0 + + + _enabled + True + + + log + False + + + debug + True + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (112, 259) + + + _rotation + 180 + + + + foo_packet_pad2 + + id + foo_packet_pad2_0 + + + _enabled + True + + + debug + False + + + delay + False + + + delay_sec + 0.001 + + + pad_front + 500 + + + pad_tail + 497 + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (272, 395) + + + _rotation + 0 + + + + wxgui_scopesink2 + + id + wxgui_scopesink2_0 + + + _enabled + True + + + type + complex + + + title + Scope Plot + + + samp_rate + 12500 + + + v_scale + 0 + + + v_offset + 0 + + + t_scale + 0 + + + ac_couple + False + + + xy_mode + True + + + num_inputs + 1 + + + win_size + + + + grid_pos + + + + notebook + + + + trig_mode + wxgui.TRIG_MODE_AUTO + + + y_axis_label + Counts + + + alias + + + + affinity + + + + comment + + + + _coordinate + (152, 515) + + + _rotation + 0 + + wifi_phy_hier_0 ieee802_11_ofdm_parse_mac_0 @@ -1205,12 +1219,6 @@ 0 0 - - wifi_phy_hier_0 - ieee802_11_ofdm_mac_0 - mac_out - phy in - ieee802_11_ofdm_mac_0 wifi_phy_hier_0 diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index 0546b04..d470179 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -52,10 +52,18 @@ realtime_scheduling + + thread_safe_setters + + alias + + comment + + _coordinate (10, 10) @@ -83,6 +91,10 @@ alias + + comment + + _coordinate (488, 11) @@ -110,6 +122,10 @@ alias + + comment + + _coordinate (296, 11) @@ -137,6 +153,10 @@ alias + + comment + + _coordinate (196, 14) @@ -164,6 +184,10 @@ alias + + comment + + _coordinate (648, 11) @@ -223,6 +247,10 @@ maxoutbuf 0 + + comment + + _coordinate (1009, 908) @@ -262,6 +290,10 @@ optional False + + comment + + _coordinate (390, 130) @@ -305,6 +337,10 @@ maxoutbuf 0 + + comment + + _coordinate (283, 932) @@ -348,6 +384,10 @@ maxoutbuf 0 + + comment + + _coordinate (135, 123) @@ -387,6 +427,10 @@ alias + + comment + + _coordinate (400, 11) @@ -426,6 +470,10 @@ alias + + comment + + _coordinate (760, 11) @@ -465,6 +513,10 @@ optional False + + comment + + _coordinate (69, 940) @@ -520,6 +572,10 @@ maxoutbuf 0 + + comment + + _coordinate (752, 248) @@ -555,6 +611,10 @@ maxoutbuf 0 + + comment + + _coordinate (504, 280) @@ -610,6 +670,10 @@ maxoutbuf 0 + + comment + + _coordinate (504, 203) @@ -653,6 +717,10 @@ maxoutbuf 0 + + comment + + _coordinate (232, 203) @@ -712,6 +780,10 @@ maxoutbuf 0 + + comment + + _coordinate (1008, 219) @@ -763,6 +835,10 @@ maxoutbuf 0 + + comment + + _coordinate (704, 371) @@ -802,6 +878,10 @@ optional False + + comment + + _coordinate (472, 387) @@ -861,6 +941,10 @@ maxoutbuf 0 + + comment + + _coordinate (1008, 355) @@ -900,6 +984,10 @@ maxoutbuf 0 + + comment + + _coordinate (600, 520) @@ -935,6 +1023,10 @@ maxoutbuf 0 + + comment + + _coordinate (384, 608) @@ -986,6 +1078,10 @@ maxoutbuf 0 + + comment + + _coordinate (232, 603) @@ -1033,6 +1129,10 @@ maxoutbuf 0 + + comment + + _coordinate (608, 576) @@ -1072,6 +1172,10 @@ maxoutbuf 0 + + comment + + _coordinate (976, 592) @@ -1111,6 +1215,10 @@ optional False + + comment + + _coordinate (56, 515) @@ -1154,6 +1262,10 @@ maxoutbuf 0 + + comment + + _coordinate (880, 515) @@ -1205,6 +1317,10 @@ maxoutbuf 0 + + comment + + _coordinate (440, 803) @@ -1252,6 +1368,10 @@ maxoutbuf 0 + + comment + + _coordinate (1000, 787) @@ -1261,45 +1381,6 @@ 0 - - pad_sink - - id - pad_sink_1 - - - _enabled - True - - - label - carriers - - - type - complex - - - vlen - 1 - - - num_streams - 1 - - - optional - True - - - _coordinate - (176, 867) - - - _rotation - 180 - - blocks_vector_to_stream @@ -1338,6 +1419,10 @@ maxoutbuf 0 + + comment + + _coordinate (312, 867) @@ -1381,6 +1466,10 @@ maxoutbuf 0 + + comment + + _coordinate (768, 587) @@ -1428,6 +1517,10 @@ maxoutbuf 0 + + comment + + _coordinate (1128, 672) @@ -1479,6 +1572,10 @@ maxoutbuf 0 + + comment + + _coordinate (152, 744) @@ -1526,6 +1623,10 @@ maxoutbuf 0 + + comment + + _coordinate (656, 771) @@ -1569,6 +1670,10 @@ maxoutbuf 0 + + comment + + _coordinate (752, 931) @@ -1612,6 +1717,10 @@ maxoutbuf 0 + + comment + + _coordinate (525, 932) @@ -1621,6 +1730,49 @@ 180 + + pad_sink + + id + pad_sink_1 + + + _enabled + True + + + label + carrier + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + comment + + + + _coordinate + (176, 867) + + + _rotation + 180 + + pad_source_1 ieee802_11_ofdm_mapper_0 diff --git a/examples/wifi_tx.grc b/examples/wifi_tx.grc index d554b58..2f6d141 100644 --- a/examples/wifi_tx.grc +++ b/examples/wifi_tx.grc @@ -1,4 +1,5 @@ + Fri Apr 17 13:08:32 2015 @@ -51,10 +52,18 @@ realtime_scheduling + + thread_safe_setters + + alias + + comment + + _coordinate (56, 8) @@ -64,33 +73,6 @@ 0 - - variable - - id - out_buf_size - - - _enabled - True - - - value - 96000 - - - alias - - - - _coordinate - (996, 388) - - - _rotation - 0 - - variable @@ -109,6 +91,10 @@ alias + + comment + + _coordinate (873, 157) @@ -118,6 +104,37 @@ 0 + + variable + + id + out_buf_size + + + _enabled + True + + + value + 96000 + + + alias + + + + comment + + + + _coordinate + (996, 388) + + + _rotation + 0 + + variable_chooser @@ -164,6 +181,10 @@ alias + + comment + + _coordinate (780, 17) @@ -211,6 +232,10 @@ maxoutbuf 0 + + comment + + _coordinate (446, 187) @@ -254,6 +279,10 @@ maxoutbuf 0 + + comment + + _coordinate (81, 135) @@ -309,6 +338,10 @@ maxoutbuf 0 + + comment + + _coordinate (177, 222) @@ -364,6 +397,10 @@ alias + + comment + + _coordinate (629, 14) @@ -419,6 +456,10 @@ alias + + comment + + _coordinate (428, 10) @@ -478,6 +519,10 @@ alias + + comment + + _coordinate (982, 130) @@ -487,116 +532,6 @@ 0 - - foo_packet_pad2 - - id - foo_packet_pad2_0 - - - _enabled - True - - - debug - False - - - delay - False - - - delay_sec - 0.01 - - - pad_front - 100 - - - pad_tail - 1000 - - - alias - - - - affinity - - - - minoutbuf - out_buf_size - - - maxoutbuf - 0 - - - _coordinate - (84, 444) - - - _rotation - 0 - - - - variable_chooser - - id - lo_offset - - - _enabled - True - - - label - LO Offset - - - value - 0e9 - - - choices - [0, 6e9, 11e9] - - - labels - ['0 MHz', '6 MHz', '11 MHz'] - - - type - drop_down - - - style - wx.RA_HORIZONTAL - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (915, 461) - - - _rotation - 0 - - variable_slider @@ -647,6 +582,10 @@ alias + + comment + + _coordinate (980, 10) @@ -706,6 +645,10 @@ alias + + comment + + _coordinate (972, 264) @@ -715,57 +658,6 @@ 0 - - blocks_null_source - - id - blocks_null_source_0 - - - _enabled - True - - - type - complex - - - vlen - 1 - - - num_outputs - 1 - - - bus_conns - [[0,],] - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (733, 333) - - - _rotation - 180 - - variable_slider @@ -816,6 +708,10 @@ alias + + comment + + _coordinate (292, 12) @@ -825,6 +721,206 @@ 0 + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + encoding + + + chan_est + 0 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (461, 299) + + + _rotation + 180 + + + + blocks_null_sink + + id + blocks_null_sink_0 + + + _enabled + True + + + type + complex + + + vlen + 1 + + + num_inputs + 1 + + + bus_conns + [[0,],] + + + alias + + + + affinity + + + + comment + + + + _coordinate + (285, 333) + + + _rotation + 180 + + + + blocks_multiply_const_vxx + + id + blocks_multiply_const_vxx_0 + + + _enabled + True + + + type + complex + + + const + mult + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 100000 + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (89, 363) + + + _rotation + 180 + + + + blocks_null_source + + id + blocks_null_source_0 + + + _enabled + True + + + type + complex + + + vlen + 1 + + + num_outputs + 1 + + + bus_conns + [[0,],] + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (672, 344) + + + _rotation + 180 + + uhd_usrp_sink @@ -977,12 +1073,16 @@ center_freq0 - uhd.tune_request(freq - lo_offset, lo_offset) + uhd.tune_request(freq, rf_freq = freq - lo_offset, rf_freq_policy=uhd.tune_request.POLICY_MANUAL) gain0 tx_gain + + norm_gain0 + False + ant0 antenna @@ -999,6 +1099,10 @@ gain1 0 + + norm_gain1 + False + ant1 @@ -1015,6 +1119,10 @@ gain2 0 + + norm_gain2 + False + ant2 @@ -1031,6 +1139,10 @@ gain3 0 + + norm_gain3 + False + ant3 @@ -1047,6 +1159,10 @@ gain4 0 + + norm_gain4 + False + ant4 @@ -1063,6 +1179,10 @@ gain5 0 + + norm_gain5 + False + ant5 @@ -1079,6 +1199,10 @@ gain6 0 + + norm_gain6 + False + ant6 @@ -1095,6 +1219,10 @@ gain7 0 + + norm_gain7 + False + ant7 @@ -1111,6 +1239,10 @@ gain8 0 + + norm_gain8 + False + ant8 @@ -1127,6 +1259,10 @@ gain9 0 + + norm_gain9 + False + ant9 @@ -1143,6 +1279,10 @@ gain10 0 + + norm_gain10 + False + ant10 @@ -1159,6 +1299,10 @@ gain11 0 + + norm_gain11 + False + ant11 @@ -1175,6 +1319,10 @@ gain12 0 + + norm_gain12 + False + ant12 @@ -1191,6 +1339,10 @@ gain13 0 + + norm_gain13 + False + ant13 @@ -1207,6 +1359,10 @@ gain14 0 + + norm_gain14 + False + ant14 @@ -1223,6 +1379,10 @@ gain15 0 + + norm_gain15 + False + ant15 @@ -1239,6 +1399,10 @@ gain16 0 + + norm_gain16 + False + ant16 @@ -1255,6 +1419,10 @@ gain17 0 + + norm_gain17 + False + ant17 @@ -1271,6 +1439,10 @@ gain18 0 + + norm_gain18 + False + ant18 @@ -1287,6 +1459,10 @@ gain19 0 + + norm_gain19 + False + ant19 @@ -1303,6 +1479,10 @@ gain20 0 + + norm_gain20 + False + ant20 @@ -1319,6 +1499,10 @@ gain21 0 + + norm_gain21 + False + ant21 @@ -1335,6 +1519,10 @@ gain22 0 + + norm_gain22 + False + ant22 @@ -1351,6 +1539,10 @@ gain23 0 + + norm_gain23 + False + ant23 @@ -1367,6 +1559,10 @@ gain24 0 + + norm_gain24 + False + ant24 @@ -1383,6 +1579,10 @@ gain25 0 + + norm_gain25 + False + ant25 @@ -1399,6 +1599,10 @@ gain26 0 + + norm_gain26 + False + ant26 @@ -1415,6 +1619,10 @@ gain27 0 + + norm_gain27 + False + ant27 @@ -1431,6 +1639,10 @@ gain28 0 + + norm_gain28 + False + ant28 @@ -1447,6 +1659,10 @@ gain29 0 + + norm_gain29 + False + ant29 @@ -1463,6 +1679,10 @@ gain30 0 + + norm_gain30 + False + ant30 @@ -1479,6 +1699,10 @@ gain31 0 + + norm_gain31 + False + ant31 @@ -1499,9 +1723,13 @@ affinity + + comment + + _coordinate - (270, 444) + (272, 435) _rotation @@ -1509,22 +1737,34 @@ - wifi_phy_hier + foo_packet_pad2 id - wifi_phy_hier_0 + foo_packet_pad2_0 _enabled True - encoding - encoding + debug + False - chan_est - 0 + delay + False + + + delay_sec + 0.01 + + + pad_front + 100 + + + pad_tail + 1000 alias @@ -1536,109 +1776,82 @@ minoutbuf - 0 + out_buf_size maxoutbuf 0 + + comment + + _coordinate - (461, 299) + (88, 459) _rotation - 180 + 0 - blocks_null_sink + variable_chooser id - blocks_null_sink_0 + lo_offset _enabled True - type - complex + label + LO Offset - vlen - 1 - - - num_inputs - 1 - - - bus_conns - [[0,],] - - - alias - - - - affinity - - - - _coordinate - (285, 333) - - - _rotation - 180 - - - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - mult - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 100000 - - - maxoutbuf + value 0 + + choices + [0, 6e6, 11e6] + + + labels + ['0 MHz', '6 MHz', '11 MHz'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + comment + + _coordinate - (89, 363) + (915, 461) _rotation - 180 + 0 diff --git a/grc/ieee802_11_ofdm_preamble.xml b/grc/ieee802_11_ofdm_preamble.xml deleted file mode 100644 index 6d7fecb..0000000 --- a/grc/ieee802_11_ofdm_preamble.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - OFDM Preamble - ieee802_11_ofdm_preamble - IEEE802.11 - import ieee802_11 - ieee802_11.ofdm_preamble($debug) - - - Debug - debug - False - bool - - - - - - - in - complex - 1 - - - - out - complex - 1 - - - diff --git a/include/ieee802-11/CMakeLists.txt b/include/ieee802-11/CMakeLists.txt index 8f1e454..3c27fd6 100644 --- a/include/ieee802-11/CMakeLists.txt +++ b/include/ieee802-11/CMakeLists.txt @@ -77,7 +77,6 @@ list(APPEND include_sources ofdm_mac.h ofdm_mapper.h ofdm_parse_mac.h - ofdm_preamble.h ofdm_sync_long.h ofdm_sync_short.h wifi_edca.h diff --git a/include/ieee802-11/ofdm_preamble.h b/include/ieee802-11/ofdm_preamble.h deleted file mode 100644 index 2f7e7d6..0000000 --- a/include/ieee802-11/ofdm_preamble.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_OFDM_PREAMBLE_H -#define INCLUDED_IEEE802_11_OFDM_PREAMBLE_H - -#include -#include - -namespace gr { -namespace ieee802_11 { - -class IEEE802_11_API ofdm_preamble : virtual public tagged_stream_block -{ -public: - - typedef boost::shared_ptr sptr; - static sptr make(bool debug = false); - -}; - -} // namespace ieee802_11 -} // namespace gr - -#endif /* INCLUDED_IEEE802_11_OFDM_PREAMBLE_H */ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 9aeec13..90edfaa 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -104,7 +104,6 @@ list(APPEND gr_ieee802_11_sources ofdm_mac.cc ofdm_mapper.cc ofdm_parse_mac.cc - ofdm_preamble.cc ofdm_sync_long.cc ofdm_sync_short.cc utils.cc diff --git a/lib/ofdm_preamble.cc b/lib/ofdm_preamble.cc deleted file mode 100644 index 11bde5e..0000000 --- a/lib/ofdm_preamble.cc +++ /dev/null @@ -1,163 +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_preamble_impl : public ofdm_preamble { - -public: -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)), - "packet_len"), - d_debug(debug) { - set_tag_propagation_policy(block::TPP_DONT); -} - -~ofdm_preamble_impl(){ -} - -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) { - - const gr_complex *in = (const gr_complex*)input_items[0]; - gr_complex *out = (gr_complex*)output_items[0]; - - std::memcpy(out, PREAMBLE, 320 * sizeof(gr_complex)); - std::memcpy(out + 320, in, ninput_items[0] * sizeof(gr_complex)); - - - int produced = ninput_items[0] + 320; - const pmt::pmt_t value = pmt::PMT_T; - const pmt::pmt_t src = pmt::string_to_symbol(alias()); - - 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); - - return produced; -} - -void insert_eob(uint64_t item) { - dout << "OFDM PAD: insert eob at: " << item << std::endl; - - 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()); -} - -private: - bool d_debug; - static gr_complex PREAMBLE[320]; -}; - -ofdm_preamble::sptr -ofdm_preamble::make(bool debug) { - return gnuradio::get_initial_sptr(new ofdm_preamble_impl(debug)); -} - -gr_complex ofdm_preamble_impl::PREAMBLE[320] = { - gr_complex( 0.2041, 0.2041), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex( 0.4082, 0.4082), gr_complex(-1.1755, 0.0208), gr_complex(-0.1196, -0.6969), gr_complex( 1.2670, -0.1123), - gr_complex( 0.8165, 0.0000), gr_complex( 1.2670, -0.1123), gr_complex(-0.1196, -0.6969), gr_complex(-1.1755, 0.0208), - gr_complex( 0.4082, 0.4082), gr_complex( 0.0208, -1.1755), gr_complex(-0.6969, -0.1196), gr_complex(-0.1123, 1.2670), - gr_complex( 0.0000, 0.8165), gr_complex(-0.1123, 1.2670), gr_complex(-0.6969, -0.1196), gr_complex( 0.0208, -1.1755), - gr_complex(-0.4893, 0.2041), 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), - 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), - 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) - }; diff --git a/swig/ieee802_11_swig.i b/swig/ieee802_11_swig.i index e462598..3ffd789 100644 --- a/swig/ieee802_11_swig.i +++ b/swig/ieee802_11_swig.i @@ -34,7 +34,6 @@ #include "ieee802-11/ofdm_mac.h" #include "ieee802-11/ofdm_mapper.h" #include "ieee802-11/ofdm_parse_mac.h" -#include "ieee802-11/ofdm_preamble.h" #include "ieee802-11/ofdm_sync_long.h" #include "ieee802-11/ofdm_sync_short.h" #include "ieee802-11/wifi_edca.h" @@ -53,7 +52,6 @@ %include "ieee802-11/ofdm_mac.h" %include "ieee802-11/ofdm_mapper.h" %include "ieee802-11/ofdm_parse_mac.h" -%include "ieee802-11/ofdm_preamble.h" %include "ieee802-11/ofdm_sync_long.h" %include "ieee802-11/ofdm_sync_short.h" %include "ieee802-11/wifi_edca.h" @@ -69,7 +67,6 @@ GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_equalize_symbols); 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_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, wifi_edca);