From 32f1e979bbc74b9a8ee80b5c21b97e106fbc15c7 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 20 Mar 2015 16:08:11 +0100 Subject: [PATCH 01/38] add manifest --- MANIFEST.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 MANIFEST.md diff --git a/MANIFEST.md b/MANIFEST.md new file mode 100644 index 0000000..a65e65f --- /dev/null +++ b/MANIFEST.md @@ -0,0 +1,17 @@ +brief: An IEEE 802.11 a/g/p Transceiver +author: + - Bastian Bloessl +copyright_owner: + - Bastian Bloessl +dependencies: + - gnuradio (>= 3.7.4) +repo: https://github.com/bastibl/gr-ieee802-11.git +tags: + - IEEE 802.11 + - WiFi + - OFDM +website: http://www.ccs-labs.org/projects/wime/ +title: IEEE 802.11 a/g/p +icon: http://www.ccs-labs.org/projects/wime/wime.png +--- +This an IEEE 802.11 a/g/p transceiver for GNU Radio v3.7. Over the air, I tested it with the Ettus USRP N210 with XCVR2450 and CBX daughterboards. For interoperability tests I use mainly an Atheros (ath5k) WiFi card. The code can also be used for packet error rate simulations. From 40d7a9065713c7e084c7216d730824c15fdde80c Mon Sep 17 00:00:00 2001 From: Michael Dickens Date: Sat, 21 Mar 2015 10:17:23 -0400 Subject: [PATCH 02/38] cmake: add logging --- CMakeLists.txt | 9 ++++++ cmake/Modules/FindLog4cpp.cmake | 53 +++++++++++++++++++++++++++++++++ lib/CMakeLists.txt | 1 + 3 files changed, 63 insertions(+) create mode 100644 cmake/Modules/FindLog4cpp.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 6db9c4e..520d3b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,13 @@ if(NOT ITPP_FOUND) message(FATAL_ERROR "ITPP required to compile ieee802-11") endif() +######################################################################## +# Setup logging options +######################################################################## + +include(GrMiscUtils) +GR_LOGGING() + ######################################################################## # On Apple only, set install name and use rpath correctly, if not already set ######################################################################## @@ -128,12 +135,14 @@ include_directories( ${CPPUNIT_INCLUDE_DIRS} ${ITPP_INCLUDE_DIR} ${GNURADIO_RUNTIME_INCLUDE_DIRS} + ${LOG4CPP_INCLUDE_DIRS} ) link_directories( ${Boost_LIBRARY_DIRS} ${CPPUNIT_LIBRARY_DIRS} ${GNURADIO_RUNTIME_LIBRARY_DIRS} + ${LOG4CPP_LIBRARY_DIRS} ) ######################################################################## diff --git a/cmake/Modules/FindLog4cpp.cmake b/cmake/Modules/FindLog4cpp.cmake new file mode 100644 index 0000000..fc314c6 --- /dev/null +++ b/cmake/Modules/FindLog4cpp.cmake @@ -0,0 +1,53 @@ +# - Find Log4cpp +# Find the native LOG4CPP includes and library +# +# LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. +# LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP. +# LOG4CPP_FOUND - True if LOG4CPP found. + + +if (LOG4CPP_INCLUDE_DIR) + # Already in cache, be silent + set(LOG4CPP_FIND_QUIETLY TRUE) +endif () + +find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh + /opt/local/include + /usr/local/include + /usr/include +) + +set(LOG4CPP_NAMES log4cpp) +find_library(LOG4CPP_LIBRARY + NAMES ${LOG4CPP_NAMES} + PATHS /usr/lib /usr/local/lib /opt/local/lib +) + + +if (LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) + set(LOG4CPP_FOUND TRUE) + set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE) +else () + set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE) + set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) +endif () + +if (LOG4CPP_FOUND) + if (NOT LOG4CPP_FIND_QUIETLY) + message(STATUS "Found LOG4CPP: ${LOG4CPP_LIBRARIES}") + endif () +else () + if (LOG4CPP_FIND_REQUIRED) + message(STATUS "Looked for LOG4CPP libraries named ${LOG4CPPS_NAMES}.") + message(FATAL_ERROR "Could NOT find LOG4CPP library") + endif () +endif () + +mark_as_advanced( + LOG4CPP_LIBRARIES + LOG4CPP_INCLUDE_DIRS +) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index e3781c4..2a84c35 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -114,6 +114,7 @@ list(APPEND gr_ieee802_11_libs ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} ${ITPP_LIBRARIES} + ${LOG4CPP_LIBRARIES} ) add_library(gnuradio-ieee802_11 SHARED ${gr_ieee802_11_sources}) From 7d2309c16660e986304926a505df512d68b6a666 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 7 Apr 2015 15:01:45 +0200 Subject: [PATCH 03/38] manifest debugging 1/X --- MANIFEST.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST.md b/MANIFEST.md index a65e65f..838bc24 100644 --- a/MANIFEST.md +++ b/MANIFEST.md @@ -1,4 +1,4 @@ -brief: An IEEE 802.11 a/g/p Transceiver +brief: gr-ieee802-11 author: - Bastian Bloessl copyright_owner: @@ -11,7 +11,7 @@ tags: - WiFi - OFDM website: http://www.ccs-labs.org/projects/wime/ -title: IEEE 802.11 a/g/p +title: IEEE 802.11 a/g/p Transceiver icon: http://www.ccs-labs.org/projects/wime/wime.png --- This an IEEE 802.11 a/g/p transceiver for GNU Radio v3.7. Over the air, I tested it with the Ettus USRP N210 with XCVR2450 and CBX daughterboards. For interoperability tests I use mainly an Atheros (ath5k) WiFi card. The code can also be used for packet error rate simulations. From 5a58a8681441ef9d7c95cf803121a9f13aff4d8f Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Thu, 9 Apr 2015 11:28:30 +0200 Subject: [PATCH 04/38] manifest debugging 2/X --- MANIFEST.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST.md b/MANIFEST.md index 838bc24..8ffc210 100644 --- a/MANIFEST.md +++ b/MANIFEST.md @@ -1,4 +1,4 @@ -brief: gr-ieee802-11 +title: gr-ieee802-11 author: - Bastian Bloessl copyright_owner: @@ -11,7 +11,7 @@ tags: - WiFi - OFDM website: http://www.ccs-labs.org/projects/wime/ -title: IEEE 802.11 a/g/p Transceiver +brief: IEEE 802.11 a/g/p Transceiver icon: http://www.ccs-labs.org/projects/wime/wime.png --- This an IEEE 802.11 a/g/p transceiver for GNU Radio v3.7. Over the air, I tested it with the Ettus USRP N210 with XCVR2450 and CBX daughterboards. For interoperability tests I use mainly an Atheros (ath5k) WiFi card. The code can also be used for packet error rate simulations. From dbfb65e5ab649ff64a2500c490aefb35f23a8487 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 10 Apr 2015 10:57:06 +0200 Subject: [PATCH 05/38] make the output buffer size of the tx chain a variable of the block - the default buffer size is set to 96k - this allows to transmit large frames of up to 1500B using bpsk 1/2 --- examples/wifi_phy_hier.grc | 558 +++++++++++++++++++------------------ 1 file changed, 293 insertions(+), 265 deletions(-) diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index 6f00e91..29f8790 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -1,4 +1,5 @@ + Fri Jul 18 08:46:33 2014 @@ -68,7 +69,7 @@ variable id - header_formatter + window_size _enabled @@ -76,7 +77,7 @@ value - ieee802_11.wifi_signal_field() + 48 alias @@ -84,7 +85,7 @@ _coordinate - (518, 18) + (323, 14) _rotation @@ -122,7 +123,7 @@ variable id - window_size + header_formatter _enabled @@ -130,7 +131,7 @@ value - 48 + ieee802_11.wifi_signal_field() alias @@ -138,7 +139,34 @@ _coordinate - (323, 14) + (518, 18) + + + _rotation + 0 + + + + variable + + id + out_buf_size + + + _enabled + True + + + value + 96000 + + + alias + + + + _coordinate + (680, 11) _rotation @@ -1033,96 +1061,6 @@ 0 - - ieee802_11_chunks_to_symbols_xx - - id - ieee802_11_chunks_to_symbols_xx_0 - - - _enabled - True - - - alias - - - - affinity - - - - minoutbuf - 48000 - - - maxoutbuf - 0 - - - _coordinate - (499, 303) - - - _rotation - 0 - - - - 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 - - - alias - - - - affinity - - - - minoutbuf - 48000 - - - maxoutbuf - 0 - - - _coordinate - (744, 269) - - - _rotation - 0 - - pad_source @@ -1201,175 +1139,6 @@ 180 - - 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" - - - alias - - - - affinity - - - - minoutbuf - 10000 - - - maxoutbuf - 0 - - - _coordinate - (1005, 242) - - - _rotation - 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" - - - alias - - - - affinity - - - - minoutbuf - 100000 - - - maxoutbuf - 0 - - - _coordinate - (703, 411) - - - _rotation - 180 - - - - 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 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (1003, 395) - - - _rotation - 180 - - ieee802_11_moving_average_xx @@ -1468,6 +1237,265 @@ 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" + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (703, 411) + + + _rotation + 180 + + + + 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 + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (1003, 395) + + + _rotation + 180 + + + + 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" + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (1005, 242) + + + _rotation + 0 + + + + ieee802_11_chunks_to_symbols_xx + + id + ieee802_11_chunks_to_symbols_xx_0 + + + _enabled + True + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (499, 303) + + + _rotation + 0 + + + + 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 + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (744, 269) + + + _rotation + 0 + + pad_source_1 ieee802_11_ofdm_mapper_0 From f374ae415c7c94f4889535c83c65f0aa770cc221 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 10 Apr 2015 11:19:21 +0200 Subject: [PATCH 06/38] add variable to define maximum number of symbols and frame complete indication --- lib/ofdm_decode_mac.cc | 30 ++++++++++++++++++++---------- lib/ofdm_mapper.cc | 4 ++-- lib/utils.h | 2 ++ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lib/ofdm_decode_mac.cc b/lib/ofdm_decode_mac.cc index 8f2a21a..22fb428 100644 --- a/lib/ofdm_decode_mac.cc +++ b/lib/ofdm_decode_mac.cc @@ -61,6 +61,7 @@ ofdm_decode_mac_impl(bool log, bool debug) : block("ofdm_decode_mac", 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; qam64.set(cvec(QAM64_D, 64), ivec(qam64_bits, 64)); + d_frame_complete = true; } int general_work (int noutput_items, gr_vector_int& ninput_items, @@ -82,6 +83,12 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, pmt::string_to_symbol("ofdm_start")); if(tags.size()) { + if (d_frame_complete == false) { + dout << "Warning: starting to receive new frame before old frame was complete" << std::endl; + dout << "Already copied " << copied << " out of " << tx.n_sym << " symbols of last frame" << std::endl; + } + d_frame_complete = false; + pmt::pmt_t tuple = tags[0].value; int len_data = pmt::to_uint64(pmt::car(tuple)); int encoding = pmt::to_uint64(pmt::cdr(tuple)); @@ -89,19 +96,19 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, ofdm = ofdm_param((Encoding)encoding); tx = tx_param(ofdm, len_data); - copied = 0; - - // this frame is garbage - if(tx.n_sym > 100) { - // FIXME: make this nicer, this way garbage frames are skipped - copied = tx.n_sym + 1; + // sanity check, more than MAX_NUM_SYM may indicate garbage + if(tx.n_sym < MAX_NUM_SYM) { + copied = 0; + dout << "Decode MAC: frame start -- len " << len_data + << " symbols " << tx.n_sym << " encoding " + << encoding << std::endl; + } else { + dout << "Dropping frame with " << tx.n_sym << " symbols, maximum number of symbols is " << MAX_NUM_SYM << std::endl; } - dout << "Decode MAC: frame start -- len " << len_data - << " symbols " << tx.n_sym << " encoding " - << encoding << std::endl; } if(copied < tx.n_sym) { + dout << "copy one symbol, copied " << copied << " out of " << tx.n_sym << std::endl; std::memcpy(sym + (copied * 48), in, 48 * sizeof(gr_complex)); copied++; @@ -110,6 +117,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, decode(); in += 48; i++; + d_frame_complete = true; break; } } @@ -300,12 +308,14 @@ private: double deinter[1000 * 48]; char out_bits[40000]; char out_bytes[40000]; - bvec decoded_bits; + bvec decoded_bits; bool d_debug; bool d_log; + tx_param tx; ofdm_param ofdm; int copied; + bool d_frame_complete; Modulator > bpsk; Modulator > qpsk; diff --git a/lib/ofdm_mapper.cc b/lib/ofdm_mapper.cc index ebf0175..a721086 100644 --- a/lib/ofdm_mapper.cc +++ b/lib/ofdm_mapper.cc @@ -82,8 +82,8 @@ 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" < MAX_NUM_SYM) { + std::cout << "packet too large, maximum number of symbols is " << MAX_NUM_SYM << std::endl; return 0; } diff --git a/lib/utils.h b/lib/utils.h index 69269ae..5bd1eb7 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -23,6 +23,8 @@ #include #include +#define MAX_NUM_SYM 520 // this should be enough to transmit 1500B user payload with BPSK 1/2 + #define dout d_debug && std::cout #if defined(HAVE_LOG4CPP) && defined(ENABLE_GR_LOG) From cb4dc5e3fab4320f32d343abcba4275565850c53 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 10 Apr 2015 11:21:21 +0200 Subject: [PATCH 07/38] adding slider to flowgraph to increase PDU size dynamically --- examples/wifi_loopback.grc | 751 +++++++++++++++++++++---------------- 1 file changed, 432 insertions(+), 319 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index c95b6f8..90b3bfc 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -1,5 +1,5 @@ - + Sat Feb 1 18:28:19 2014 @@ -65,6 +65,33 @@ 0 + + variable + + id + variable_0 + + + _enabled + True + + + value + 0 + + + alias + + + + _coordinate + (952, 384) + + + _rotation + 0 + + variable @@ -92,6 +119,33 @@ 0 + + variable + + id + out_buf_size + + + _enabled + True + + + value + 96000 + + + alias + + + + _coordinate + (1136, 147) + + + _rotation + 0 + + variable_chooser @@ -233,65 +287,6 @@ 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 - - - - alias - - - - _coordinate - (947, 7) - - - _rotation - 0 - - blocks_add_xx @@ -378,96 +373,6 @@ 180 - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - src_mac - [0x23, 0x23, 0x23, 0x23, 0x23, 0x23] - - - dst_mac - [0x42, 0x42, 0x42, 0x42, 0x42, 0x42] - - - bss_mac - [0xff, 0xff, 0xff, 0xff, 0xff, 0xff] - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (376, 139) - - - _rotation - 0 - - - - blocks_message_strobe - - id - blocks_message_strobe_0 - - - _enabled - True - - - msg - pmt.intern("Hello World!") - - - period - 300 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (96, 131) - - - _rotation - 0 - - ieee802_11_ofdm_parse_mac @@ -503,96 +408,6 @@ 180 - - foo_wireshark_connector - - id - foo_wireshark_connector_0 - - - _enabled - False - - - tech - 127 - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (632, 163) - - - _rotation - 0 - - - - blocks_file_sink - - id - blocks_file_sink_0 - - - _enabled - False - - - file - /tmp/ofdm.bin - - - type - byte - - - vlen - 1 - - - unbuffered - True - - - append - False - - - alias - - - - affinity - - - - _coordinate - (848, 155) - - - _rotation - 0 - - blocks_multiply_xx @@ -640,61 +455,6 @@ 0 - - foo_packet_pad2 - - id - foo_packet_pad2_0 - - - _enabled - True - - - debug - False - - - delay - False - - - delay_sec - 0.001 - - - pad_front - 10000 - - - pad_tail - 10000 - - - alias - - - - affinity - - - - minoutbuf - 48000 - - - maxoutbuf - 0 - - - _coordinate - (320, 395) - - - _rotation - 0 - - analog_sig_source_x @@ -958,12 +718,359 @@ 0 - - foo_wireshark_connector_0 - blocks_file_sink_0 - 0 - 0 - + + foo_wireshark_connector + + id + foo_wireshark_connector_0 + + + _enabled + False + + + tech + 127 + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (696, 155) + + + _rotation + 0 + + + + blocks_file_sink + + id + blocks_file_sink_0 + + + _enabled + False + + + file + /tmp/ofdm.bin + + + type + byte + + + vlen + 1 + + + unbuffered + True + + + append + False + + + alias + + + + affinity + + + + _coordinate + (888, 155) + + + _rotation + 0 + + + + ieee802_11_ofdm_mac + + id + ieee802_11_ofdm_mac_0 + + + _enabled + True + + + src_mac + [0x23, 0x23, 0x23, 0x23, 0x23, 0x23] + + + dst_mac + [0x42, 0x42, 0x42, 0x42, 0x42, 0x42] + + + bss_mac + [0xff, 0xff, 0xff, 0xff, 0xff, 0xff] + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (416, 139) + + + _rotation + 0 + + + + foo_packet_pad2 + + id + foo_packet_pad2_0 + + + _enabled + True + + + debug + False + + + delay + False + + + delay_sec + 0.001 + + + pad_front + 10000 + + + pad_tail + 10000 + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (320, 395) + + + _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 + + + + alias + + + + _coordinate + (947, 7) + + + _rotation + 0 + + + + variable_slider + + id + pdu_length + + + _enabled + True + + + label + + + + value + 500 + + + min + 0 + + + max + 1500 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (1120, 227) + + + _rotation + 0 + + + + blocks_message_strobe + + id + blocks_message_strobe_0 + + + _enabled + True + + + msg + pmt.intern("".join("x" for i in range(pdu_length))) + + + period + 300 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (48, 131) + + + _rotation + 0 + + analog_sig_source_x_0 blocks_multiply_xx_0 @@ -988,30 +1095,12 @@ 0 0 - - 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 - ieee802_11_ofdm_mac_0 - mac_out - phy in - wifi_phy_hier_0 ieee802_11_ofdm_parse_mac_0 @@ -1036,4 +1125,28 @@ 0 0 + + 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 + + + ieee802_11_ofdm_mac_0 + foo_wireshark_connector_0 + phy out + in + + + foo_wireshark_connector_0 + blocks_file_sink_0 + 0 + 0 + From ea71ceb4fe19dff236b1e67ecf6a0b62fda6561d Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Sat, 11 Apr 2015 09:44:35 +0200 Subject: [PATCH 08/38] equalizer: fix pilot pattern --- lib/ofdm_equalize_symbols.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ofdm_equalize_symbols.cc b/lib/ofdm_equalize_symbols.cc index 335d3bc..a755d86 100644 --- a/lib/ofdm_equalize_symbols.cc +++ b/lib/ofdm_equalize_symbols.cc @@ -62,6 +62,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, gr_complex p = POLARITY[index]; index++; + index %= 127; // FIXME: think about this... average over amplitude or power double avg_mag = (abs(in[11]) + abs(in[25]) + abs(in[39]) + abs(in[53])) / 4; From 297a0d8bc394bd7e35ab0ea8a2062a0e706a056b Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Sat, 11 Apr 2015 09:46:57 +0200 Subject: [PATCH 09/38] phy: pipe more samples into the flow graph --- examples/wifi_phy_hier.grc | 178 ++++++++++++++++++------------------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index 29f8790..35b136a 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -1,5 +1,5 @@ - + Fri Jul 18 08:46:33 2014 @@ -69,7 +69,7 @@ variable id - window_size + out_buf_size _enabled @@ -77,7 +77,7 @@ value - 48 + 96000 alias @@ -85,34 +85,7 @@ _coordinate - (323, 14) - - - _rotation - 0 - - - - variable - - id - sync_length - - - _enabled - True - - - value - 320 - - - alias - - - - _coordinate - (196, 14) + (680, 11) _rotation @@ -150,7 +123,7 @@ variable id - out_buf_size + sync_length _enabled @@ -158,7 +131,7 @@ value - 96000 + 320 alias @@ -166,7 +139,34 @@ _coordinate - (680, 11) + (196, 14) + + + _rotation + 0 + + + + variable + + id + window_size + + + _enabled + True + + + value + 48 + + + alias + + + + _coordinate + (323, 14) _rotation @@ -1182,61 +1182,6 @@ 0 - - ieee802_11_ofdm_sync_short - - id - sync_short - - - _enabled - True - - - log - False - - - debug - False - - - threshold - 0.7 * 0.75 - - - max_samples - 80 * 140 - - - min_plateau - 2 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (178, 775) - - - _rotation - 0 - - digital_ofdm_cyclic_prefixer @@ -1496,6 +1441,61 @@ 0 + + ieee802_11_ofdm_sync_short + + id + sync_short + + + _enabled + True + + + log + False + + + debug + False + + + threshold + 0.7 * 0.75 + + + max_samples + 80 * 550 + + + min_plateau + 2 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (178, 775) + + + _rotation + 0 + + pad_source_1 ieee802_11_ofdm_mapper_0 From 0d99a05f5af8fdd5bf7345e64ac4c66ac7b6f2cd Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Sat, 11 Apr 2015 09:47:11 +0200 Subject: [PATCH 10/38] loopback: less padding --- examples/wifi_loopback.grc | 124 ++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index 90b3bfc..7b15056 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -1,5 +1,5 @@ - + Sat Feb 1 18:28:19 2014 @@ -69,7 +69,7 @@ variable id - variable_0 + out_buf_size _enabled @@ -77,7 +77,7 @@ value - 0 + 96000 alias @@ -85,7 +85,7 @@ _coordinate - (952, 384) + (1136, 147) _rotation @@ -123,7 +123,7 @@ variable id - out_buf_size + variable_0 _enabled @@ -131,7 +131,7 @@ value - 96000 + 0 alias @@ -139,7 +139,7 @@ _coordinate - (1136, 147) + (952, 384) _rotation @@ -855,61 +855,6 @@ 0 - - foo_packet_pad2 - - id - foo_packet_pad2_0 - - - _enabled - True - - - debug - False - - - delay - False - - - delay_sec - 0.001 - - - pad_front - 10000 - - - pad_tail - 10000 - - - alias - - - - affinity - - - - minoutbuf - out_buf_size - - - maxoutbuf - 0 - - - _coordinate - (320, 395) - - - _rotation - 0 - - variable_slider @@ -1071,6 +1016,61 @@ 0 + + foo_packet_pad2 + + id + foo_packet_pad2_0 + + + _enabled + True + + + debug + False + + + delay + False + + + delay_sec + 0.001 + + + pad_front + 1000 + + + pad_tail + 1000 + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (320, 395) + + + _rotation + 0 + + analog_sig_source_x_0 blocks_multiply_xx_0 From 97e4c0ae94fe2a2ebb27d440f0ee9085646c0a10 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Sat, 11 Apr 2015 10:00:18 +0200 Subject: [PATCH 11/38] delete unused block --- grc/ieee802_11_ofdm_freq_est.xml | 54 ------------------------- include/ieee802-11/CMakeLists.txt | 1 - include/ieee802-11/ofdm_freq_est.h | 38 ------------------ lib/CMakeLists.txt | 1 - lib/ofdm_freq_est.cc | 64 ------------------------------ swig/ieee802_11_swig.i | 3 -- 6 files changed, 161 deletions(-) delete mode 100644 grc/ieee802_11_ofdm_freq_est.xml delete mode 100644 include/ieee802-11/ofdm_freq_est.h delete mode 100644 lib/ofdm_freq_est.cc diff --git a/grc/ieee802_11_ofdm_freq_est.xml b/grc/ieee802_11_ofdm_freq_est.xml deleted file mode 100644 index 3c202b1..0000000 --- a/grc/ieee802_11_ofdm_freq_est.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - OFDM Freq Est - ieee802_11_ofdm_freq_est - IEEE802.11 - import ieee802_11 - ieee802_11.ofdm_freq_est($log, $debug) - - - Log - log - False - bool - - - - - - - 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 f4492dd..f9b17af 100644 --- a/include/ieee802-11/CMakeLists.txt +++ b/include/ieee802-11/CMakeLists.txt @@ -74,7 +74,6 @@ list(APPEND include_sources ofdm_decode_mac.h ofdm_decode_signal.h ofdm_equalize_symbols.h - ofdm_freq_est.h ofdm_mac.h ofdm_mapper.h ofdm_parse_mac.h diff --git a/include/ieee802-11/ofdm_freq_est.h b/include/ieee802-11/ofdm_freq_est.h deleted file mode 100644 index b891a81..0000000 --- a/include/ieee802-11/ofdm_freq_est.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_FREQ_EST_H -#define INCLUDED_IEEE802_11_OFDM_FREQ_EST_H - -#include -#include - -namespace gr { -namespace ieee802_11 { - -class IEEE802_11_API ofdm_freq_est : virtual public block -{ -public: - - typedef boost::shared_ptr sptr; - static sptr make(bool log = false, bool debug = false); - -}; - -} // namespace ieee802_11 -} // namespace gr - -#endif /* INCLUDED_IEEE802_11_OFDM_FREQ_EST_H */ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 2a84c35..b615b10 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -99,7 +99,6 @@ list(APPEND gr_ieee802_11_sources ofdm_decode_mac.cc ofdm_decode_signal.cc ofdm_equalize_symbols.cc - ofdm_freq_est.cc ofdm_mac.cc ofdm_mapper.cc ofdm_parse_mac.cc diff --git a/lib/ofdm_freq_est.cc b/lib/ofdm_freq_est.cc deleted file mode 100644 index b45f0f1..0000000 --- a/lib/ofdm_freq_est.cc +++ /dev/null @@ -1,64 +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_freq_est_impl : public ofdm_freq_est { - -public: -ofdm_freq_est_impl(bool log, bool debug) : block("ofdm_freq_est", - gr::io_signature::make2(2, 2, sizeof(gr_complex), sizeof(gr_complex)), - gr::io_signature::make(1, 1, sizeof(gr_complex))), - d_log(log), - d_debug(debug), - d_state(SYNC) { - - set_tag_propagation_policy(block::TPP_DONT); -} - -int general_work (int noutput, 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]; - - - return 0; -} - -void forecast (int noutput_items, gr_vector_int &ninput_items_required) { - ninput_items_required[0] = noutput_items; -} - -private: - enum {SYNC, COPY, RESET} d_state; - std::vector d_tags; - - const bool d_log; - const bool d_debug; -}; - -ofdm_freq_est::sptr -ofdm_freq_est::make(bool log, bool debug) { - return gnuradio::get_initial_sptr(new ofdm_freq_est_impl(log, debug)); -} - diff --git a/swig/ieee802_11_swig.i b/swig/ieee802_11_swig.i index 4fb6f7e..02d6a9c 100644 --- a/swig/ieee802_11_swig.i +++ b/swig/ieee802_11_swig.i @@ -31,7 +31,6 @@ #include "ieee802-11/ofdm_decode_mac.h" #include "ieee802-11/ofdm_decode_signal.h" #include "ieee802-11/ofdm_equalize_symbols.h" -#include "ieee802-11/ofdm_freq_est.h" #include "ieee802-11/ofdm_mac.h" #include "ieee802-11/ofdm_mapper.h" #include "ieee802-11/ofdm_parse_mac.h" @@ -50,7 +49,6 @@ %include "ieee802-11/ofdm_decode_mac.h" %include "ieee802-11/ofdm_decode_signal.h" %include "ieee802-11/ofdm_equalize_symbols.h" -%include "ieee802-11/ofdm_freq_est.h" %include "ieee802-11/ofdm_mac.h" %include "ieee802-11/ofdm_mapper.h" %include "ieee802-11/ofdm_parse_mac.h" @@ -66,7 +64,6 @@ GR_SWIG_BLOCK_MAGIC2(ieee802_11, moving_average_ff); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_decode_mac); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_decode_signal); GR_SWIG_BLOCK_MAGIC2(ieee802_11, ofdm_equalize_symbols); -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); From 3df4fd3d31e7416f379365cf24e930e07be1f256 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 8 Apr 2015 09:24:16 +0200 Subject: [PATCH 12/38] fix whitespaces and typo --- lib/ether_encap_impl.cc | 2 +- lib/ofdm_decode_mac.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ether_encap_impl.cc b/lib/ether_encap_impl.cc index 86bebc0..aaea027 100644 --- a/lib/ether_encap_impl.cc +++ b/lib/ether_encap_impl.cc @@ -60,7 +60,7 @@ ether_encap_impl::from_wifi(pmt::pmt_t msg) { return; } - // this is more than neeed + // this is more than needed char *buf = static_cast(std::malloc(data_len + sizeof(ethernet_header))); ethernet_header *ehdr = reinterpret_cast(buf); diff --git a/lib/ofdm_decode_mac.cc b/lib/ofdm_decode_mac.cc index 22fb428..b1e750f 100644 --- a/lib/ofdm_decode_mac.cc +++ b/lib/ofdm_decode_mac.cc @@ -309,9 +309,9 @@ private: char out_bits[40000]; char out_bytes[40000]; bvec decoded_bits; - bool d_debug; - bool d_log; + bool d_debug; + bool d_log; tx_param tx; ofdm_param ofdm; int copied; From 28cbfd8c9cc94d2954658ed40a5ec4162de8c1f1 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 8 Apr 2015 09:27:40 +0200 Subject: [PATCH 13/38] ofdm_mac: add parameter to strip MAC header from incoming MPDUs --- grc/ieee802_11_ofdm_mac.xml | 18 +++++++++++++++++- include/ieee802-11/ofdm_mac.h | 3 ++- lib/ofdm_mac.cc | 23 +++++++++++++++++++---- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/grc/ieee802_11_ofdm_mac.xml b/grc/ieee802_11_ofdm_mac.xml index 4d6e48a..9bca984 100644 --- a/grc/ieee802_11_ofdm_mac.xml +++ b/grc/ieee802_11_ofdm_mac.xml @@ -5,7 +5,7 @@ ieee802_11_ofdm_mac IEEE802.11 import ieee802_11 - ieee802_11.ofdm_mac($src_mac, $dst_mac, $bss_mac) + ieee802_11.ofdm_mac($src_mac, $dst_mac, $bss_mac, $strip_header) SRC MAC @@ -28,6 +28,22 @@ int_vector + + Strip header + strip_header + False + bool + + + + + len($src_mac) == 6 len($dst_mac) == 6 len($bss_mac) == 6 diff --git a/include/ieee802-11/ofdm_mac.h b/include/ieee802-11/ofdm_mac.h index 599b91d..ea270b9 100644 --- a/include/ieee802-11/ofdm_mac.h +++ b/include/ieee802-11/ofdm_mac.h @@ -30,7 +30,8 @@ public: typedef boost::shared_ptr sptr; static sptr make(std::vector src_mac, std::vector dst_mac, - std::vector bss_mac); + std::vector bss_mac, + bool strip_header); }; } // namespace ieee802_11 diff --git a/lib/ofdm_mac.cc b/lib/ofdm_mac.cc index 6c95f0f..be90fc7 100644 --- a/lib/ofdm_mac.cc +++ b/lib/ofdm_mac.cc @@ -38,11 +38,12 @@ class ofdm_mac_impl : public ofdm_mac { public: -ofdm_mac_impl(std::vector src_mac, std::vector dst_mac, std::vector bss_mac) : +ofdm_mac_impl(std::vector src_mac, std::vector dst_mac, std::vector bss_mac, bool strip_header) : block("ofdm_mac", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), - d_seq_nr(0) { + d_seq_nr(0), + d_strip_header(strip_header) { message_port_register_out(pmt::mp("phy out")); message_port_register_out(pmt::mp("app out")); @@ -65,6 +66,19 @@ ofdm_mac_impl(std::vector src_mac, std::vector dst_mac, std::v } void phy_in (pmt::pmt_t msg) { + if (d_strip_header) { + // this must be a pair + if (!pmt::is_blob(pmt::cdr(msg))) + throw std::runtime_error("PMT must be blob"); + + // strip MAC header and only leave PHY blob + pmt::pmt_t blob(pmt::cdr(msg)); + const char *mpdu = reinterpret_cast(pmt::blob_data(blob)); + pmt::pmt_t msdu = pmt::make_blob(mpdu + 24, pmt::blob_length(blob) - 24); + + // update original msg, note that the fcs is still there + pmt::set_cdr(msg, msdu); + } message_port_pub(pmt::mp("app out"), msg); } @@ -161,10 +175,11 @@ private: uint8_t d_src_mac[6]; uint8_t d_dst_mac[6]; uint8_t d_bss_mac[6]; + bool d_strip_header; }; ofdm_mac::sptr -ofdm_mac::make(std::vector src_mac, std::vector dst_mac, std::vector bss_mac) { - return gnuradio::get_initial_sptr(new ofdm_mac_impl(src_mac, dst_mac, bss_mac)); +ofdm_mac::make(std::vector src_mac, std::vector dst_mac, std::vector bss_mac, bool strip_header) { + return gnuradio::get_initial_sptr(new ofdm_mac_impl(src_mac, dst_mac, bss_mac, strip_header)); } From 466383137fb2be87e1ef4edd4d75284657163678 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 13 Apr 2015 14:16:12 +0200 Subject: [PATCH 14/38] ofdm_parse_mac: calculate error rate based on sequence numbers --- grc/ieee802_11_ofdm_parse_mac.xml | 6 ++++++ lib/ofdm_parse_mac.cc | 34 +++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/grc/ieee802_11_ofdm_parse_mac.xml b/grc/ieee802_11_ofdm_parse_mac.xml index cb6d9c9..2ebc9a2 100644 --- a/grc/ieee802_11_ofdm_parse_mac.xml +++ b/grc/ieee802_11_ofdm_parse_mac.xml @@ -44,5 +44,11 @@ message + + fer + message + 1 + + diff --git a/lib/ofdm_parse_mac.cc b/lib/ofdm_parse_mac.cc index 98232ca..4da7b12 100644 --- a/lib/ofdm_parse_mac.cc +++ b/lib/ofdm_parse_mac.cc @@ -23,6 +23,8 @@ using namespace gr::ieee802_11; +#define FER_ALPHA 0.2f + class ofdm_parse_mac_impl : public ofdm_parse_mac { public: @@ -36,6 +38,10 @@ ofdm_parse_mac_impl(bool log, bool debug) : message_port_register_in(pmt::mp("in")); set_msg_handler(pmt::mp("in"), boost::bind(&ofdm_parse_mac_impl::parse, this, _1)); + + message_port_register_out(pmt::mp("fer")); + d_last_fer = 0.0f; + d_last_seq_no = 0; } ~ofdm_parse_mac_impl() { @@ -251,13 +257,36 @@ void parse_data(char *buf, int length) { } dout << std::endl; - dout << "seq nr: " << int(h->seq_nr >> 4) << std::endl; + int seq_no = int(h->seq_nr >> 4); + dout << "seq nr: " << seq_no << std::endl; dout << "mac 1: "; print_mac_address(h->addr1, true); dout << "mac 2: "; print_mac_address(h->addr2, true); dout << "mac 3: "; print_mac_address(h->addr3, true); + + int lost_frames = seq_no - d_last_seq_no - 1; + dout << "d_last_seq_no: " << d_last_seq_no << std::endl; + dout << "lost frames: " << lost_frames << std::endl; + + // calculate instantaneous error rate + float curr_fer = 0.0f; + if (lost_frames > 0) + curr_fer = 1 - (1 / (static_cast(lost_frames) + 1)); + dout << "instantaneous fer: " << curr_fer << std::endl; + + // update FER estimate + float fer = (1.0f - FER_ALPHA) * d_last_fer + FER_ALPHA * curr_fer; + dout << "rolling fer: " << fer << std::endl; + + // keep track of values + d_last_seq_no = seq_no; + d_last_fer = fer; + + // publish FER estimate + pmt::pmt_t pdu = pmt::make_f32vector(1, fer * 100); + message_port_pub(pmt::mp("fer"), pmt::cons( pmt::PMT_NIL, pdu )); } void parse_control(char *buf, int length) { @@ -341,7 +370,8 @@ void print_ascii(char* buf, int length) { private: bool d_log; bool d_debug; - + float d_last_fer; + int d_last_seq_no; }; ofdm_parse_mac::sptr From 8b63004420c3679e4343658ed2f2bd42dae8a42b Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Mon, 13 Apr 2015 16:32:56 +0200 Subject: [PATCH 15/38] adding FER display to loopback radio --- examples/wifi_loopback.grc | 736 ++++++++++++++++++++++++++----------- 1 file changed, 515 insertions(+), 221 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index 7b15056..6270998 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -1,5 +1,5 @@ - + Sat Feb 1 18:28:19 2014 @@ -52,10 +52,18 @@ realtime_scheduling + + thread_safe_setters + + alias + + comment + + _coordinate (7, 4) @@ -65,33 +73,6 @@ 0 - - variable - - id - out_buf_size - - - _enabled - True - - - value - 96000 - - - alias - - - - _coordinate - (1136, 147) - - - _rotation - 0 - - variable @@ -110,6 +91,10 @@ alias + + comment + + _coordinate (179, 4) @@ -123,7 +108,7 @@ variable id - variable_0 + out_buf_size _enabled @@ -131,15 +116,19 @@ value - 0 + 96000 alias + + comment + + _coordinate - (952, 384) + (1136, 147) _rotation @@ -192,6 +181,10 @@ alias + + comment + + _coordinate (1067, 10) @@ -219,6 +212,10 @@ alias + + comment + + _coordinate (422, 11) @@ -278,6 +275,10 @@ alias + + comment + + _coordinate (693, 7) @@ -325,6 +326,10 @@ maxoutbuf 0 + + comment + + _coordinate (592, 280) @@ -364,6 +369,10 @@ maxoutbuf 0 + + comment + + _coordinate (384, 264) @@ -373,41 +382,6 @@ 180 - - ieee802_11_ofdm_parse_mac - - id - ieee802_11_ofdm_parse_mac_0 - - - _enabled - True - - - log - True - - - debug - True - - - alias - - - - affinity - - - - _coordinate - (104, 251) - - - _rotation - 180 - - blocks_multiply_xx @@ -446,6 +420,10 @@ maxoutbuf 0 + + comment + + _coordinate (544, 432) @@ -505,6 +483,10 @@ maxoutbuf 0 + + comment + + _coordinate (328, 539) @@ -564,6 +546,10 @@ alias + + comment + + _coordinate (814, 8) @@ -573,53 +559,6 @@ 0 - - variable_static_text - - id - snr - - - _enabled - True - - - label - SNR - - - value - str(10 * math.log10(signal_power/noise_power)) + "dB" - - - converver - str_converter - - - formatter - None - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (515, 8) - - - _rotation - 0 - - analog_noise_source_x @@ -662,6 +601,10 @@ maxoutbuf 0 + + comment + + _coordinate (856, 259) @@ -709,6 +652,10 @@ maxoutbuf 0 + + comment + + _coordinate (696, 443) @@ -752,6 +699,10 @@ maxoutbuf 0 + + comment + + _coordinate (696, 155) @@ -799,6 +750,10 @@ affinity + + comment + + _coordinate (888, 155) @@ -846,6 +801,10 @@ maxoutbuf 0 + + comment + + _coordinate (416, 139) @@ -905,6 +864,10 @@ alias + + comment + + _coordinate (947, 7) @@ -914,108 +877,6 @@ 0 - - variable_slider - - id - pdu_length - - - _enabled - True - - - label - - - - value - 500 - - - min - 0 - - - max - 1500 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - int_converter - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (1120, 227) - - - _rotation - 0 - - - - blocks_message_strobe - - id - blocks_message_strobe_0 - - - _enabled - True - - - msg - pmt.intern("".join("x" for i in range(pdu_length))) - - - period - 300 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (48, 131) - - - _rotation - 0 - - foo_packet_pad2 @@ -1062,6 +923,10 @@ maxoutbuf 0 + + comment + + _coordinate (320, 395) @@ -1071,6 +936,423 @@ 0 + + blocks_pdu_to_tagged_stream + + id + blocks_pdu_to_tagged_stream_0 + + + _enabled + True + + + type + float + + + tag + packet_len + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (136, 635) + + + _rotation + 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 + + + comment + + + + _coordinate + (104, 251) + + + _rotation + 180 + + + + blocks_message_strobe + + id + blocks_message_strobe_0 + + + _enabled + True + + + msg + pmt.intern("".join("x" for i in range(pdu_length))) + + + period + interval + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + comment + + + + _coordinate + (48, 131) + + + _rotation + 0 + + + + variable_slider + + id + pdu_length + + + _enabled + True + + + label + + + + value + 10 + + + min + 0 + + + max + 1500 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + comment + + + + _coordinate + (1120, 227) + + + _rotation + 0 + + + + variable_slider + + id + interval + + + _enabled + True + + + label + PDU Interval (ms) + + + value + 10 + + + min + 0 + + + max + 1000 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + comment + + + + _coordinate + (1120, 355) + + + _rotation + 0 + + + + variable_static_text + + id + snr + + + _enabled + True + + + label + SNR + + + value + str(10 * math.log10(signal_power/noise_power)) + "dB" + + + converver + str_converter + + + formatter + None + + + grid_pos + + + + notebook + + + + alias + + + + comment + + + + _coordinate + (515, 8) + + + _rotation + 0 + + + + wxgui_numbersink2 + + id + wxgui_numbersink2_0 + + + _enabled + True + + + type + float + + + title + Frame Error Rate + + + units + % + + + samp_rate + 1 + + + min_value + 0 + + + max_value + 100 + + + factor + 1.0 + + + decimal_places + 2 + + + ref_level + 0 + + + number_rate + 15 + + + peak_hold + False + + + average + False + + + avg_alpha + 0 + + + show_gauge + True + + + win_size + + + + grid_pos + + + + notebook + + + + alias + + + + affinity + + + + comment + + + + _coordinate + (672, 563) + + + _rotation + 0 + + analog_sig_source_x_0 blocks_multiply_xx_0 @@ -1131,12 +1413,6 @@ mac_out phy in - - ieee802_11_ofdm_mac_0 - wifi_phy_hier_0 - phy out - mac_in - ieee802_11_ofdm_mac_0 foo_wireshark_connector_0 @@ -1149,4 +1425,22 @@ 0 0 + + ieee802_11_ofdm_mac_0 + wifi_phy_hier_0 + phy out + mac_in + + + ieee802_11_ofdm_parse_mac_0 + blocks_pdu_to_tagged_stream_0 + fer + pdus + + + blocks_pdu_to_tagged_stream_0 + wxgui_numbersink2_0 + 0 + 0 + From eaeaece2393b7ec85d03c4c3a5985c2fb12c7130 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 10:56:19 +0200 Subject: [PATCH 16/38] mac: always remove header --- grc/ieee802_11_ofdm_mac.xml | 18 +----------------- include/ieee802-11/ofdm_mac.h | 3 +-- lib/ofdm_mac.cc | 30 +++++++++++++----------------- 3 files changed, 15 insertions(+), 36 deletions(-) diff --git a/grc/ieee802_11_ofdm_mac.xml b/grc/ieee802_11_ofdm_mac.xml index 9bca984..4d6e48a 100644 --- a/grc/ieee802_11_ofdm_mac.xml +++ b/grc/ieee802_11_ofdm_mac.xml @@ -5,7 +5,7 @@ ieee802_11_ofdm_mac IEEE802.11 import ieee802_11 - ieee802_11.ofdm_mac($src_mac, $dst_mac, $bss_mac, $strip_header) + ieee802_11.ofdm_mac($src_mac, $dst_mac, $bss_mac) SRC MAC @@ -28,22 +28,6 @@ int_vector - - Strip header - strip_header - False - bool - - - - - len($src_mac) == 6 len($dst_mac) == 6 len($bss_mac) == 6 diff --git a/include/ieee802-11/ofdm_mac.h b/include/ieee802-11/ofdm_mac.h index ea270b9..599b91d 100644 --- a/include/ieee802-11/ofdm_mac.h +++ b/include/ieee802-11/ofdm_mac.h @@ -30,8 +30,7 @@ public: typedef boost::shared_ptr sptr; static sptr make(std::vector src_mac, std::vector dst_mac, - std::vector bss_mac, - bool strip_header); + std::vector bss_mac); }; } // namespace ieee802_11 diff --git a/lib/ofdm_mac.cc b/lib/ofdm_mac.cc index be90fc7..c763fc6 100644 --- a/lib/ofdm_mac.cc +++ b/lib/ofdm_mac.cc @@ -38,12 +38,11 @@ class ofdm_mac_impl : public ofdm_mac { public: -ofdm_mac_impl(std::vector src_mac, std::vector dst_mac, std::vector bss_mac, bool strip_header) : +ofdm_mac_impl(std::vector src_mac, std::vector dst_mac, std::vector bss_mac) : block("ofdm_mac", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), - d_seq_nr(0), - d_strip_header(strip_header) { + d_seq_nr(0) { message_port_register_out(pmt::mp("phy out")); message_port_register_out(pmt::mp("app out")); @@ -66,19 +65,17 @@ ofdm_mac_impl(std::vector src_mac, std::vector dst_mac, std::v } void phy_in (pmt::pmt_t msg) { - if (d_strip_header) { - // this must be a pair - if (!pmt::is_blob(pmt::cdr(msg))) - throw std::runtime_error("PMT must be blob"); + // this must be a pair + if (!pmt::is_blob(pmt::cdr(msg))) + throw std::runtime_error("PMT must be blob"); - // strip MAC header and only leave PHY blob - pmt::pmt_t blob(pmt::cdr(msg)); - const char *mpdu = reinterpret_cast(pmt::blob_data(blob)); - pmt::pmt_t msdu = pmt::make_blob(mpdu + 24, pmt::blob_length(blob) - 24); + // strip MAC header and CRC + pmt::pmt_t blob(pmt::cdr(msg)); + const char *mpdu = reinterpret_cast(pmt::blob_data(blob)); + pmt::pmt_t msdu = pmt::make_blob(mpdu + 24, pmt::blob_length(blob) - 24 - 4); - // update original msg, note that the fcs is still there - pmt::set_cdr(msg, msdu); - } + // update msg + pmt::set_cdr(msg, msdu); message_port_pub(pmt::mp("app out"), msg); } @@ -175,11 +172,10 @@ private: uint8_t d_src_mac[6]; uint8_t d_dst_mac[6]; uint8_t d_bss_mac[6]; - bool d_strip_header; }; ofdm_mac::sptr -ofdm_mac::make(std::vector src_mac, std::vector dst_mac, std::vector bss_mac, bool strip_header) { - return gnuradio::get_initial_sptr(new ofdm_mac_impl(src_mac, dst_mac, bss_mac, strip_header)); +ofdm_mac::make(std::vector src_mac, std::vector dst_mac, std::vector bss_mac) { + return gnuradio::get_initial_sptr(new ofdm_mac_impl(src_mac, dst_mac, bss_mac)); } From ec195bed59bc3c92fba7e870c8950c2398bbbcbe Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 11:11:07 +0200 Subject: [PATCH 17/38] update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cd0d6ca..d3daef4 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ To actually install the blocks do sudo make install sudo ldconfig +### Adjust Maximum Shared Memory +Since the transmitter is using the Tagged Stream blocks it has to store a complete frame in the buffer before processing it. The default maximum shared memory might not be enough on most Linux systems. It can be increased with + + sudo sysctl -w kernel.shmmax=2147483648 ### OFDM PHY From d8f0159985ef8a3aa16512353adab75b0dbb28b9 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 13:05:54 +0200 Subject: [PATCH 18/38] sync short: detect frames during copying --- lib/ofdm_sync_short.cc | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/lib/ofdm_sync_short.cc b/lib/ofdm_sync_short.cc index 9b3c147..ab60764 100644 --- a/lib/ofdm_sync_short.cc +++ b/lib/ofdm_sync_short.cc @@ -22,6 +22,8 @@ using namespace gr::ieee802_11; +static const int MIN_GAP = 800; + class ofdm_sync_short_impl : public ofdm_sync_short { public: @@ -86,20 +88,39 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, case COPY: { - int to_copy = std::min(d_copy_left, std::min(noutput, ninput)); - std::memcpy(out, in, to_copy * sizeof(gr_complex)); + int o = 0; + while( (o < ninput) && (o < noutput) && d_copy_left) { + if(in2[o] > d_threshold) { + if(d_plateau < MIN_PLATEAU) { + d_plateau++; - d_copy_left -= to_copy; + // there's another frame + } else if((MAX_SAMPLES - d_copy_left) > MIN_GAP) { + d_copy_left = MAX_SAMPLES; + d_plateau = 0; + insert_tag(nitems_written(0) + o); + dout << "SHORT Frame!" << std::endl; + break; + } + + } else { + d_plateau = 0; + } + + out[o] = in[o]; + o++; + d_copy_left--; + } if(!d_copy_left) { d_state = SEARCH; } - dout << "SHORT copied " << to_copy << std::endl; + dout << "SHORT copied " << o << std::endl; - consume(0, to_copy); - consume(1, to_copy); - return to_copy; + consume(0, o); + consume(1, o); + return o; } } From a185b39871704e50ad9cddc39db80eae6c462f0a Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 13:13:01 +0200 Subject: [PATCH 19/38] parser: don't average, let do this subsequent blocks --- lib/ofdm_parse_mac.cc | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/lib/ofdm_parse_mac.cc b/lib/ofdm_parse_mac.cc index 4da7b12..832e829 100644 --- a/lib/ofdm_parse_mac.cc +++ b/lib/ofdm_parse_mac.cc @@ -23,8 +23,6 @@ using namespace gr::ieee802_11; -#define FER_ALPHA 0.2f - class ofdm_parse_mac_impl : public ofdm_parse_mac { public: @@ -33,15 +31,13 @@ ofdm_parse_mac_impl(bool log, bool debug) : block("ofdm_parse_mac", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), - d_log(log), + d_log(log), d_last_seq_no(0), d_debug(debug) { - message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), boost::bind(&ofdm_parse_mac_impl::parse, this, _1)); + message_port_register_in(pmt::mp("in")); + set_msg_handler(pmt::mp("in"), boost::bind(&ofdm_parse_mac_impl::parse, this, _1)); - message_port_register_out(pmt::mp("fer")); - d_last_fer = 0.0f; - d_last_seq_no = 0; + message_port_register_out(pmt::mp("fer")); } ~ofdm_parse_mac_impl() { @@ -270,19 +266,12 @@ void parse_data(char *buf, int length) { dout << "d_last_seq_no: " << d_last_seq_no << std::endl; dout << "lost frames: " << lost_frames << std::endl; - // calculate instantaneous error rate - float curr_fer = 0.0f; - if (lost_frames > 0) - curr_fer = 1 - (1 / (static_cast(lost_frames) + 1)); - dout << "instantaneous fer: " << curr_fer << std::endl; - - // update FER estimate - float fer = (1.0f - FER_ALPHA) * d_last_fer + FER_ALPHA * curr_fer; - dout << "rolling fer: " << fer << std::endl; + // calculate frame error rate + float fer = 1 - (1 / (static_cast(lost_frames) + 1)); + dout << "instantaneous fer: " << fer << std::endl; // keep track of values d_last_seq_no = seq_no; - d_last_fer = fer; // publish FER estimate pmt::pmt_t pdu = pmt::make_f32vector(1, fer * 100); @@ -370,7 +359,6 @@ void print_ascii(char* buf, int length) { private: bool d_log; bool d_debug; - float d_last_fer; int d_last_seq_no; }; From a8cae8a68933eaaa71ae17d52c52b93257e01ae6 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 13:13:48 +0200 Subject: [PATCH 20/38] loopback: use channel model block --- examples/wifi_loopback.grc | 1364 ++++++++++++++---------------------- 1 file changed, 519 insertions(+), 845 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index 6270998..7504b80 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -1,5 +1,5 @@ - + Sat Feb 1 18:28:19 2014 @@ -52,18 +52,10 @@ realtime_scheduling - - thread_safe_setters - - alias - - comment - - _coordinate (7, 4) @@ -91,10 +83,6 @@ alias - - comment - - _coordinate (179, 4) @@ -122,641 +110,9 @@ alias - - comment - - _coordinate - (1136, 147) - - - _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 - - - - alias - - - - comment - - - - _coordinate - (1067, 10) - - - _rotation - 0 - - - - import - - id - import_0 - - - _enabled - True - - - import - import math - - - alias - - - - comment - - - - _coordinate - (422, 11) - - - _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 - - - - alias - - - - comment - - - - _coordinate - (693, 7) - - - _rotation - 0 - - - - blocks_add_xx - - id - blocks_add_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - comment - - - - _coordinate - (592, 280) - - - _rotation - 180 - - - - wifi_phy_hier - - id - wifi_phy_hier_0 - - - _enabled - True - - - encoding - encoding - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - comment - - - - _coordinate - (384, 264) - - - _rotation - 180 - - - - blocks_multiply_xx - - id - blocks_multiply_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - comment - - - - _coordinate - (544, 432) - - - _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 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - comment - - - - _coordinate - (328, 539) - - - _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 - - - - alias - - - - comment - - - - _coordinate - (814, 8) - - - _rotation - 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 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - comment - - - - _coordinate - (856, 259) - - - _rotation - 180 - - - - blocks_multiply_const_vxx - - id - blocks_multiply_const_vxx_0 - - - _enabled - True - - - type - complex - - - const - signal_power**.5 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - comment - - - - _coordinate - (696, 443) - - - _rotation - 0 - - - - foo_wireshark_connector - - id - foo_wireshark_connector_0 - - - _enabled - False - - - tech - 127 - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - comment - - - - _coordinate - (696, 155) - - - _rotation - 0 - - - - blocks_file_sink - - id - blocks_file_sink_0 - - - _enabled - False - - - file - /tmp/ofdm.bin - - - type - byte - - - vlen - 1 - - - unbuffered - True - - - append - False - - - alias - - - - affinity - - - - comment - - - - _coordinate - (888, 155) + (272, 3) _rotation @@ -802,12 +158,184 @@ 0 - comment + _coordinate + (416, 139) + + + _rotation + 0 + + + + blocks_pdu_to_tagged_stream + + id + blocks_pdu_to_tagged_stream_0 + + + _enabled + True + + + type + float + + + tag + packet_len + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (136, 635) + + + _rotation + 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 + + id + blocks_message_strobe_0 + + + _enabled + True + + + msg + pmt.intern("".join("x" for i in range(pdu_length))) + + + period + interval + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (48, 131) + + + _rotation + 0 + + + + variable_static_text + + id + snr_text + + + _enabled + True + + + label + SNR + + + value + str(snr) + + + converver + str_converter + + + formatter + None + + + grid_pos + + + + notebook + + + + alias _coordinate - (416, 139) + (515, 8) _rotation @@ -818,7 +346,7 @@ variable_slider id - freq_offset + snr _enabled @@ -830,15 +358,15 @@ value - 0 + 10 min - -10000 + -15 max - 10000 + 30 num_steps @@ -864,13 +392,9 @@ alias - - comment - - _coordinate - (947, 7) + (656, 11) _rotation @@ -923,13 +447,9 @@ maxoutbuf 0 - - comment - - _coordinate - (320, 395) + (272, 395) _rotation @@ -937,22 +457,38 @@ - blocks_pdu_to_tagged_stream + channels_channel_model id - blocks_pdu_to_tagged_stream_0 + channels_channel_model_0 _enabled True - type - float + noise_voltage + .5**.5 - tag - packet_len + freq_offset + 1 + freq_offset + + + epsilon + 1.0 + + + taps + 1.0 + + + seed + 0 + + + block_tags + False alias @@ -970,107 +506,9 @@ maxoutbuf 0 - - comment - - _coordinate - (136, 635) - - - _rotation - 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 - - - comment - - - - _coordinate - (104, 251) - - - _rotation - 180 - - - - blocks_message_strobe - - id - blocks_message_strobe_0 - - - _enabled - True - - - msg - pmt.intern("".join("x" for i in range(pdu_length))) - - - period - interval - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - comment - - - - _coordinate - (48, 131) + (632, 395) _rotation @@ -1081,7 +519,7 @@ variable_slider id - pdu_length + freq_offset _enabled @@ -1093,15 +531,15 @@ value - 10 + 1.0 min - 0 + .9 max - 1500 + 1.1 num_steps @@ -1113,7 +551,7 @@ converver - int_converter + float_converter grid_pos @@ -1128,12 +566,90 @@ - comment + _coordinate + (776, 11) + + + _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 + + + + alias _coordinate - (1120, 227) + (888, 11) + + + _rotation + 0 + + + + import + + id + import_0 + + + _enabled + True + + + import + import math + + + alias + + + + _coordinate + (376, 3) _rotation @@ -1190,13 +706,9 @@ alias - - comment - - _coordinate - (1120, 355) + (1064, 11) _rotation @@ -1204,10 +716,139 @@ - variable_static_text + blocks_file_sink id - snr + blocks_file_sink_0 + + + _enabled + False + + + file + /tmp/ofdm.bin + + + type + byte + + + vlen + 1 + + + unbuffered + True + + + append + False + + + alias + + + + affinity + + + + _coordinate + (896, 187) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + encoding + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (384, 264) + + + _rotation + 180 + + + + foo_wireshark_connector + + id + foo_wireshark_connector_0 + + + _enabled + False + + + tech + 127 + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (688, 195) + + + _rotation + 0 + + + + variable_slider + + id + pdu_length _enabled @@ -1215,19 +856,31 @@ label - SNR + value - str(10 * math.log10(signal_power/noise_power)) + "dB" + 10 + + + min + 0 + + + max + 1500 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL converver - str_converter - - - formatter - None + int_converter grid_pos @@ -1242,12 +895,55 @@ - comment + _coordinate + (1088, 147) + + + _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 - (515, 8) + (440, 427) _rotation @@ -1310,11 +1006,11 @@ average - False + True avg_alpha - 0 + 0.02 show_gauge @@ -1340,49 +1036,15 @@ affinity - - comment - - _coordinate - (672, 563) + (552, 555) _rotation 0 - - analog_sig_source_x_0 - blocks_multiply_xx_0 - 0 - 1 - - - analog_noise_source_x_0 - blocks_add_xx_0 - 0 - 1 - - - blocks_multiply_xx_0 - blocks_multiply_const_vxx_0 - 0 - 0 - - - blocks_multiply_const_vxx_0 - blocks_add_xx_0 - 0 - 0 - - - blocks_add_xx_0 - wifi_phy_hier_0 - 0 - 0 - wifi_phy_hier_0 ieee802_11_ofdm_parse_mac_0 @@ -1395,12 +1057,6 @@ strobe app in - - foo_packet_pad2_0 - blocks_multiply_xx_0 - 0 - 0 - wifi_phy_hier_0 foo_packet_pad2_0 @@ -1413,18 +1069,6 @@ mac_out phy in - - ieee802_11_ofdm_mac_0 - foo_wireshark_connector_0 - phy out - in - - - foo_wireshark_connector_0 - blocks_file_sink_0 - 0 - 0 - ieee802_11_ofdm_mac_0 wifi_phy_hier_0 @@ -1443,4 +1087,34 @@ 0 0 + + channels_channel_model_0 + wifi_phy_hier_0 + 0 + 0 + + + foo_packet_pad2_0 + blocks_multiply_const_vxx_0 + 0 + 0 + + + blocks_multiply_const_vxx_0 + channels_channel_model_0 + 0 + 0 + + + foo_wireshark_connector_0 + blocks_file_sink_0 + 0 + 0 + + + wifi_phy_hier_0 + foo_wireshark_connector_0 + mac_out + in + From 00a6a9c6625a8eef5cc8a1d49345f2bd01ccb091 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 13:18:00 +0200 Subject: [PATCH 21/38] mac: don't change the phy pdu --- lib/ofdm_mac.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/ofdm_mac.cc b/lib/ofdm_mac.cc index c763fc6..527de37 100644 --- a/lib/ofdm_mac.cc +++ b/lib/ofdm_mac.cc @@ -74,9 +74,7 @@ void phy_in (pmt::pmt_t msg) { const char *mpdu = reinterpret_cast(pmt::blob_data(blob)); pmt::pmt_t msdu = pmt::make_blob(mpdu + 24, pmt::blob_length(blob) - 24 - 4); - // update msg - pmt::set_cdr(msg, msdu); - message_port_pub(pmt::mp("app out"), msg); + message_port_pub(pmt::mp("app out"), pmt::cons(pmt::car(msg), msdu)); } void app_in (pmt::pmt_t msg) { From f64f72af9173f081797f806abb1c37751812048e Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 16:18:46 +0200 Subject: [PATCH 22/38] fix segfault + upper limit for bits --- lib/ofdm_decode_mac.cc | 58 ++++++++++++++++++++++-------------------- lib/ofdm_mapper.cc | 4 +-- lib/utils.h | 3 ++- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/lib/ofdm_decode_mac.cc b/lib/ofdm_decode_mac.cc index b1e750f..50e1324 100644 --- a/lib/ofdm_decode_mac.cc +++ b/lib/ofdm_decode_mac.cc @@ -34,8 +34,9 @@ ofdm_decode_mac_impl(bool log, bool debug) : block("ofdm_decode_mac", gr::io_signature::make(0, 0, 0)), d_log(log), d_debug(debug), - ofdm(BPSK_1_2), - tx(ofdm, 0) { + d_ofdm(BPSK_1_2), + d_tx(d_ofdm, 0), + d_frame_complete(true) { message_port_register_out(pmt::mp("out")); @@ -61,7 +62,6 @@ ofdm_decode_mac_impl(bool log, bool debug) : block("ofdm_decode_mac", 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; qam64.set(cvec(QAM64_D, 64), ivec(qam64_bits, 64)); - d_frame_complete = true; } int general_work (int noutput_items, gr_vector_int& ninput_items, @@ -85,7 +85,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, if(tags.size()) { if (d_frame_complete == false) { dout << "Warning: starting to receive new frame before old frame was complete" << std::endl; - dout << "Already copied " << copied << " out of " << tx.n_sym << " symbols of last frame" << std::endl; + dout << "Already copied " << copied << " out of " << d_tx.n_sym << " symbols of last frame" << std::endl; } d_frame_complete = false; @@ -93,26 +93,28 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, int len_data = pmt::to_uint64(pmt::car(tuple)); int encoding = pmt::to_uint64(pmt::cdr(tuple)); - ofdm = ofdm_param((Encoding)encoding); - tx = tx_param(ofdm, len_data); + ofdm_param ofdm = ofdm_param((Encoding)encoding); + tx_param tx = tx_param(ofdm, len_data); - // sanity check, more than MAX_NUM_SYM may indicate garbage - if(tx.n_sym < MAX_NUM_SYM) { + // sanity check, more than MAX_SYM may indicate garbage + if(tx.n_sym <= MAX_SYM && tx.n_encoded_bits <= MAX_BITS) { + d_ofdm = ofdm; + d_tx = tx; copied = 0; dout << "Decode MAC: frame start -- len " << len_data << " symbols " << tx.n_sym << " encoding " << encoding << std::endl; } else { - dout << "Dropping frame with " << tx.n_sym << " symbols, maximum number of symbols is " << MAX_NUM_SYM << std::endl; + dout << "Dropping frame which is too large (symbols or bits)" << std::endl; } } - if(copied < tx.n_sym) { - dout << "copy one symbol, copied " << copied << " out of " << tx.n_sym << std::endl; + if(copied < d_tx.n_sym) { + dout << "copy one symbol, copied " << copied << " out of " << d_tx.n_sym << std::endl; std::memcpy(sym + (copied * 48), in, 48 * sizeof(gr_complex)); copied++; - if(copied == tx.n_sym) { + if(copied == d_tx.n_sym) { dout << "received complete frame - decoding" << std::endl; decode(); in += 48; @@ -139,18 +141,18 @@ void decode() { // skip service field boost::crc_32_type result; - result.process_bytes(out_bytes + 2, tx.psdu_size); + result.process_bytes(out_bytes + 2, d_tx.psdu_size); if(result.checksum() != 558161692) { dout << "checksum wrong -- dropping" << std::endl; return; } mylog(boost::format("encoding: %1% - length: %2% - symbols: %3%") - % ofdm.encoding % tx.psdu_size % tx.n_sym); + % d_ofdm.encoding % d_tx.psdu_size % d_tx.n_sym); // create PDU - pmt::pmt_t blob = pmt::make_blob(out_bytes + 2, tx.psdu_size - 4); - pmt::pmt_t enc = pmt::from_uint64(ofdm.encoding); + pmt::pmt_t blob = pmt::make_blob(out_bytes + 2, d_tx.psdu_size - 4); + pmt::pmt_t enc = pmt::from_uint64(d_ofdm.encoding); pmt::pmt_t dict = pmt::make_dict(); dict = pmt::dict_add(dict, pmt::mp("encoding"), enc); message_port_pub(pmt::mp("out"), pmt::cons(dict, blob)); @@ -159,12 +161,12 @@ void decode() { void demodulate() { cvec symbols; - symbols.set_length(tx.n_sym * 48); - for(int i = 0; i < tx.n_sym * 48; i++) { + symbols.set_length(d_tx.n_sym * 48); + for(int i = 0; i < d_tx.n_sym * 48; i++) { symbols[i] = std::complex(sym[i]); } - switch(ofdm.encoding) { + switch(d_ofdm.encoding) { case BPSK_1_2: case BPSK_3_4: @@ -193,10 +195,10 @@ void demodulate() { void deinterleave() { - int n_cbps = ofdm.n_cbps; + int n_cbps = d_ofdm.n_cbps; int first[n_cbps]; int second[n_cbps]; - int s = std::max(ofdm.n_bpsc / 2, 1); + int s = std::max(d_ofdm.n_bpsc / 2, 1); for(int j = 0; j < n_cbps; j++) { first[j] = s * (j / s) + ((j + int(floor(16.0 * j / n_cbps))) % s); @@ -206,7 +208,7 @@ void deinterleave() { second[i] = 16 * i - (n_cbps - 1) * int(floor(16.0 * i / n_cbps)); } - for(int i = 0; i < tx.n_sym; i++) { + for(int i = 0; i < d_tx.n_sym; i++) { for(int k = 0; k < n_cbps; k++) { deinter[i * n_cbps + second[first[k]]] = bits[i * n_cbps + k]; } @@ -221,7 +223,7 @@ void decode_conv() { code.set_generator_polynomials(generator, 7); bmat puncture_matrix; - switch(ofdm.encoding) { + switch(d_ofdm.encoding) { case BPSK_1_2: case QPSK_1_2: case QAM16_1_2: @@ -241,12 +243,12 @@ void decode_conv() { code.set_truncation_length(30); dout << "coding rate " << code.get_rate() << std::endl; - dout << tx.n_encoded_bits << std::endl; + dout << d_tx.n_encoded_bits << std::endl; - vec rx_signal(deinter, tx.n_encoded_bits); + vec rx_signal(deinter, d_tx.n_encoded_bits); code.reset(); - decoded_bits.set_length(tx.n_encoded_bits); + decoded_bits.set_length(d_tx.n_encoded_bits); code.decode_tail(rx_signal, decoded_bits); //dout << "length decoded " << decoded_bits.size() << std::endl; @@ -312,8 +314,8 @@ private: bool d_debug; bool d_log; - tx_param tx; - ofdm_param ofdm; + tx_param d_tx; + ofdm_param d_ofdm; int copied; bool d_frame_complete; diff --git a/lib/ofdm_mapper.cc b/lib/ofdm_mapper.cc index a721086..5b90fb8 100644 --- a/lib/ofdm_mapper.cc +++ b/lib/ofdm_mapper.cc @@ -82,8 +82,8 @@ int general_work(int noutput, gr_vector_int& ninput_items, // ############ INSERT MAC STUFF tx_param tx(d_ofdm, psdu_length); - if(tx.n_sym > MAX_NUM_SYM) { - std::cout << "packet too large, maximum number of symbols is " << MAX_NUM_SYM << std::endl; + if(tx.n_sym > MAX_SYM) { + std::cout << "packet too large, maximum number of symbols is " << MAX_SYM << std::endl; return 0; } diff --git a/lib/utils.h b/lib/utils.h index 5bd1eb7..a2c72e2 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -23,7 +23,8 @@ #include #include -#define MAX_NUM_SYM 520 // this should be enough to transmit 1500B user payload with BPSK 1/2 +const int MAX_SYM = 520; // enough for 1500 byte BPSK 1/2 +const int MAX_BITS = 1530 * 8; #define dout d_debug && std::cout From 03dc1fcf24e7bda29fbd6967ddf5a0a993423a61 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 17:04:01 +0200 Subject: [PATCH 23/38] sync short: shorten minimum gap --- lib/ofdm_sync_short.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ofdm_sync_short.cc b/lib/ofdm_sync_short.cc index ab60764..11990fd 100644 --- a/lib/ofdm_sync_short.cc +++ b/lib/ofdm_sync_short.cc @@ -22,7 +22,7 @@ using namespace gr::ieee802_11; -static const int MIN_GAP = 800; +static const int MIN_GAP = 480; class ofdm_sync_short_impl : public ofdm_sync_short { From f4f8c7533dec6fdb2594dc5e66dad09b0862851b Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 17:05:57 +0200 Subject: [PATCH 24/38] update flow graphs (fix lo offset) --- examples/wifi_loopback.grc | 352 +++---- examples/wifi_phy_hier.grc | 152 +-- examples/wifi_rx.grc | 985 +++++++++++-------- examples/wifi_transceiver.grc | 1697 +++++++++++++++++++-------------- examples/wifi_tx.grc | 351 ++++--- 5 files changed, 2038 insertions(+), 1499 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index 7504b80..5f13080 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -65,33 +65,6 @@ 0 - - variable - - id - samp_rate - - - _enabled - True - - - value - 20000000 - - - alias - - - - _coordinate - (179, 4) - - - _rotation - 0 - - variable @@ -119,6 +92,33 @@ 0 + + variable + + id + samp_rate + + + _enabled + True + + + value + 20000000 + + + alias + + + + _coordinate + (179, 4) + + + _rotation + 0 + + ieee802_11_ofdm_mac @@ -656,112 +656,6 @@ 0 - - variable_slider - - id - interval - - - _enabled - True - - - label - PDU Interval (ms) - - - value - 10 - - - min - 0 - - - max - 1000 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - int_converter - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (1064, 11) - - - _rotation - 0 - - - - blocks_file_sink - - id - blocks_file_sink_0 - - - _enabled - False - - - file - /tmp/ofdm.bin - - - type - byte - - - vlen - 1 - - - unbuffered - True - - - append - False - - - alias - - - - affinity - - - - _coordinate - (896, 187) - - - _rotation - 0 - - wifi_phy_hier @@ -801,49 +695,6 @@ 180 - - foo_wireshark_connector - - id - foo_wireshark_connector_0 - - - _enabled - False - - - tech - 127 - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (688, 195) - - - _rotation - 0 - - variable_slider @@ -1045,6 +896,155 @@ 0 + + foo_wireshark_connector + + id + foo_wireshark_connector_0 + + + _enabled + False + + + tech + 127 + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (688, 195) + + + _rotation + 0 + + + + blocks_file_sink + + id + blocks_file_sink_0 + + + _enabled + False + + + file + /tmp/ofdm.bin + + + type + byte + + + vlen + 1 + + + unbuffered + True + + + append + False + + + alias + + + + affinity + + + + _coordinate + (896, 187) + + + _rotation + 0 + + + + variable_slider + + id + interval + + + _enabled + True + + + label + PDU Interval (ms) + + + value + 50 + + + min + 0 + + + max + 1000 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (1064, 11) + + + _rotation + 0 + + wifi_phy_hier_0 ieee802_11_ofdm_parse_mac_0 diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index 35b136a..2dcce24 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -69,7 +69,7 @@ variable id - out_buf_size + window_size _enabled @@ -77,7 +77,7 @@ value - 96000 + 48 alias @@ -85,34 +85,7 @@ _coordinate - (680, 11) - - - _rotation - 0 - - - - variable - - id - header_formatter - - - _enabled - True - - - value - ieee802_11.wifi_signal_field() - - - alias - - - - _coordinate - (518, 18) + (323, 14) _rotation @@ -150,7 +123,7 @@ variable id - window_size + header_formatter _enabled @@ -158,7 +131,7 @@ value - 48 + ieee802_11.wifi_signal_field() alias @@ -166,7 +139,34 @@ _coordinate - (323, 14) + (518, 18) + + + _rotation + 0 + + + + variable + + id + out_buf_size + + + _enabled + True + + + value + 96000 + + + alias + + + + _coordinate + (680, 11) _rotation @@ -709,49 +709,6 @@ 180 - - ieee802_11_ofdm_decode_mac - - id - ieee802_11_ofdm_decode_mac_0 - - - _enabled - True - - - log - True - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (283, 932) - - - _rotation - 180 - - pad_sink @@ -1496,6 +1453,49 @@ 0 + + ieee802_11_ofdm_decode_mac + + id + ieee802_11_ofdm_decode_mac_0 + + + _enabled + True + + + log + False + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (283, 932) + + + _rotation + 180 + + pad_source_1 ieee802_11_ofdm_mapper_0 diff --git a/examples/wifi_rx.grc b/examples/wifi_rx.grc index 50d7ca5..de38918 100644 --- a/examples/wifi_rx.grc +++ b/examples/wifi_rx.grc @@ -1,4 +1,5 @@ + Fri Jul 18 10:38:16 2014 @@ -118,45 +119,6 @@ 0 - - ieee802_11_ofdm_equalize_symbols - - id - ieee802_11_ofdm_equalize_symbols_0 - - - _enabled - True - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (389, 720) - - - _rotation - 0 - - blocks_delay @@ -302,49 +264,6 @@ 0 - - ieee802_11_ofdm_decode_signal - - id - ieee802_11_ofdm_decode_signal_0 - - - _enabled - True - - - log - True - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (656, 712) - - - _rotation - 0 - - blocks_conjugate_cc @@ -713,61 +632,6 @@ 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 - - - - alias - - - - _coordinate - (929, 21) - - - _rotation - 0 - - blocks_vector_to_stream @@ -874,139 +738,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 - - - - alias - - - - _coordinate - (254, 12) - - - _rotation - 0 - - - - ieee802_11_ofdm_parse_mac - - id - ieee802_11_ofdm_parse_mac_0 - - - _enabled - True - - - log - False - - - debug - True - - - alias - - - - affinity - - - - _coordinate - (969, 820) - - - _rotation - 180 - - - - ieee802_11_ofdm_decode_mac - - id - ieee802_11_ofdm_decode_mac_0 - - - _enabled - True - - - log - False - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (930, 712) - - - _rotation - 0 - - ieee802_11_ether_encap @@ -1046,49 +777,6 @@ 180 - - foo_wireshark_connector - - id - foo_wireshark_connector_0 - - - _enabled - False - - - tech - 127 - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (947, 1051) - - - _rotation - 180 - - blocks_tuntap_pdu @@ -1107,6 +795,10 @@ mtu 10000 + + istunflag + False + alias @@ -1132,53 +824,6 @@ 180 - - blocks_file_sink - - id - blocks_file_sink_0 - - - _enabled - False - - - file - /tmp/ofdm.pcap - - - type - byte - - - vlen - 1 - - - unbuffered - True - - - append - True - - - alias - - - - affinity - - - - _coordinate - (721, 1043) - - - _rotation - 180 - - blocks_divide_xx @@ -1269,61 +914,6 @@ 0 - - ieee802_11_ofdm_sync_short - - id - ieee802_11_ofdm_sync_short_0 - - - _enabled - True - - - log - False - - - debug - False - - - threshold - 0.85 * 0.75 - - - max_samples - 80 * 160 - - - min_plateau - 2 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (212, 501) - - - _rotation - 0 - - notebook @@ -1529,6 +1119,374 @@ 270 + + ieee802_11_ofdm_parse_mac + + id + ieee802_11_ofdm_parse_mac_0 + + + _enabled + True + + + log + False + + + debug + True + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (969, 820) + + + _rotation + 180 + + + + ieee802_11_ofdm_decode_mac + + id + ieee802_11_ofdm_decode_mac_0 + + + _enabled + True + + + log + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (930, 712) + + + _rotation + 0 + + + + ieee802_11_ofdm_equalize_symbols + + id + ieee802_11_ofdm_equalize_symbols_0 + + + _enabled + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (389, 720) + + + _rotation + 0 + + + + ieee802_11_ofdm_decode_signal + + id + ieee802_11_ofdm_decode_signal_0 + + + _enabled + True + + + log + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (656, 712) + + + _rotation + 0 + + + + ieee802_11_ofdm_sync_short + + id + ieee802_11_ofdm_sync_short_0 + + + _enabled + True + + + log + False + + + debug + False + + + threshold + 0.85 * 0.75 + + + max_samples + 80 * 550 + + + min_plateau + 2 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (212, 501) + + + _rotation + 0 + + + + blocks_file_sink + + id + blocks_file_sink_0 + + + _enabled + True + + + file + /tmp/ofdm.pcap + + + type + byte + + + vlen + 1 + + + unbuffered + True + + + append + True + + + alias + + + + affinity + + + + _coordinate + (721, 1043) + + + _rotation + 180 + + + + foo_wireshark_connector + + id + foo_wireshark_connector_0 + + + _enabled + True + + + tech + 127 + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (947, 1051) + + + _rotation + 180 + + + + variable_chooser + + id + lo_offset + + + _enabled + True + + + label + LO Offset + + + value + 0 + + + choices + [0, 6e6, 11e6] + + + labels + ['0 MHz', '6 MHz', '11 MHz'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (254, 12) + + + _rotation + 0 + + uhd_usrp_source @@ -1681,12 +1639,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 gain + + norm_gain0 + False + ant0 @@ -1703,6 +1665,10 @@ gain1 0 + + norm_gain1 + False + ant1 @@ -1719,6 +1685,10 @@ gain2 0 + + norm_gain2 + False + ant2 @@ -1735,6 +1705,10 @@ gain3 0 + + norm_gain3 + False + ant3 @@ -1751,6 +1725,10 @@ gain4 0 + + norm_gain4 + False + ant4 @@ -1767,6 +1745,10 @@ gain5 0 + + norm_gain5 + False + ant5 @@ -1783,6 +1765,10 @@ gain6 0 + + norm_gain6 + False + ant6 @@ -1799,6 +1785,10 @@ gain7 0 + + norm_gain7 + False + ant7 @@ -1815,6 +1805,10 @@ gain8 0 + + norm_gain8 + False + ant8 @@ -1831,6 +1825,10 @@ gain9 0 + + norm_gain9 + False + ant9 @@ -1847,6 +1845,10 @@ gain10 0 + + norm_gain10 + False + ant10 @@ -1863,6 +1865,10 @@ gain11 0 + + norm_gain11 + False + ant11 @@ -1879,6 +1885,10 @@ gain12 0 + + norm_gain12 + False + ant12 @@ -1895,6 +1905,10 @@ gain13 0 + + norm_gain13 + False + ant13 @@ -1911,6 +1925,10 @@ gain14 0 + + norm_gain14 + False + ant14 @@ -1927,6 +1945,10 @@ gain15 0 + + norm_gain15 + False + ant15 @@ -1943,6 +1965,10 @@ gain16 0 + + norm_gain16 + False + ant16 @@ -1959,6 +1985,10 @@ gain17 0 + + norm_gain17 + False + ant17 @@ -1975,6 +2005,10 @@ gain18 0 + + norm_gain18 + False + ant18 @@ -1991,6 +2025,10 @@ gain19 0 + + norm_gain19 + False + ant19 @@ -2007,6 +2045,10 @@ gain20 0 + + norm_gain20 + False + ant20 @@ -2023,6 +2065,10 @@ gain21 0 + + norm_gain21 + False + ant21 @@ -2039,6 +2085,10 @@ gain22 0 + + norm_gain22 + False + ant22 @@ -2055,6 +2105,10 @@ gain23 0 + + norm_gain23 + False + ant23 @@ -2071,6 +2125,10 @@ gain24 0 + + norm_gain24 + False + ant24 @@ -2087,6 +2145,10 @@ gain25 0 + + norm_gain25 + False + ant25 @@ -2103,6 +2165,10 @@ gain26 0 + + norm_gain26 + False + ant26 @@ -2119,6 +2185,10 @@ gain27 0 + + norm_gain27 + False + ant27 @@ -2135,6 +2205,10 @@ gain28 0 + + norm_gain28 + False + ant28 @@ -2151,6 +2225,10 @@ gain29 0 + + norm_gain29 + False + ant29 @@ -2167,6 +2245,10 @@ gain30 0 + + norm_gain30 + False + ant30 @@ -2183,6 +2265,10 @@ gain31 0 + + norm_gain31 + False + ant31 @@ -2216,6 +2302,61 @@ 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 + + + + alias + + + + _coordinate + (929, 21) + + + _rotation + 0 + + blocks_stream_to_vector_0 fft_vxx_0 @@ -2318,12 +2459,6 @@ 0 0 - - blocks_delay_0_0 - ieee802_11_ofdm_sync_short_0 - 0 - 0 - uhd_usrp_source_0 blocks_multiply_xx_0 @@ -2384,4 +2519,10 @@ 0 0 + + blocks_delay_0_0 + ieee802_11_ofdm_sync_short_0 + 0 + 0 + diff --git a/examples/wifi_transceiver.grc b/examples/wifi_transceiver.grc index ef552fb..afebacd 100644 --- a/examples/wifi_transceiver.grc +++ b/examples/wifi_transceiver.grc @@ -1,4 +1,5 @@ + Fri Jul 18 10:38:08 2014 @@ -119,61 +120,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 - - - - alias - - - - _coordinate - (584, 7) - - - _rotation - 0 - - variable_slider @@ -710,6 +656,14 @@ affinity + + minoutbuf + 0 + + + maxoutbuf + 0 + _coordinate (22, 290) @@ -776,6 +730,10 @@ mtu 440 + + istunflag + False + alias @@ -857,686 +815,54 @@ - uhd_usrp_source + variable_chooser id - uhd_usrp_source_0 + lo_offset _enabled True + + label + LO Offset + + + value + 0 + + + choices + [0, 6e6, 11e6] + + + labels + ['0 MHz', '6 MHz', '11 MHz'] + type - fc32 + drop_down - otw + style + wx.RA_HORIZONTAL + + + grid_pos - stream_args + notebook - - stream_chans - [] - - - dev_addr - - - - dev_args - "" - - - 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 - alias - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - _coordinate - (447, 520) + (584, 7) _rotation @@ -1695,12 +1021,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 @@ -1717,6 +1047,10 @@ gain1 0 + + norm_gain1 + False + ant1 @@ -1733,6 +1067,10 @@ gain2 0 + + norm_gain2 + False + ant2 @@ -1749,6 +1087,10 @@ gain3 0 + + norm_gain3 + False + ant3 @@ -1765,6 +1107,10 @@ gain4 0 + + norm_gain4 + False + ant4 @@ -1781,6 +1127,10 @@ gain5 0 + + norm_gain5 + False + ant5 @@ -1797,6 +1147,10 @@ gain6 0 + + norm_gain6 + False + ant6 @@ -1813,6 +1167,10 @@ gain7 0 + + norm_gain7 + False + ant7 @@ -1829,6 +1187,10 @@ gain8 0 + + norm_gain8 + False + ant8 @@ -1845,6 +1207,10 @@ gain9 0 + + norm_gain9 + False + ant9 @@ -1861,6 +1227,10 @@ gain10 0 + + norm_gain10 + False + ant10 @@ -1877,6 +1247,10 @@ gain11 0 + + norm_gain11 + False + ant11 @@ -1893,6 +1267,10 @@ gain12 0 + + norm_gain12 + False + ant12 @@ -1909,6 +1287,10 @@ gain13 0 + + norm_gain13 + False + ant13 @@ -1925,6 +1307,10 @@ gain14 0 + + norm_gain14 + False + ant14 @@ -1941,6 +1327,10 @@ gain15 0 + + norm_gain15 + False + ant15 @@ -1957,6 +1347,10 @@ gain16 0 + + norm_gain16 + False + ant16 @@ -1973,6 +1367,10 @@ gain17 0 + + norm_gain17 + False + ant17 @@ -1989,6 +1387,10 @@ gain18 0 + + norm_gain18 + False + ant18 @@ -2005,6 +1407,10 @@ gain19 0 + + norm_gain19 + False + ant19 @@ -2021,6 +1427,10 @@ gain20 0 + + norm_gain20 + False + ant20 @@ -2037,6 +1447,10 @@ gain21 0 + + norm_gain21 + False + ant21 @@ -2053,6 +1467,10 @@ gain22 0 + + norm_gain22 + False + ant22 @@ -2069,6 +1487,10 @@ gain23 0 + + norm_gain23 + False + ant23 @@ -2085,6 +1507,10 @@ gain24 0 + + norm_gain24 + False + ant24 @@ -2101,6 +1527,10 @@ gain25 0 + + norm_gain25 + False + ant25 @@ -2117,6 +1547,10 @@ gain26 0 + + norm_gain26 + False + ant26 @@ -2133,6 +1567,10 @@ gain27 0 + + norm_gain27 + False + ant27 @@ -2149,6 +1587,10 @@ gain28 0 + + norm_gain28 + False + ant28 @@ -2165,6 +1607,10 @@ gain29 0 + + norm_gain29 + False + ant29 @@ -2181,6 +1627,10 @@ gain30 0 + + norm_gain30 + False + ant30 @@ -2197,6 +1647,10 @@ gain31 0 + + norm_gain31 + False + ant31 @@ -2226,6 +1680,821 @@ 0 + + uhd_usrp_source + + id + uhd_usrp_source_0 + + + _enabled + True + + + type + fc32 + + + otw + + + + stream_args + + + + stream_chans + [] + + + dev_addr + + + + dev_args + "" + + + 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, rf_freq = freq - lo_offset, rf_freq_policy=uhd.tune_request.POLICY_MANUAL) + + + gain0 + rx_gain + + + norm_gain0 + False + + + ant0 + + + + bw0 + 0 + + + center_freq1 + 0 + + + gain1 + 0 + + + norm_gain1 + False + + + ant1 + + + + bw1 + 0 + + + center_freq2 + 0 + + + gain2 + 0 + + + norm_gain2 + False + + + ant2 + + + + bw2 + 0 + + + center_freq3 + 0 + + + gain3 + 0 + + + norm_gain3 + False + + + ant3 + + + + bw3 + 0 + + + center_freq4 + 0 + + + gain4 + 0 + + + norm_gain4 + False + + + ant4 + + + + bw4 + 0 + + + center_freq5 + 0 + + + gain5 + 0 + + + norm_gain5 + False + + + ant5 + + + + bw5 + 0 + + + center_freq6 + 0 + + + gain6 + 0 + + + norm_gain6 + False + + + ant6 + + + + bw6 + 0 + + + center_freq7 + 0 + + + gain7 + 0 + + + norm_gain7 + False + + + ant7 + + + + bw7 + 0 + + + center_freq8 + 0 + + + gain8 + 0 + + + norm_gain8 + False + + + ant8 + + + + bw8 + 0 + + + center_freq9 + 0 + + + gain9 + 0 + + + norm_gain9 + False + + + ant9 + + + + bw9 + 0 + + + center_freq10 + 0 + + + gain10 + 0 + + + norm_gain10 + False + + + ant10 + + + + bw10 + 0 + + + center_freq11 + 0 + + + gain11 + 0 + + + norm_gain11 + False + + + ant11 + + + + bw11 + 0 + + + center_freq12 + 0 + + + gain12 + 0 + + + norm_gain12 + False + + + ant12 + + + + bw12 + 0 + + + center_freq13 + 0 + + + gain13 + 0 + + + norm_gain13 + False + + + ant13 + + + + bw13 + 0 + + + center_freq14 + 0 + + + gain14 + 0 + + + norm_gain14 + False + + + ant14 + + + + bw14 + 0 + + + center_freq15 + 0 + + + gain15 + 0 + + + norm_gain15 + False + + + ant15 + + + + bw15 + 0 + + + center_freq16 + 0 + + + gain16 + 0 + + + norm_gain16 + False + + + ant16 + + + + bw16 + 0 + + + center_freq17 + 0 + + + gain17 + 0 + + + norm_gain17 + False + + + ant17 + + + + bw17 + 0 + + + center_freq18 + 0 + + + gain18 + 0 + + + norm_gain18 + False + + + ant18 + + + + bw18 + 0 + + + center_freq19 + 0 + + + gain19 + 0 + + + norm_gain19 + False + + + ant19 + + + + bw19 + 0 + + + center_freq20 + 0 + + + gain20 + 0 + + + norm_gain20 + False + + + ant20 + + + + bw20 + 0 + + + center_freq21 + 0 + + + gain21 + 0 + + + norm_gain21 + False + + + ant21 + + + + bw21 + 0 + + + center_freq22 + 0 + + + gain22 + 0 + + + norm_gain22 + False + + + ant22 + + + + bw22 + 0 + + + center_freq23 + 0 + + + gain23 + 0 + + + norm_gain23 + False + + + ant23 + + + + bw23 + 0 + + + center_freq24 + 0 + + + gain24 + 0 + + + norm_gain24 + False + + + ant24 + + + + bw24 + 0 + + + center_freq25 + 0 + + + gain25 + 0 + + + norm_gain25 + False + + + ant25 + + + + bw25 + 0 + + + center_freq26 + 0 + + + gain26 + 0 + + + norm_gain26 + False + + + ant26 + + + + bw26 + 0 + + + center_freq27 + 0 + + + gain27 + 0 + + + norm_gain27 + False + + + ant27 + + + + bw27 + 0 + + + center_freq28 + 0 + + + gain28 + 0 + + + norm_gain28 + False + + + ant28 + + + + bw28 + 0 + + + center_freq29 + 0 + + + gain29 + 0 + + + norm_gain29 + False + + + ant29 + + + + bw29 + 0 + + + center_freq30 + 0 + + + gain30 + 0 + + + norm_gain30 + False + + + ant30 + + + + bw30 + 0 + + + center_freq31 + 0 + + + gain31 + 0 + + + norm_gain31 + False + + + ant31 + + + + bw31 + 0 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (447, 520) + + + _rotation + 0 + + ieee802_11_ether_encap_0 blocks_tuntap_pdu_0 diff --git a/examples/wifi_tx.grc b/examples/wifi_tx.grc index e3c405e..56aa15d 100644 --- a/examples/wifi_tx.grc +++ b/examples/wifi_tx.grc @@ -1,4 +1,5 @@ + Fri Jul 18 10:38:21 2014 @@ -221,116 +222,6 @@ 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 - - - - alias - - - - _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 - - - - alias - - - - _coordinate - (419, 11) - - - _rotation - 0 - - variable_slider @@ -891,12 +782,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 gain + + norm_gain0 + False + ant0 @@ -913,6 +808,10 @@ gain1 0 + + norm_gain1 + False + ant1 @@ -929,6 +828,10 @@ gain2 0 + + norm_gain2 + False + ant2 @@ -945,6 +848,10 @@ gain3 0 + + norm_gain3 + False + ant3 @@ -961,6 +868,10 @@ gain4 0 + + norm_gain4 + False + ant4 @@ -977,6 +888,10 @@ gain5 0 + + norm_gain5 + False + ant5 @@ -993,6 +908,10 @@ gain6 0 + + norm_gain6 + False + ant6 @@ -1009,6 +928,10 @@ gain7 0 + + norm_gain7 + False + ant7 @@ -1025,6 +948,10 @@ gain8 0 + + norm_gain8 + False + ant8 @@ -1041,6 +968,10 @@ gain9 0 + + norm_gain9 + False + ant9 @@ -1057,6 +988,10 @@ gain10 0 + + norm_gain10 + False + ant10 @@ -1073,6 +1008,10 @@ gain11 0 + + norm_gain11 + False + ant11 @@ -1089,6 +1028,10 @@ gain12 0 + + norm_gain12 + False + ant12 @@ -1105,6 +1048,10 @@ gain13 0 + + norm_gain13 + False + ant13 @@ -1121,6 +1068,10 @@ gain14 0 + + norm_gain14 + False + ant14 @@ -1137,6 +1088,10 @@ gain15 0 + + norm_gain15 + False + ant15 @@ -1153,6 +1108,10 @@ gain16 0 + + norm_gain16 + False + ant16 @@ -1169,6 +1128,10 @@ gain17 0 + + norm_gain17 + False + ant17 @@ -1185,6 +1148,10 @@ gain18 0 + + norm_gain18 + False + ant18 @@ -1201,6 +1168,10 @@ gain19 0 + + norm_gain19 + False + ant19 @@ -1217,6 +1188,10 @@ gain20 0 + + norm_gain20 + False + ant20 @@ -1233,6 +1208,10 @@ gain21 0 + + norm_gain21 + False + ant21 @@ -1249,6 +1228,10 @@ gain22 0 + + norm_gain22 + False + ant22 @@ -1265,6 +1248,10 @@ gain23 0 + + norm_gain23 + False + ant23 @@ -1281,6 +1268,10 @@ gain24 0 + + norm_gain24 + False + ant24 @@ -1297,6 +1288,10 @@ gain25 0 + + norm_gain25 + False + ant25 @@ -1313,6 +1308,10 @@ gain26 0 + + norm_gain26 + False + ant26 @@ -1329,6 +1328,10 @@ gain27 0 + + norm_gain27 + False + ant27 @@ -1345,6 +1348,10 @@ gain28 0 + + norm_gain28 + False + ant28 @@ -1361,6 +1368,10 @@ gain29 0 + + norm_gain29 + False + ant29 @@ -1377,6 +1388,10 @@ gain30 0 + + norm_gain30 + False + ant30 @@ -1393,6 +1408,10 @@ gain31 0 + + norm_gain31 + False + ant31 @@ -1422,6 +1441,116 @@ 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 + + + + alias + + + + _coordinate + (419, 11) + + + _rotation + 0 + + + + variable_chooser + + id + lo_offset + + + _enabled + True + + + label + LO Offset + + + value + 0 + + + choices + [0, 6e6, 11e6] + + + labels + ['0 MHz', '6 MHz', '11 MHz'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (697, 165) + + + _rotation + 0 + + blocks_message_strobe_0 ieee802_11_ofdm_mac_0 From 2da34033c68f5d1c32344f19e7a80f1db40b0ebd Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Tue, 14 Apr 2015 13:56:37 +0200 Subject: [PATCH 25/38] ofdm_parse_mac: initialize to -1 to avoid bogus rolling fer value --- lib/ofdm_parse_mac.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ofdm_parse_mac.cc b/lib/ofdm_parse_mac.cc index 832e829..79c7b60 100644 --- a/lib/ofdm_parse_mac.cc +++ b/lib/ofdm_parse_mac.cc @@ -31,7 +31,7 @@ ofdm_parse_mac_impl(bool log, bool debug) : block("ofdm_parse_mac", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), - d_log(log), d_last_seq_no(0), + d_log(log), d_last_seq_no(-1), d_debug(debug) { message_port_register_in(pmt::mp("in")); From 67da108d2fe707c2afc43e1b3ac82af3c590bf25 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 17:13:49 +0200 Subject: [PATCH 26/38] max bits was too short --- lib/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.h b/lib/utils.h index a2c72e2..1e42242 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -24,7 +24,7 @@ #include const int MAX_SYM = 520; // enough for 1500 byte BPSK 1/2 -const int MAX_BITS = 1530 * 8; +const int MAX_BITS = 1550 * 8 * 2; #define dout d_debug && std::cout From e11c6021036a2ab3b627a504439237ec17ce8484 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 17:31:54 +0200 Subject: [PATCH 27/38] remove senseless check --- lib/ofdm_parse_mac.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/ofdm_parse_mac.cc b/lib/ofdm_parse_mac.cc index 79c7b60..deaac5c 100644 --- a/lib/ofdm_parse_mac.cc +++ b/lib/ofdm_parse_mac.cc @@ -91,10 +91,6 @@ void parse(pmt::pmt_t msg) { break; } - if(data_len < 32) { - return; - } - char *frame = (char*)pmt::blob_data(msg); // DATA From 1da4e67332c87ca90e88beed3a592baf9a3a8ca3 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 17:41:11 +0200 Subject: [PATCH 28/38] mac: crc is already removed --- lib/ofdm_mac.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ofdm_mac.cc b/lib/ofdm_mac.cc index 527de37..57d69f3 100644 --- a/lib/ofdm_mac.cc +++ b/lib/ofdm_mac.cc @@ -69,10 +69,12 @@ void phy_in (pmt::pmt_t msg) { if (!pmt::is_blob(pmt::cdr(msg))) throw std::runtime_error("PMT must be blob"); - // strip MAC header and CRC + // strip MAC header + // TODO: check for frame type to determine header size pmt::pmt_t blob(pmt::cdr(msg)); const char *mpdu = reinterpret_cast(pmt::blob_data(blob)); - pmt::pmt_t msdu = pmt::make_blob(mpdu + 24, pmt::blob_length(blob) - 24 - 4); + std::cout << "pdu len " << pmt::blob_length(blob) << std::endl; + pmt::pmt_t msdu = pmt::make_blob(mpdu + 24, pmt::blob_length(blob) - 24); message_port_pub(pmt::mp("app out"), pmt::cons(pmt::car(msg), msdu)); } From 57e88af9bc90b0e358a568d16d12a98d4e567088 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 14 Apr 2015 17:52:21 +0200 Subject: [PATCH 29/38] simplify fer calculation --- lib/ofdm_parse_mac.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ofdm_parse_mac.cc b/lib/ofdm_parse_mac.cc index deaac5c..cca87b8 100644 --- a/lib/ofdm_parse_mac.cc +++ b/lib/ofdm_parse_mac.cc @@ -258,12 +258,12 @@ void parse_data(char *buf, int length) { dout << "mac 3: "; print_mac_address(h->addr3, true); - int lost_frames = seq_no - d_last_seq_no - 1; - dout << "d_last_seq_no: " << d_last_seq_no << std::endl; - dout << "lost frames: " << lost_frames << std::endl; + float lost_frames = seq_no - d_last_seq_no - 1; + if(lost_frames < 0) + lost_frames += 1 << 12; // calculate frame error rate - float fer = 1 - (1 / (static_cast(lost_frames) + 1)); + float fer = lost_frames / (lost_frames + 1); dout << "instantaneous fer: " << fer << std::endl; // keep track of values From 2e8d3493c599f6acef329f2b341b1f7be064a33e Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 17 Apr 2015 10:21:28 +0200 Subject: [PATCH 30/38] short: detect frames during copying and correct frequency offset --- grc/ieee802_11_ofdm_sync_short.xml | 16 +++---- include/ieee802-11/ofdm_sync_short.h | 3 +- lib/ofdm_sync_short.cc | 66 ++++++++++++++-------------- 3 files changed, 40 insertions(+), 45 deletions(-) diff --git a/grc/ieee802_11_ofdm_sync_short.xml b/grc/ieee802_11_ofdm_sync_short.xml index 5ee8da9..0913174 100644 --- a/grc/ieee802_11_ofdm_sync_short.xml +++ b/grc/ieee802_11_ofdm_sync_short.xml @@ -5,7 +5,7 @@ ieee802_11_ofdm_sync_short IEEE802.11 import ieee802_11 - ieee802_11.ofdm_sync_short($threshold, $max_samples, $min_plateau, $log, $debug) + ieee802_11.ofdm_sync_short($threshold, $min_plateau, $log, $debug) Log @@ -46,13 +46,6 @@ real - - Max Samples - max_samples - 5200 - int - - Min Plateau min_plateau @@ -61,7 +54,6 @@ $threshold > 0 - $max_samples > 400 $min_plateau > 0 @@ -70,6 +62,12 @@ 1 + + abs + complex + 1 + + cor float diff --git a/include/ieee802-11/ofdm_sync_short.h b/include/ieee802-11/ofdm_sync_short.h index 2bfbca2..94d56e8 100644 --- a/include/ieee802-11/ofdm_sync_short.h +++ b/include/ieee802-11/ofdm_sync_short.h @@ -28,8 +28,7 @@ class IEEE802_11_API ofdm_sync_short : virtual public block public: typedef boost::shared_ptr sptr; - static sptr make(double threshold, unsigned int max_samples, - unsigned int min_plateau, bool log = false, bool debug = false); + static sptr make(double threshold, unsigned int min_plateau, bool log = false, bool debug = false); }; diff --git a/lib/ofdm_sync_short.cc b/lib/ofdm_sync_short.cc index 11990fd..5c715a3 100644 --- a/lib/ofdm_sync_short.cc +++ b/lib/ofdm_sync_short.cc @@ -23,38 +23,38 @@ using namespace gr::ieee802_11; static const int MIN_GAP = 480; +static const int MAX_SAMPLES = 540 * 80; class ofdm_sync_short_impl : public ofdm_sync_short { public: -ofdm_sync_short_impl(double threshold, unsigned int max_samples, - unsigned int min_plateau, bool log, bool debug) : block("ofdm_sync_short", - gr::io_signature::make2(2, 2, sizeof(gr_complex), sizeof(float)), +ofdm_sync_short_impl(double threshold, unsigned int min_plateau, bool log, bool debug) : + block("ofdm_sync_short", + gr::io_signature::make3(3, 3, sizeof(gr_complex), sizeof(gr_complex), sizeof(float)), gr::io_signature::make(1, 1, sizeof(gr_complex))), - d_log(log), - d_debug(debug), - d_state(SEARCH), - d_plateau(0), - MAX_SAMPLES(max_samples), - MIN_PLATEAU(min_plateau), - d_threshold(threshold) { + d_log(log), + d_debug(debug), + d_state(SEARCH), + d_plateau(0), + d_freq_offset(0), + d_copied(0), + MIN_PLATEAU(min_plateau), + d_threshold(threshold) { set_tag_propagation_policy(block::TPP_DONT); } -~ofdm_sync_short_impl(){ -} - int general_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]; - const float *in2 = (const float*)input_items[1]; + const gr_complex *in_abs = (const gr_complex*)input_items[1]; + const float *in_cor = (const float*)input_items[2]; gr_complex *out = (gr_complex*)output_items[0]; int noutput = noutput_items; - int ninput = std::min(ninput_items[0], ninput_items[1]); + int ninput = std::min(std::min(ninput_items[0], ninput_items[1]), ninput_items[2]); // dout << "SHORT noutput : " << noutput << " ninput: " << ninput_items[0] << std::endl; @@ -64,13 +64,14 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, int i; for(i = 0; i < ninput; i++) { - if(in2[i] > d_threshold) { + if(in_cor[i] > d_threshold) { if(d_plateau < MIN_PLATEAU) { d_plateau++; } else { d_state = COPY; - d_copy_left = MAX_SAMPLES; + d_copied = 0; + d_freq_offset = arg(in_abs[i]) / 16; d_plateau = 0; insert_tag(nitems_written(0)); dout << "SHORT Frame!" << std::endl; @@ -81,23 +82,23 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, } } - consume(0, i); - consume(1, i); + consume_each(i); return 0; } case COPY: { int o = 0; - while( (o < ninput) && (o < noutput) && d_copy_left) { - if(in2[o] > d_threshold) { + while( o < ninput && o < noutput && d_copied < MAX_SAMPLES) { + if(in_cor[o] > d_threshold) { if(d_plateau < MIN_PLATEAU) { d_plateau++; // there's another frame - } else if((MAX_SAMPLES - d_copy_left) > MIN_GAP) { - d_copy_left = MAX_SAMPLES; + } else if(d_copied > MIN_GAP) { + d_copied = 0; d_plateau = 0; + d_freq_offset = arg(in_abs[o]) / 16; insert_tag(nitems_written(0) + o); dout << "SHORT Frame!" << std::endl; break; @@ -107,19 +108,18 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, d_plateau = 0; } - out[o] = in[o]; + out[o] = in[o] * exp(gr_complex(0, -d_freq_offset * d_copied)); o++; - d_copy_left--; + d_copied++; } - if(!d_copy_left) { + if(d_copied == MAX_SAMPLES) { d_state = SEARCH; } dout << "SHORT copied " << o << std::endl; - consume(0, o); - consume(1, o); + consume_each(o); return o; } } @@ -139,18 +139,16 @@ void insert_tag(uint64_t item) { private: enum {SEARCH, COPY} d_state; - int d_copy_left; + int d_copied; int d_plateau; + float d_freq_offset; const double d_threshold; const bool d_log; const bool d_debug; - const unsigned int MAX_SAMPLES; const unsigned int MIN_PLATEAU; }; ofdm_sync_short::sptr -ofdm_sync_short::make(double threshold, unsigned int max_samples, - unsigned int min_plateau, bool log, bool debug) { - return gnuradio::get_initial_sptr(new ofdm_sync_short_impl(threshold, - max_samples, min_plateau, log, debug)); +ofdm_sync_short::make(double threshold, unsigned int min_plateau, bool log, bool debug) { + return gnuradio::get_initial_sptr(new ofdm_sync_short_impl(threshold, min_plateau, log, debug)); } From d8425932f672f229e0cb46dac9c616bacae56018 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 17 Apr 2015 10:21:46 +0200 Subject: [PATCH 31/38] parse_mac: fix fer calculation --- lib/ofdm_parse_mac.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ofdm_parse_mac.cc b/lib/ofdm_parse_mac.cc index cca87b8..957faf1 100644 --- a/lib/ofdm_parse_mac.cc +++ b/lib/ofdm_parse_mac.cc @@ -270,7 +270,7 @@ void parse_data(char *buf, int length) { d_last_seq_no = seq_no; // publish FER estimate - pmt::pmt_t pdu = pmt::make_f32vector(1, fer * 100); + pmt::pmt_t pdu = pmt::make_f32vector(lost_frames + 1, fer * 100); message_port_pub(pmt::mp("fer"), pmt::cons( pmt::PMT_NIL, pdu )); } From 0687df370c2d7d78c00cdab86d78c672f0e4c6a4 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 17 Apr 2015 10:21:58 +0200 Subject: [PATCH 32/38] mapper: nicer options in grc --- grc/ieee802_11_ofdm_mapper.xml | 35 +++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/grc/ieee802_11_ofdm_mapper.xml b/grc/ieee802_11_ofdm_mapper.xml index 73399eb..baa9915 100644 --- a/grc/ieee802_11_ofdm_mapper.xml +++ b/grc/ieee802_11_ofdm_mapper.xml @@ -11,8 +11,41 @@ Encoding encoding - 0 + ieee802_11.BPSK_1_2 int + + + + + + + + + From 00e57632b9cdcf7676e7efceb9328fb39d877a8b Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 17 Apr 2015 10:22:32 +0200 Subject: [PATCH 33/38] mac: set duration to 0 and allocate statically --- lib/ofdm_mac.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/ofdm_mac.cc b/lib/ofdm_mac.cc index 57d69f3..b16dd2f 100644 --- a/lib/ofdm_mac.cc +++ b/lib/ofdm_mac.cc @@ -106,30 +106,31 @@ void app_in (pmt::pmt_t msg) { return; } + if(msg_len > 1500) { + throw std::invalid_argument("Frame too large (> 1500)"); + } + // make MAC frame int psdu_length; - char *psdu; - generate_mac_data_frame(msdu, msg_len, &psdu, &psdu_length); + generate_mac_data_frame(msdu, msg_len, &psdu_length); // dict pmt::pmt_t dict = pmt::make_dict(); dict = pmt::dict_add(dict, pmt::mp("crc_included"), pmt::PMT_T); // blob - pmt::pmt_t mac = pmt::make_blob(psdu, psdu_length); + pmt::pmt_t mac = pmt::make_blob(d_psdu, psdu_length); // pdu message_port_pub(pmt::mp("phy out"), pmt::cons(dict, mac)); - - free(psdu); } -void generate_mac_data_frame(const char *msdu, int msdu_size, char **psdu, int *psdu_size) { +void generate_mac_data_frame(const char *msdu, int msdu_size, int *psdu_size) { // mac header mac_header header; header.frame_control = 0x0008; - header.duration = 0x002e; + header.duration = 0x0000; for(int i = 0; i < 6; i++) { header.addr1[i] = d_dst_mac[i]; @@ -148,18 +149,17 @@ void generate_mac_data_frame(const char *msdu, int msdu_size, char **psdu, int * //header size is 24, plus 4 for FCS means 28 bytes *psdu_size = 28 + msdu_size; - *psdu = (char *) calloc(*psdu_size, sizeof(char)); //copy mac header into psdu - std::memcpy(*psdu, &header, 24); + std::memcpy(d_psdu, &header, 24); //copy msdu into psdu - memcpy(*psdu + 24, msdu, msdu_size); + memcpy(d_psdu + 24, msdu, msdu_size); //compute and store fcs boost::crc_32_type result; - result.process_bytes(*psdu, msdu_size + 24); + result.process_bytes(d_psdu, msdu_size + 24); - unsigned int fcs = result.checksum(); - memcpy(*psdu + msdu_size + 24, &fcs, sizeof(unsigned int)); + uint32_t fcs = result.checksum(); + memcpy(d_psdu + msdu_size + 24, &fcs, sizeof(uint32_t)); } bool check_mac(std::vector mac) { @@ -172,6 +172,7 @@ private: uint8_t d_src_mac[6]; uint8_t d_dst_mac[6]; uint8_t d_bss_mac[6]; + uint8_t d_psdu[1528]; }; ofdm_mac::sptr From 5dd30e5e8419a28e7b71fe68a08be83f512311ca Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 17 Apr 2015 10:22:58 +0200 Subject: [PATCH 34/38] long: copy also long preamble for channel estimation --- lib/ofdm_sync_long.cc | 109 ++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/lib/ofdm_sync_long.cc b/lib/ofdm_sync_long.cc index 21b6d79..947ff6d 100644 --- a/lib/ofdm_sync_long.cc +++ b/lib/ofdm_sync_long.cc @@ -27,29 +27,29 @@ using namespace gr::ieee802_11; using namespace std; +bool compare_abs(const std::pair& first, const std::pair& second) { + return abs(get<0>(first)) > abs(get<0>(second)); +} + class ofdm_sync_long_impl : public ofdm_sync_long { public: ofdm_sync_long_impl(unsigned int sync_length, bool log, bool debug) : block("ofdm_sync_long", gr::io_signature::make2(2, 2, sizeof(gr_complex), sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex))), + d_fir(gr::filter::kernel::fir_filter_ccc(1, LONG)), d_log(log), d_debug(debug), d_offset(0), - d_freq_est(0), d_state(SYNC), SYNC_LENGTH(sync_length) { set_tag_propagation_policy(block::TPP_DONT); - d_fir = new gr::filter::kernel::fir_filter_ccc(1, LONG); d_correlation = gr::fft::malloc_complex(8192); - d_freq_est_buf = static_cast(std::malloc(sync_length * sizeof(gr_complex))); } ~ofdm_sync_long_impl(){ - delete d_fir; gr::fft::free(d_correlation); - free(d_freq_est_buf); } int general_work (int noutput, gr_vector_int& ninput_items, @@ -64,19 +64,21 @@ int general_work (int noutput, gr_vector_int& ninput_items, ninput_items[1] << " noutput " << noutput << " state " << d_state << std::endl; - int ninput = std::min(ninput_items[0], ninput_items[1]); + int ninput = std::min(std::min(ninput_items[0], ninput_items[1]), 8192); const unsigned int nread = nitems_read(0); get_tags_in_range(d_tags, 0, nread, nread + ninput); if (d_tags.size()) { std::sort(d_tags.begin(), d_tags.end(), gr::tag_t::offset_compare); - const gr::tag_t &tag = d_tags.front(); - const uint64_t offset = tag.offset; + const uint64_t offset = d_tags.front().offset; if(offset > nread) { ninput = offset - nread; } else { + if(d_offset && (d_state == SYNC)) { + throw std::runtime_error("wtf"); + } if(d_state == COPY) { d_state = RESET; } @@ -90,26 +92,20 @@ int general_work (int noutput, gr_vector_int& ninput_items, switch(d_state) { case SYNC: - d_fir->filterN(d_correlation, in, std::min(SYNC_LENGTH, std::max(ninput - 63, 0))); + d_fir.filterN(d_correlation, in, std::min(SYNC_LENGTH, std::max(ninput - 63, 0))); while(i + 63 < ninput) { - d_freq_est += in[i] * conj(in[i + 16]); - d_freq_est_buf[d_offset] = d_freq_est; - - d_cor.push_back(pair(abs(d_correlation[i]), d_offset)); + d_cor.push_back(pair(d_correlation[i], d_offset)); i++; d_offset++; if(d_offset == SYNC_LENGTH) { search_frame_start(); - d_freq_est = d_freq_est_buf[std::max(0, d_frame_start - 160 - 17)]; d_offset = 0; d_state = COPY; - mylog(boost::format("frame at %1% - freq_est (20M): %2%") % d_frame_start - % ((arg(d_freq_est) / 16) * 20e6 / (2 * M_PI))); break; } } @@ -117,59 +113,53 @@ int general_work (int noutput, gr_vector_int& ninput_items, break; case COPY: - while(i < ninput) { + while(i < ninput && o < noutput) { int rel = d_offset - d_frame_start; - if( (rel >= 0) && (rel % 80 > 15)) { - if(o >= noutput) { - break; - } + if(!rel) { + add_item_tag(0, nitems_written(0), + pmt::string_to_symbol("ofdm_start"), + pmt::PMT_T, + pmt::string_to_symbol(name())); + } - if(rel == 16) { - assert(o == 0); - add_item_tag(0, nitems_written(0) + o, - pmt::string_to_symbol("ofdm_start"), - pmt::PMT_T, - pmt::string_to_symbol(name())); - } - - out[o] = in_delayed[i] * exp(gr_complex(0, d_offset * arg(d_freq_est) / 16)); + if(rel >= 0 && (rel < 128 || ((rel - 128) % 80) > 15)) { + out[o] = in_delayed[i] * exp(gr_complex(0, d_offset * d_freq_offset)); o++; - } i++; d_offset++; + if(d_offset == 1) { + dout << "produced " << d_count << " " << d_count / 64.0 << std::endl; + d_count = 0; + } } break; - case RESET: + case RESET: { + int h = 0; while(o < noutput) { - int rel = (d_offset - d_frame_start) % 80; - - if(!rel) { + if(((d_count + h) % 64) == 0) { d_offset = 0; - d_freq_est = gr_complex(0, 0); d_state = SYNC; break; - } else if(rel > 15) { + } else { out[o] = 0; o++; } - d_offset++; + h++; } break; - - default: - std::runtime_error("bad state"); - break; + } } dout << "produced : " << o << " consumed: " << i << std::endl; + d_count += o; consume(0, i); consume(1, i); return o; @@ -193,11 +183,10 @@ void search_frame_start() { // sort list (highest correlation first) assert(d_cor.size() == SYNC_LENGTH); - d_cor.sort(); - d_cor.reverse(); + d_cor.sort(compare_abs); // copy list in vector for nicer access - vector > vec(d_cor.begin(), d_cor.end()); + vector > vec(d_cor.begin(), d_cor.end()); d_cor.clear(); // in case we don't find anything use SYNC_LENGTH @@ -205,17 +194,30 @@ void search_frame_start() { for(int i = 0; i < 3; i++) { for(int k = i + 1; k < 4; k++) { - int diff = abs(get<1>(vec[i]) - get<1>(vec[k])); + gr_complex first; + gr_complex second; + if(get<1>(vec[i]) > get<1>(vec[k])) { + first = get<0>(vec[k]); + second = get<0>(vec[i]); + } else { + first = get<0>(vec[i]); + second = get<0>(vec[k]); + } + int diff = abs(get<1>(vec[i]) - get<1>(vec[k])); if(diff == 64) { - d_frame_start = max(get<1>(vec[i]), get<1>(vec[k])) + 64; + d_frame_start = max(get<1>(vec[i]), get<1>(vec[k])) + 64 - 128 - 1; + d_freq_offset = arg(first * conj(second)) / 64; + //std::cout << "frequency offset " << d_freq_offset << std::endl; // nice match found, return immediately return; // TODO: check if these offsets make sense } else if(diff == 63) { - d_frame_start = max(get<1>(vec[i]), get<1>(vec[k])) + 63; + d_frame_start = max(get<1>(vec[i]), get<1>(vec[k])) + 63 - 128 - 1; + d_freq_offset = arg(first * conj(second)) / 64; } else if(diff == 65) { - d_frame_start = max(get<1>(vec[i]), get<1>(vec[k])) + 64; + d_frame_start = max(get<1>(vec[i]), get<1>(vec[k])) + 64 - 128 - 1; + d_freq_offset = arg(first * conj(second)) / 64; } } } @@ -223,14 +225,15 @@ void search_frame_start() { private: enum {SYNC, COPY, RESET} d_state; + int d_count; int d_offset; int d_frame_start; - gr_complex d_freq_est; + float d_freq_offset; + gr_complex *d_correlation; - gr_complex *d_freq_est_buf; - list > d_cor; + list > d_cor; std::vector d_tags; - gr::filter::kernel::fir_filter_ccc *d_fir; + gr::filter::kernel::fir_filter_ccc d_fir; const bool d_log; const bool d_debug; From 48950a502b1bb4c6f3031cdd29bbb22ae99ed98d Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 17 Apr 2015 10:23:25 +0200 Subject: [PATCH 35/38] use long preamble for channel estimation and add lms equalizer --- grc/ieee802_11_ofdm_equalize_symbols.xml | 19 +++- include/ieee802-11/ofdm_equalize_symbols.h | 10 +- lib/CMakeLists.txt | 2 + lib/equalizer/base.h | 37 +++++++ lib/equalizer/linear_comb.cc | 63 ++++++++++++ lib/equalizer/linear_comb.h | 39 ++++++++ lib/equalizer/lms.cc | 104 ++++++++++++++++++++ lib/equalizer/lms.h | 42 ++++++++ lib/ofdm_equalize_symbols.cc | 108 ++++++++++----------- 9 files changed, 364 insertions(+), 60 deletions(-) create mode 100644 lib/equalizer/base.h create mode 100644 lib/equalizer/linear_comb.cc create mode 100644 lib/equalizer/linear_comb.h create mode 100644 lib/equalizer/lms.cc create mode 100644 lib/equalizer/lms.h diff --git a/grc/ieee802_11_ofdm_equalize_symbols.xml b/grc/ieee802_11_ofdm_equalize_symbols.xml index 479f3a3..5056085 100644 --- a/grc/ieee802_11_ofdm_equalize_symbols.xml +++ b/grc/ieee802_11_ofdm_equalize_symbols.xml @@ -5,7 +5,24 @@ ieee802_11_ofdm_equalize_symbols IEEE802.11 import ieee802_11 - ieee802_11.ofdm_equalize_symbols($debug) + ieee802_11.ofdm_equalize_symbols($algo, $debug) + set_algorithm($algo) + + + Algorithm + algo + ieee802_11.LINEAR_COMB + int + + + + Debug diff --git a/include/ieee802-11/ofdm_equalize_symbols.h b/include/ieee802-11/ofdm_equalize_symbols.h index 143b265..d9a1cc4 100644 --- a/include/ieee802-11/ofdm_equalize_symbols.h +++ b/include/ieee802-11/ofdm_equalize_symbols.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Bastian Bloessl + * Copyright (C) 2013, 2015 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 @@ -20,6 +20,11 @@ #include #include +enum Equalizer { + LMS = 0, + LINEAR_COMB = 1, +}; + namespace gr { namespace ieee802_11 { @@ -28,7 +33,8 @@ class IEEE802_11_API ofdm_equalize_symbols : virtual public block public: typedef boost::shared_ptr sptr; - static sptr make(bool debug = false); + static sptr make(Equalizer algo, bool debug = false); + virtual void set_algorithm(Equalizer algo) = 0; }; diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index b615b10..10c06f0 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -94,6 +94,8 @@ add_dependencies(ieee802_11_generated_sources ieee802_11_generated_includes) ######################################################################## list(APPEND gr_ieee802_11_sources ${generated_sources} + equalizer/linear_comb.cc + equalizer/lms.cc chunks_to_symbols_impl.cc ether_encap_impl.cc ofdm_decode_mac.cc diff --git a/lib/equalizer/base.h b/lib/equalizer/base.h new file mode 100644 index 0000000..1e8ffb5 --- /dev/null +++ b/lib/equalizer/base.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2015 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_EQUALIZER_BASE_H +#define INCLUDED_IEEE802_11_EQUALIZER_BASE_H + +#include + +namespace gr { +namespace ieee802_11 { +namespace equalizer { + +class base { +public: + virtual ~base() {}; + virtual void equalize(const gr_complex *in, gr_complex *out, int n) = 0; +}; + +} /* namespace channel_estimation */ +} /* namespace ieee802_11 */ +} /* namespace gr */ + +#endif /* INCLUDED_IEEE802_11_EQUALIZER_BASE_H */ diff --git a/lib/equalizer/linear_comb.cc b/lib/equalizer/linear_comb.cc new file mode 100644 index 0000000..455deaa --- /dev/null +++ b/lib/equalizer/linear_comb.cc @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2015 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 "linear_comb.h" + +using namespace gr::ieee802_11::equalizer; + +void linear_comb::equalize(const gr_complex *in, gr_complex *out, int n) { + if(n < 2) + return; + + double avg_mag = (abs(in[11]) + abs(in[25]) + abs(in[39]) + abs(in[53])) / 4; + + gr_complex p = POLARITY[(n - 2) % 127 ]; + + double p1 = arg( p * in[11]); + double p2 = arg( p * in[25] * conj(p * in[11])) + p1; + double p3 = arg( p * in[39] * conj(p * in[25])) + p2; + double p4 = arg(-p * in[53] * conj(p * in[39])) + p3; + + double my = (p1 + p2 + p3 + p4) / 4; + double mx = (11.0 + 25 + 39 + 53) / 4; + + double var = (((11.0 * 11.0) + (25.0 * 25.0) + (39.0 * 39.0) + (53.0 * 53.0)) / 4) - (mx * mx); + double cov = (( (p1 * 11) + (p2 * 25) + (p3 * 39) + (p4 * 53) ) / 4) - (mx * my); + double beta = cov / var; + double alpha = my - beta * mx; + + int c = 0; + for(int n = 0; n < 64; n++) { + if( (n == 11) || (n == 25) || (n == 32) || (n == 39) || (n == 53) || (n < 6) || ( n > 58)) { + continue; + } else { + out[c] = in[n] * exp(gr_complex(0, -n * beta - alpha)) * gr_complex(1 / avg_mag, 0); + c++; + } + } + +} + +const gr_complex linear_comb::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 }; diff --git a/lib/equalizer/linear_comb.h b/lib/equalizer/linear_comb.h new file mode 100644 index 0000000..dc598cc --- /dev/null +++ b/lib/equalizer/linear_comb.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2015 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_EQUALIZER_LINEAR_COMB_H +#define INCLUDED_IEEE802_11_EQUALIZER_LINEAR_COMB_H + +#include "base.h" + +namespace gr { +namespace ieee802_11 { +namespace equalizer { + +class linear_comb: public base { +public: + virtual void equalize(const gr_complex *in, gr_complex *out, int n); +private: + static const gr_complex POLARITY[127]; +}; + +} /* namespace channel_estimation */ +} /* namespace ieee802_11 */ +} /* namespace gr */ + +#endif /* INCLUDED_IEEE802_11_EQUALIZER_LINEAR_COMB_H */ + diff --git a/lib/equalizer/lms.cc b/lib/equalizer/lms.cc new file mode 100644 index 0000000..65dddf3 --- /dev/null +++ b/lib/equalizer/lms.cc @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2015 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 "lms.h" +#include +#include + +using namespace gr::ieee802_11::equalizer; + +void lms::equalize(const gr_complex *in, gr_complex *out, int n) { + + static float freq_offset = 0; + static float freq_sum = 0; + static float alpha = 0.9; + + if(n == 0) { + std::memcpy(carrier, in, 64 * sizeof(gr_complex)); + } else if(n == 1) { + gr_complex sum = + (carrier[11] * conj(in[11])) + + (carrier[25] * conj(in[25])) + + (carrier[39] * conj(in[39])) + + (carrier[53] * conj(in[53])); + freq_offset = arg(sum); + freq_sum = 0; + for(int i = 0; i < 64; i++) { + carrier[i] += in[i]; + carrier[i] *= ref[i] * gr_complex(0.5, 0); + } + } else { + + gr_complex p = POLARITY[(n - 2) % 127]; + gr_complex sum = + (carrier[11] * conj(in[11]) * p) + + (carrier[25] * conj(in[25]) * p) + + (carrier[39] * conj(in[39]) * p) + + (carrier[53] * conj(in[53]) * -p); + + freq_offset = (1 - alpha) * freq_offset + alpha * arg(sum); + freq_sum += freq_offset; + + //std::cout << "lms: symbol " << n + // << " p1 " << abs(carrier[11] * conj(in[11]) * p) + // << " p2 " << abs(carrier[25] * conj(in[25]) * p) + // << " p3 " << abs(carrier[39] * conj(in[39]) * p) + // << " p4 " << abs(carrier[53] * conj(in[53]) * -p) + // << std::endl; + //std::cout << "lms: symbol " << n + // << " p1 " << arg(carrier[11] * conj(in[11]) * p) + // << " p2 " << arg(carrier[25] * conj(in[25]) * p) + // << " p3 " << arg(carrier[39] * conj(in[39]) * p) + // << " p4 " << arg(carrier[53] * conj(in[53]) * -p) + // << std::endl; + + carrier[11] = in[11] * p; + carrier[25] = in[25] * p; + carrier[39] = in[39] * p; + carrier[53] = in[53] * -p; + + int c = 0; + for(int i = 0; i < 64; i++) { + if( (i == 11) || (i == 25) || (i == 32) || (i == 39) || (i == 53) || (i < 6) || ( i > 58)) { + continue; + } else { + out[c] = in[i] / carrier[i] * exp(gr_complex(0, freq_sum)); + c++; + } + } + } +} + +const gr_complex lms::ref[] = { + 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 +}; + +const gr_complex lms::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 }; diff --git a/lib/equalizer/lms.h b/lib/equalizer/lms.h new file mode 100644 index 0000000..c6d1d2f --- /dev/null +++ b/lib/equalizer/lms.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2015 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_EQUALIZER_LMS_H +#define INCLUDED_IEEE802_11_EQUALIZER_LMS_H + +#include "base.h" +#include + +namespace gr { +namespace ieee802_11 { +namespace equalizer { + +class lms: public base { +public: + virtual void equalize(const gr_complex *in, gr_complex *out, int n); +private: + gr_complex carrier[64]; + static const gr_complex ref[64]; + static const gr_complex POLARITY[127]; +}; + +} /* namespace channel_estimation */ +} /* namespace ieee802_11 */ +} /* namespace gr */ + +#endif /* INCLUDED_IEEE802_11_EQUALIZER_LMS_H */ + diff --git a/lib/ofdm_equalize_symbols.cc b/lib/ofdm_equalize_symbols.cc index a755d86..22f77be 100644 --- a/lib/ofdm_equalize_symbols.cc +++ b/lib/ofdm_equalize_symbols.cc @@ -17,6 +17,9 @@ #include #include "utils.h" +#include "equalizer/base.h" +#include "equalizer/linear_comb.h" +#include "equalizer/lms.h" #include using namespace gr::ieee802_11; @@ -25,12 +28,14 @@ using namespace gr::ieee802_11; class ofdm_equalize_symbols_impl : public ofdm_equalize_symbols { public: -ofdm_equalize_symbols_impl(bool debug) : block("ofdm_equalize_symbols", +ofdm_equalize_symbols_impl(Equalizer algo, bool debug) : block("ofdm_equalize_symbols", gr::io_signature::make(1, 1, 64 * sizeof(gr_complex)), gr::io_signature::make(1, 1, 48 * sizeof(gr_complex))), - d_debug(debug) { + d_debug(debug), d_equalizer(NULL) { set_relative_rate(1); + set_tag_propagation_policy(block::TPP_DONT); + set_algorithm(algo); } ~ofdm_equalize_symbols_impl(){ @@ -40,87 +45,76 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items) { + gr::thread::scoped_lock lock(d_mutex); + const gr_complex *in = (const gr_complex*)input_items[0]; gr_complex *out = (gr_complex*)output_items[0]; - int noutput = noutput_items; int i = 0; - - std::vector tags; - const uint64_t nread = nitems_read(0); + int o = 0; dout << "SYMBOLS: input " << ninput_items[0] << " output " << noutput_items << std::endl; - while((i < ninput_items[0]) && (i < noutput)) { + while((i < ninput_items[0]) && (o < noutput_items)) { - get_tags_in_range(tags, 0, nread + i, nread + i + 1, - pmt::string_to_symbol("ofdm_start")); + get_tags_in_window(tags, 0, i, i + 1, pmt::string_to_symbol("ofdm_start")); + // new WiFi frame if(tags.size()) { - index = 0; + d_nsym = 0; } - gr_complex p = POLARITY[index]; - index++; - index %= 127; - - // FIXME: think about this... average over amplitude or power - double avg_mag = (abs(in[11]) + abs(in[25]) + abs(in[39]) + abs(in[53])) / 4; - - - double p1 = arg( p * in[11]); - double p2 = arg( p * in[25] * conj(p * in[11])) + p1; - double p3 = arg( p * in[39] * conj(p * in[25])) + p2; - double p4 = arg(-p * in[53] * conj(p * in[39])) + p3; - - double my = (p1 + p2 + p3 + p4) / 4; - double mx = (11.0 + 25 + 39 + 53) / 4; - - double var = (((11.0 * 11.0) + (25.0 * 25.0) + (39.0 * 39.0) + (53.0 * 53.0)) / 4) - (mx * mx); - double cov = (( (p1 * 11) + (p2 * 25) + (p3 * 39) + (p4 * 53) ) / 4) - (mx * my); - double beta = cov / var; - double alpha = my - beta * mx; - - int o = 0; - for(int n = 0; n < 64; n++) { - if( (n == 11) || (n == 25) || (n == 32) || (n == 39) || (n == 53) || (n < 6) || ( n > 58)) { - continue; - } else { - // FIXME: think about this... square or not - out[o] = in[n] * exp(gr_complex(0, -n * beta - alpha)) * gr_complex(1 / avg_mag, 0); - o++; - } + // first data symbol (= signal field) + if(d_nsym == 2) { + add_item_tag(0, nitems_written(0) + o, + pmt::string_to_symbol("ofdm_start"), + pmt::PMT_T, + pmt::string_to_symbol(name())); } + d_equalizer->equalize(in + (i * 64), out + (o * 48), d_nsym); + + if(d_nsym > 1) { + o++; + } i++; - in += 64; - out += 48; + d_nsym++; } - dout << "SYMBOLS: produced / consumed " << i << std::endl; + dout << "SYMBOLS: consumed " << i << " produced " << o << std::endl; consume(0, i); - return i; + return o; +} + +void set_algorithm(Equalizer algo) { + gr::thread::scoped_lock lock(d_mutex); + delete d_equalizer; + + switch(algo) { + case LMS: + dout << "LMS" << std::endl; + d_equalizer = new equalizer::lms(); + break; + + case LINEAR_COMB: + dout << "Linear Comb" << std::endl; + d_equalizer = new equalizer::linear_comb(); + break; + } } private: - int index; + int d_nsym; const bool d_debug; - static const gr_complex POLARITY[127]; + equalizer::base *d_equalizer; + std::vector tags; + gr::thread::mutex d_mutex; }; -const gr_complex ofdm_equalize_symbols_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_equalize_symbols::sptr -ofdm_equalize_symbols::make(bool debug) { - return gnuradio::get_initial_sptr(new ofdm_equalize_symbols_impl(debug)); +ofdm_equalize_symbols::make(Equalizer algo, bool debug) { + return gnuradio::get_initial_sptr(new ofdm_equalize_symbols_impl(algo, debug)); } From 607eb81c9f94e85008cf1a2116e4f9f04f8619f6 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 17 Apr 2015 10:24:45 +0200 Subject: [PATCH 36/38] update flow graphs --- examples/wifi_loopback.grc | 856 +++++++------ examples/wifi_phy_hier.grc | 1835 ++++++++++++++------------- examples/wifi_rx.grc | 2417 +++++++++++++++++++----------------- 3 files changed, 2753 insertions(+), 2355 deletions(-) diff --git a/examples/wifi_loopback.grc b/examples/wifi_loopback.grc index 5f13080..0359935 100644 --- a/examples/wifi_loopback.grc +++ b/examples/wifi_loopback.grc @@ -65,33 +65,6 @@ 0 - - variable - - id - out_buf_size - - - _enabled - True - - - value - 96000 - - - alias - - - - _coordinate - (272, 3) - - - _rotation - 0 - - variable @@ -119,6 +92,33 @@ 0 + + variable + + id + out_buf_size + + + _enabled + True + + + value + 96000 + + + alias + + + + _coordinate + (272, 3) + + + _rotation + 0 + + ieee802_11_ofdm_mac @@ -401,234 +401,6 @@ 0 - - foo_packet_pad2 - - id - foo_packet_pad2_0 - - - _enabled - True - - - debug - False - - - delay - False - - - delay_sec - 0.001 - - - pad_front - 1000 - - - pad_tail - 1000 - - - alias - - - - affinity - - - - minoutbuf - out_buf_size - - - maxoutbuf - 0 - - - _coordinate - (272, 395) - - - _rotation - 0 - - - - channels_channel_model - - id - channels_channel_model_0 - - - _enabled - True - - - noise_voltage - .5**.5 - - - freq_offset - 1 + 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 - - id - freq_offset - - - _enabled - True - - - label - - - - value - 1.0 - - - min - .9 - - - max - 1.1 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (776, 11) - - - _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 - - - - alias - - - - _coordinate - (888, 11) - - - _rotation - 0 - - import @@ -656,104 +428,6 @@ 0 - - wifi_phy_hier - - id - wifi_phy_hier_0 - - - _enabled - True - - - encoding - encoding - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (384, 264) - - - _rotation - 180 - - - - variable_slider - - id - pdu_length - - - _enabled - True - - - label - - - - value - 10 - - - min - 0 - - - max - 1500 - - - num_steps - 1000 - - - style - wx.SL_HORIZONTAL - - - converver - int_converter - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (1088, 147) - - - _rotation - 0 - - blocks_multiply_const_vxx @@ -1002,7 +676,7 @@ value - 50 + 100 min @@ -1045,6 +719,474 @@ 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 + + + + alias + + + + _coordinate + (888, 11) + + + _rotation + 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 + + id + freq_offset + + + _enabled + True + + + label + + + + value + 0 + + + min + -.1 + + + max + .1 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (776, 11) + + + _rotation + 0 + + + + variable_slider + + id + pdu_length + + + _enabled + True + + + label + + + + value + 500 + + + min + 0 + + + max + 1500 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + _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 + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (272, 395) + + + _rotation + 0 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + encoding + + + chan_est + chan_est + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (384, 264) + + + _rotation + 180 + + wifi_phy_hier_0 ieee802_11_ofdm_parse_mac_0 @@ -1113,8 +1255,8 @@ wifi_phy_hier_0 - foo_wireshark_connector_0 - mac_out - in + wxgui_scopesink2_0 + 1 + 0 diff --git a/examples/wifi_phy_hier.grc b/examples/wifi_phy_hier.grc index 2dcce24..0546b04 100644 --- a/examples/wifi_phy_hier.grc +++ b/examples/wifi_phy_hier.grc @@ -65,6 +65,33 @@ 0 + + variable + + id + header_formatter + + + _enabled + True + + + value + ieee802_11.wifi_signal_field() + + + alias + + + + _coordinate + (488, 11) + + + _rotation + 0 + + variable @@ -85,7 +112,7 @@ _coordinate - (323, 14) + (296, 11) _rotation @@ -119,33 +146,6 @@ 0 - - variable - - id - header_formatter - - - _enabled - True - - - value - ieee802_11.wifi_signal_field() - - - alias - - - - _coordinate - (518, 18) - - - _rotation - 0 - - variable @@ -166,132 +166,7 @@ _coordinate - (680, 11) - - - _rotation - 0 - - - - parameter - - id - encoding - - - _enabled - True - - - label - - - - value - 0 - - - type - intx - - - short_id - - - - alias - - - - _coordinate - (429, 10) - - - _rotation - 0 - - - - blocks_divide_xx - - id - blocks_divide_xx_0 - - - _enabled - True - - - type - float - - - vlen - 1 - - - num_inputs - 2 - - - alias - - - - 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 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (595, 553) + (648, 11) _rotation @@ -397,280 +272,10 @@ - blocks_conjugate_cc + ieee802_11_ofdm_decode_mac id - blocks_conjugate_cc_0 - - - _enabled - True - - - alias - - - - 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 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (233, 638) - - - _rotation - 0 - - - - ieee802_11_ofdm_sync_long - - id - sync_long - - - _enabled - True - - - log - False - - - debug - False - - - sync_length - sync_length - - - alias - - - - 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 - - - alias - - - - 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 - - - alias - - - - 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 - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (762, 940) - - - _rotation - 180 - - - - ieee802_11_ofdm_decode_signal - - id - ieee802_11_ofdm_decode_signal_0 + ieee802_11_ofdm_decode_mac_0 _enabled @@ -702,181 +307,13 @@ _coordinate - (525, 932) + (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 - - - - blocks_multiply_xx - - id - blocks_multiply_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (609, 608) - - - _rotation - 0 - - - - ieee802_11_moving_average_xx - - id - ieee802_11_moving_average_xx_1 - - - _enabled - True - - - type - complex - - - length - window_size - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (764, 621) - - - _rotation - 0 - - - - blocks_complex_to_mag - - id - blocks_complex_to_mag_0 - - - _enabled - True - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (973, 625) - - - _rotation - 0 - - ieee802_11_ofdm_mapper @@ -921,23 +358,152 @@ - digital_packet_headergenerator_bb + parameter id - digital_packet_headergenerator_bb_0 + encoding _enabled True - header_formatter - header_formatter.formatter() + label + - len_tag_key + value + ieee802_11.BPSK_1_2 + + + type + intx + + + short_id + + + + alias + + + + _coordinate + (400, 11) + + + _rotation + 0 + + + + parameter + + id + chan_est + + + _enabled + True + + + label + + + + value + 1 + + + type + + + + short_id + + + + alias + + + + _coordinate + (760, 11) + + + _rotation + 0 + + + + pad_sink + + id + pad_sink_2 + + + _enabled + True + + + label + mac_out + + + type + message + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (69, 940) + + + _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 + alias @@ -948,7 +514,7 @@ minoutbuf - 0 + out_buf_size maxoutbuf @@ -956,7 +522,42 @@ _coordinate - (222, 230) + (752, 248) + + + _rotation + 0 + + + + ieee802_11_chunks_to_symbols_xx + + id + ieee802_11_chunks_to_symbols_xx_0 + + + _enabled + True + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (504, 280) _rotation @@ -1011,7 +612,7 @@ _coordinate - (494, 230) + (504, 203) _rotation @@ -1019,100 +620,22 @@ - pad_source + digital_packet_headergenerator_bb id - pad_source_0 + digital_packet_headergenerator_bb_0 _enabled True - label - samp_in + header_formatter + header_formatter.formatter() - 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 - - - - ieee802_11_moving_average_xx - - id - ieee802_11_moving_average_xx_0 - - - _enabled - True - - - type - float - - - length - window_size + 16 + len_tag_key + "packet_len" alias @@ -1132,7 +655,66 @@ _coordinate - (876, 549) + (232, 203) + + + _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" + + + alias + + + + affinity + + + + minoutbuf + out_buf_size + + + maxoutbuf + 0 + + + _coordinate + (1008, 219) _rotation @@ -1183,7 +765,46 @@ _coordinate - (703, 411) + (704, 371) + + + _rotation + 180 + + + + pad_sink + + id + pad_sink_0 + + + _enabled + True + + + label + samp_out + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (472, 387) _rotation @@ -1242,7 +863,7 @@ _coordinate - (1003, 395) + (1008, 355) _rotation @@ -1250,38 +871,18 @@ - digital_ofdm_carrier_allocator_cvc + blocks_complex_to_mag_squared id - digital_ofdm_carrier_allocator_cvc_0_0_0 + blocks_complex_to_mag_squared_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" + vlen + 1 alias @@ -1293,7 +894,7 @@ minoutbuf - out_buf_size + 0 maxoutbuf @@ -1301,7 +902,7 @@ _coordinate - (1005, 242) + (600, 520) _rotation @@ -1309,10 +910,10 @@ - ieee802_11_chunks_to_symbols_xx + blocks_conjugate_cc id - ieee802_11_chunks_to_symbols_xx_0 + blocks_conjugate_cc_0 _enabled @@ -1328,7 +929,7 @@ minoutbuf - out_buf_size + 0 maxoutbuf @@ -1336,7 +937,7 @@ _coordinate - (499, 303) + (384, 608) _rotation @@ -1344,10 +945,10 @@ - blocks_tagged_stream_mux + blocks_delay id - blocks_tagged_stream_mux_0 + blocks_delay_0_0 _enabled @@ -1358,19 +959,15 @@ complex - ninputs - 2 + delay + 16 - lengthtagname - "packet_len" - - - vlen + num_ports 1 - tag_preserve_head_pos + vlen 1 @@ -1383,7 +980,7 @@ minoutbuf - out_buf_size + 0 maxoutbuf @@ -1391,13 +988,455 @@ _coordinate - (744, 269) + (232, 603) _rotation 0 + + blocks_multiply_xx + + id + blocks_multiply_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (608, 576) + + + _rotation + 0 + + + + blocks_complex_to_mag + + id + blocks_complex_to_mag_0 + + + _enabled + True + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (976, 592) + + + _rotation + 0 + + + + pad_source + + id + pad_source_0 + + + _enabled + True + + + label + samp_in + + + type + complex + + + vlen + 1 + + + num_streams + 1 + + + optional + False + + + _coordinate + (56, 515) + + + _rotation + 0 + + + + ieee802_11_moving_average_xx + + id + ieee802_11_moving_average_xx_0 + + + _enabled + True + + + type + float + + + length + window_size + 16 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (880, 515) + + + _rotation + 0 + + + + blocks_delay + + id + blocks_delay_0 + + + _enabled + True + + + type + complex + + + delay + sync_length + + + num_ports + 1 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (440, 803) + + + _rotation + 0 + + + + blocks_stream_to_vector + + id + blocks_stream_to_vector_0 + + + _enabled + True + + + type + complex + + + num_items + 64 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1000, 787) + + + _rotation + 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 + + id + blocks_vector_to_stream_0 + + + _enabled + True + + + type + complex + + + num_items + 48 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (312, 867) + + + _rotation + 180 + + + + ieee802_11_moving_average_xx + + id + ieee802_11_moving_average_xx_1 + + + _enabled + True + + + type + complex + + + length + window_size + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (768, 587) + + + _rotation + 0 + + + + blocks_divide_xx + + id + blocks_divide_xx_0 + + + _enabled + True + + + type + float + + + vlen + 1 + + + num_inputs + 2 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1128, 672) + + + _rotation + 270 + + ieee802_11_ofdm_sync_short @@ -1418,11 +1457,7 @@ threshold - 0.7 * 0.75 - - - max_samples - 80 * 550 + 0.85 * 0.75 min_plateau @@ -1446,7 +1481,7 @@ _coordinate - (178, 775) + (152, 744) _rotation @@ -1454,10 +1489,10 @@ - ieee802_11_ofdm_decode_mac + ieee802_11_ofdm_sync_long id - ieee802_11_ofdm_decode_mac_0 + sync_long _enabled @@ -1471,6 +1506,53 @@ debug False + + sync_length + sync_length + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (656, 771) + + + _rotation + 0 + + + + ieee802_11_ofdm_equalize_symbols + + id + ieee802_11_ofdm_equalize_symbols_0 + + + _enabled + True + + + algo + chan_est + + + debug + False + alias @@ -1489,7 +1571,50 @@ _coordinate - (283, 932) + (752, 931) + + + _rotation + 180 + + + + ieee802_11_ofdm_decode_signal + + id + ieee802_11_ofdm_decode_signal_0 + + + _enabled + True + + + log + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (525, 932) _rotation @@ -1502,60 +1627,12 @@ 0 in - - digital_chunks_to_symbols_xx_0 - blocks_tagged_stream_mux_0 - 0 - 0 - ieee802_11_ofdm_decode_mac_0 - pad_sink_1 + pad_sink_2 out 0 - - ieee802_11_moving_average_xx_0 - blocks_divide_xx_0 - 0 - 1 - - - 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 - sync_long - 0 - 0 - - - blocks_delay_0 - sync_long - 0 - 1 - - - sync_short - blocks_delay_0 - 0 - 0 - fft_vxx_0_1 ieee802_11_ofdm_equalize_symbols_0 @@ -1574,24 +1651,84 @@ 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 + + ieee802_11_ofdm_decode_signal_0 + blocks_vector_to_stream_0 + 0 + 0 + + + blocks_tagged_stream_mux_0 + digital_ofdm_carrier_allocator_cvc_0_0_0 + 0 + 0 + + + digital_packet_headergenerator_bb_0 + digital_chunks_to_symbols_xx_0 + 0 + 0 + + + ieee802_11_ofdm_mapper_0 + digital_packet_headergenerator_bb_0 + 0 + 0 + + + ieee802_11_ofdm_mapper_0 + ieee802_11_chunks_to_symbols_xx_0 + 0 + 0 + + + ieee802_11_chunks_to_symbols_xx_0 + blocks_tagged_stream_mux_0 + 0 + 1 + + + digital_chunks_to_symbols_xx_0 + blocks_tagged_stream_mux_0 + 0 + 0 + + + digital_ofdm_cyclic_prefixer_0_0 + pad_sink_0 + 0 + 0 + + + digital_ofdm_carrier_allocator_cvc_0_0_0 + fft_vxx_0_0 + 0 + 0 + + + fft_vxx_0_0 + digital_ofdm_cyclic_prefixer_0_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 + pad_source_0 blocks_multiply_xx_0 @@ -1610,48 +1747,12 @@ 0 0 - - blocks_delay_0_0 - blocks_conjugate_cc_0 - 0 - 0 - blocks_conjugate_cc_0 blocks_multiply_xx_0 0 1 - - blocks_complex_to_mag_0 - blocks_divide_xx_0 - 0 - 0 - - - ieee802_11_chunks_to_symbols_xx_0 - blocks_tagged_stream_mux_0 - 0 - 1 - - - ieee802_11_ofdm_mapper_0 - ieee802_11_chunks_to_symbols_xx_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 - blocks_complex_to_mag_squared_0 ieee802_11_moving_average_xx_0 @@ -1659,27 +1760,69 @@ 0 - fft_vxx_0_0 - digital_ofdm_cyclic_prefixer_0_0 + blocks_complex_to_mag_0 + blocks_divide_xx_0 0 0 - blocks_tagged_stream_mux_0 - digital_ofdm_carrier_allocator_cvc_0_0_0 + blocks_delay_0_0 + blocks_conjugate_cc_0 0 0 - digital_ofdm_carrier_allocator_cvc_0_0_0 - fft_vxx_0_0 + ieee802_11_moving_average_xx_0 + blocks_divide_xx_0 + 0 + 1 + + + blocks_delay_0_0 + sync_short 0 0 - digital_ofdm_cyclic_prefixer_0_0 - pad_sink_0 + sync_short + sync_long 0 0 + + sync_short + blocks_delay_0 + 0 + 0 + + + sync_long + blocks_stream_to_vector_0 + 0 + 0 + + + blocks_delay_0 + sync_long + 0 + 1 + + + blocks_vector_to_stream_0 + pad_sink_1 + 0 + 0 + + + ieee802_11_moving_average_xx_1 + sync_short + 0 + 1 + + + blocks_divide_xx_0 + sync_short + 0 + 2 + diff --git a/examples/wifi_rx.grc b/examples/wifi_rx.grc index de38918..6992130 100644 --- a/examples/wifi_rx.grc +++ b/examples/wifi_rx.grc @@ -58,7 +58,7 @@ _coordinate - (434, 15) + (8, 11) _rotation @@ -85,7 +85,7 @@ _coordinate - (601, 15) + (672, 75) _rotation @@ -112,520 +112,7 @@ _coordinate - (704, 18) - - - _rotation - 0 - - - - blocks_delay - - id - blocks_delay_0 - - - _enabled - True - - - type - complex - - - delay - sync_length - - - num_ports - 1 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (483, 567) - - - _rotation - 0 - - - - ieee802_11_ofdm_sync_long - - id - ieee802_11_ofdm_sync_long_0 - - - _enabled - True - - - log - False - - - debug - False - - - sync_length - sync_length - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (684, 534) - - - _rotation - 0 - - - - blocks_stream_to_vector - - id - blocks_stream_to_vector_0 - - - _enabled - True - - - type - complex - - - num_items - 64 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (913, 550) - - - _rotation - 0 - - - - blocks_conjugate_cc - - id - blocks_conjugate_cc_0 - - - _enabled - True - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (421, 348) - - - _rotation - 0 - - - - blocks_delay - - id - blocks_delay_0_0 - - - _enabled - True - - - type - complex - - - delay - 16 - - - num_ports - 1 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (259, 344) - - - _rotation - 0 - - - - blocks_multiply_xx - - id - blocks_multiply_xx_0 - - - _enabled - True - - - type - complex - - - num_inputs - 2 - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (662, 314) - - - _rotation - 0 - - - - blocks_complex_to_mag - - id - blocks_complex_to_mag_0 - - - _enabled - True - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (1038, 331) - - - _rotation - 0 - - - - ieee802_11_moving_average_xx - - id - ieee802_11_moving_average_xx_0 - - - _enabled - True - - - type - complex - - - length - window_size - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (819, 327) - - - _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 - - - - alias - - - - _coordinate - (1107, 20) - - - _rotation - 0 - - - - blocks_complex_to_mag_squared - - id - blocks_complex_to_mag_squared_0 - - - _enabled - True - - - vlen - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (461, 227) - - - _rotation - 0 - - - - variable_slider - - id - gain - - - _enabled - True - - - label - - - - value - 20 - - - min - 0 - - - max - 100 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - int_converter - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (808, 19) + (672, 11) _rotation @@ -679,280 +166,6 @@ 180 - - fft_vxx - - id - fft_vxx_0 - - - _enabled - True - - - type - complex - - - fft_size - 64 - - - forward - True - - - window - window.rectangular(64) - - - shift - True - - - nthreads - 1 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (138, 688) - - - _rotation - 0 - - - - ieee802_11_ether_encap - - id - ieee802_11_ether_encap_0 - - - _enabled - False - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (904, 920) - - - _rotation - 180 - - - - blocks_tuntap_pdu - - id - blocks_tuntap_pdu_0 - - - _enabled - False - - - ifn - tap0 - - - mtu - 10000 - - - istunflag - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (663, 942) - - - _rotation - 180 - - - - blocks_divide_xx - - id - blocks_divide_xx_0 - - - _enabled - True - - - type - float - - - vlen - 1 - - - num_inputs - 2 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (1193, 412) - - - _rotation - 270 - - - - ieee802_11_moving_average_xx - - id - ieee802_11_moving_average_xx_1 - - - _enabled - True - - - type - float - - - length - window_size + 16 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (782, 223) - - - _rotation - 0 - - - - notebook - - id - nb - - - _enabled - True - - - style - wx.NB_TOP - - - labels - ['constellation', 'autocorrelation'] - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (641, 85) - - - _rotation - 0 - - wxgui_scopesink2 @@ -1036,6 +249,468 @@ 180 + + ieee802_11_ofdm_decode_signal + + id + ieee802_11_ofdm_decode_signal_0 + + + _enabled + True + + + log + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (680, 707) + + + _rotation + 0 + + + + fft_vxx + + id + fft_vxx_0 + + + _enabled + True + + + type + complex + + + fft_size + 64 + + + forward + True + + + window + window.rectangular(64) + + + shift + True + + + nthreads + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (152, 683) + + + _rotation + 0 + + + + blocks_delay + + id + blocks_delay_0 + + + _enabled + True + + + type + complex + + + delay + sync_length + + + num_ports + 1 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (480, 563) + + + _rotation + 0 + + + + blocks_stream_to_vector + + id + blocks_stream_to_vector_0 + + + _enabled + True + + + type + complex + + + num_items + 64 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (912, 547) + + + _rotation + 0 + + + + blocks_delay + + id + blocks_delay_0_0 + + + _enabled + True + + + type + complex + + + delay + 16 + + + num_ports + 1 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (256, 339) + + + _rotation + 0 + + + + blocks_conjugate_cc + + id + blocks_conjugate_cc_0 + + + _enabled + True + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (424, 344) + + + _rotation + 0 + + + + blocks_multiply_xx + + id + blocks_multiply_xx_0 + + + _enabled + True + + + type + complex + + + num_inputs + 2 + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (664, 312) + + + _rotation + 0 + + + + ieee802_11_moving_average_xx + + id + ieee802_11_moving_average_xx_0 + + + _enabled + True + + + type + complex + + + length + window_size + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (816, 323) + + + _rotation + 0 + + + + blocks_complex_to_mag + + id + blocks_complex_to_mag_0 + + + _enabled + True + + + vlen + 1 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1032, 328) + + + _rotation + 0 + + + + blocks_divide_xx + + id + blocks_divide_xx_0 + + + _enabled + True + + + type + float + + + vlen + 1 + + + num_inputs + 2 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1192, 400) + + + _rotation + 270 + + wxgui_scopesink2 @@ -1112,7 +787,7 @@ _coordinate - (1174, 569) + (1171, 560) _rotation @@ -1120,293 +795,62 @@ - ieee802_11_ofdm_parse_mac + ieee802_11_moving_average_xx id - ieee802_11_ofdm_parse_mac_0 + ieee802_11_moving_average_xx_1 _enabled True - - log - False - - - debug - True - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (969, 820) - - - _rotation - 180 - - - - ieee802_11_ofdm_decode_mac - - id - ieee802_11_ofdm_decode_mac_0 - - - _enabled - True - - - log - True - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (930, 712) - - - _rotation - 0 - - - - ieee802_11_ofdm_equalize_symbols - - id - ieee802_11_ofdm_equalize_symbols_0 - - - _enabled - True - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (389, 720) - - - _rotation - 0 - - - - ieee802_11_ofdm_decode_signal - - id - ieee802_11_ofdm_decode_signal_0 - - - _enabled - True - - - log - True - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (656, 712) - - - _rotation - 0 - - - - ieee802_11_ofdm_sync_short - - id - ieee802_11_ofdm_sync_short_0 - - - _enabled - True - - - log - False - - - debug - False - - - threshold - 0.85 * 0.75 - - - max_samples - 80 * 550 - - - min_plateau - 2 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (212, 501) - - - _rotation - 0 - - - - blocks_file_sink - - id - blocks_file_sink_0 - - - _enabled - True - - - file - /tmp/ofdm.pcap - type - byte + float + + + length + window_size + 16 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (808, 227) + + + _rotation + 0 + + + + blocks_complex_to_mag_squared + + id + blocks_complex_to_mag_squared_0 + + + _enabled + True vlen 1 - - unbuffered - True - - - append - True - - - alias - - - - affinity - - - - _coordinate - (721, 1043) - - - _rotation - 180 - - - - foo_wireshark_connector - - id - foo_wireshark_connector_0 - - - _enabled - True - - - tech - 127 - - - debug - False - alias @@ -1425,62 +869,7 @@ _coordinate - (947, 1051) - - - _rotation - 180 - - - - variable_chooser - - id - lo_offset - - - _enabled - True - - - label - LO Offset - - - value - 0 - - - choices - [0, 6e6, 11e6] - - - labels - ['0 MHz', '6 MHz', '11 MHz'] - - - type - drop_down - - - style - wx.RA_HORIZONTAL - - - grid_pos - - - - notebook - - - - alias - - - - _coordinate - (254, 12) + (464, 232) _rotation @@ -2295,7 +1684,301 @@ _coordinate - (4, 207) + (16, 211) + + + _rotation + 0 + + + + ieee802_11_ofdm_equalize_symbols + + id + ieee802_11_ofdm_equalize_symbols_0 + + + _enabled + True + + + algo + chan_est + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (416, 707) + + + _rotation + 0 + + + + ieee802_11_ofdm_decode_mac + + id + ieee802_11_ofdm_decode_mac_0 + + + _enabled + True + + + log + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (1000, 707) + + + _rotation + 0 + + + + variable_chooser + + id + lo_offset + + + _enabled + True + + + label + LO Offset + + + value + 0 + + + choices + [0, 6e6, 11e6] + + + labels + ['0 MHz', '6 MHz', '11 MHz'] + + + type + drop_down + + + style + wx.RA_HORIZONTAL + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (176, 11) + + + _rotation + 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 + (352, 11) + + + _rotation + 0 + + + + notebook + + id + nb + + + _enabled + True + + + style + wx.NB_TOP + + + labels + ['constellation', 'autocorrelation'] + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (504, 11) + + + _rotation + 0 + + + + variable_slider + + id + gain + + + _enabled + True + + + label + + + + value + 20 + + + min + 0 + + + max + 100 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (776, 11) _rotation @@ -2350,13 +2033,437 @@ _coordinate - (929, 21) + (896, 11) _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 + + + + alias + + + + _coordinate + (1072, 11) + + + _rotation + 0 + + + + ieee802_11_ofdm_sync_short + + id + ieee802_11_ofdm_sync_short_0 + + + _enabled + True + + + log + False + + + debug + False + + + threshold + 0.85 * 0.75 + + + min_plateau + 2 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (216, 504) + + + _rotation + 0 + + + + ieee802_11_ofdm_sync_long + + id + ieee802_11_ofdm_sync_long_0 + + + _enabled + True + + + log + False + + + debug + False + + + sync_length + sync_length + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (672, 531) + + + _rotation + 0 + + + + ieee802_11_ofdm_parse_mac + + id + ieee802_11_ofdm_parse_mac_0 + + + _enabled + True + + + log + False + + + debug + True + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (960, 1099) + + + _rotation + 180 + + + + blocks_pdu_to_tagged_stream + + id + blocks_pdu_to_tagged_stream_0 + + + _enabled + True + + + type + float + + + tag + packet_len + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (720, 1107) + + + _rotation + 180 + + + + wxgui_numbersink2 + + id + wxgui_numbersink2_0 + + + _enabled + True + + + type + float + + + title + Frame Error Rate + + + units + % + + + samp_rate + 1 + + + min_value + 0 + + + max_value + 100 + + + factor + 1.0 + + + decimal_places + 2 + + + ref_level + 0 + + + number_rate + 15 + + + peak_hold + False + + + average + True + + + avg_alpha + 0.02 + + + show_gauge + True + + + win_size + + + + grid_pos + + + + notebook + + + + alias + + + + affinity + + + + _coordinate + (512, 1027) + + + _rotation + 180 + + + + foo_wireshark_connector + + id + foo_wireshark_connector_0 + + + _enabled + False + + + tech + 127 + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (952, 947) + + + _rotation + 180 + + + + blocks_file_sink + + id + blocks_file_sink_0 + + + _enabled + False + + + file + /tmp/ofdm.pcap + + + type + byte + + + vlen + 1 + + + unbuffered + True + + + append + True + + + alias + + + + affinity + + + + _coordinate + (720, 939) + + + _rotation + 180 + + blocks_stream_to_vector_0 fft_vxx_0 @@ -2393,12 +2500,6 @@ 0 0 - - blocks_divide_xx_0 - ieee802_11_ofdm_sync_short_0 - 0 - 1 - ieee802_11_ofdm_equalize_symbols_0 ieee802_11_ofdm_decode_signal_0 @@ -2489,30 +2590,6 @@ out in - - ieee802_11_ofdm_decode_mac_0 - ieee802_11_ether_encap_0 - out - from wifi - - - ieee802_11_ofdm_decode_mac_0 - foo_wireshark_connector_0 - out - in - - - ieee802_11_ether_encap_0 - blocks_tuntap_pdu_0 - to tap - pdus - - - foo_wireshark_connector_0 - blocks_file_sink_0 - 0 - 0 - blocks_divide_xx_0 wxgui_scopesink2_0 @@ -2525,4 +2602,40 @@ 0 0 + + blocks_divide_xx_0 + ieee802_11_ofdm_sync_short_0 + 0 + 2 + + + ieee802_11_moving_average_xx_0 + ieee802_11_ofdm_sync_short_0 + 0 + 1 + + + ieee802_11_ofdm_decode_mac_0 + foo_wireshark_connector_0 + out + in + + + blocks_pdu_to_tagged_stream_0 + wxgui_numbersink2_0 + 0 + 0 + + + ieee802_11_ofdm_parse_mac_0 + blocks_pdu_to_tagged_stream_0 + fer + pdus + + + foo_wireshark_connector_0 + blocks_file_sink_0 + 0 + 0 + From 910322c88051074d150619dd238c640ff13471d0 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 17 Apr 2015 12:28:22 +0200 Subject: [PATCH 37/38] transceiver now has to connect directly to phy layer --- examples/wifi_transceiver.grc | 571 ++++++++++++++++++++-------------- 1 file changed, 332 insertions(+), 239 deletions(-) diff --git a/examples/wifi_transceiver.grc b/examples/wifi_transceiver.grc index afebacd..f3efb9a 100644 --- a/examples/wifi_transceiver.grc +++ b/examples/wifi_transceiver.grc @@ -352,45 +352,6 @@ 0 - - wifi_phy_hier - - id - wifi_phy_hier_0 - - - _enabled - True - - - encoding - 0 - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (334, 360) - - - _rotation - 180 - - blocks_multiply_const_vxx @@ -583,53 +544,6 @@ 0 - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - src_mac - [0x23, 0x23, 0x23, 0x23, 0x23, 0x23] - - - dst_mac - [0x42, 0x42, 0x42, 0x42, 0x42, 0x42] - - - bss_mac - [0xff, 0xff, 0xff, 0xff, 0xff, 0xff] - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (303, 258) - - - _rotation - 0 - - ieee802_11_ofdm_parse_mac @@ -673,147 +587,6 @@ 180 - - ieee802_11_ether_encap - - id - ieee802_11_ether_encap_0 - - - _enabled - True - - - debug - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (314, 157) - - - _rotation - 0 - - - - blocks_tuntap_pdu - - id - blocks_tuntap_pdu_0 - - - _enabled - True - - - ifn - tap0 - - - mtu - 440 - - - istunflag - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (319, 80) - - - _rotation - 180 - - - - foo_packet_pad2 - - id - foo_packet_pad2_0 - - - _enabled - True - - - debug - False - - - delay - False - - - delay_sec - 0.001 - - - pad_front - 0 - - - pad_tail - 10000 - - - alias - - - - affinity - - - - minoutbuf - 100000 - - - maxoutbuf - 0 - - - _coordinate - (80, 511) - - - _rotation - 0 - - variable_chooser @@ -2495,6 +2268,320 @@ 0 + + wxgui_scopesink2 + + id + wxgui_scopesink2_0 + + + _enabled + True + + + type + complex + + + title + Scope Plot + + + samp_rate + 5000 + + + 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 + (808, 411) + + + _rotation + 0 + + + + foo_packet_pad2 + + id + foo_packet_pad2_0 + + + _enabled + True + + + debug + False + + + delay + False + + + delay_sec + 0.001 + + + pad_front + 10000 + + + pad_tail + 10000 + + + alias + + + + affinity + + + + minoutbuf + 100000 + + + maxoutbuf + 0 + + + _coordinate + (80, 523) + + + _rotation + 0 + + + + blocks_tuntap_pdu + + id + blocks_tuntap_pdu_0 + + + _enabled + True + + + ifn + tap0 + + + mtu + 440 + + + istunflag + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (319, 80) + + + _rotation + 180 + + + + wifi_phy_hier + + id + wifi_phy_hier_0 + + + _enabled + True + + + encoding + 0 + + + chan_est + 0 + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (334, 360) + + + _rotation + 180 + + + + ieee802_11_ether_encap + + id + ieee802_11_ether_encap_0 + + + _enabled + True + + + debug + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (314, 157) + + + _rotation + 0 + + + + ieee802_11_ofdm_mac + + id + ieee802_11_ofdm_mac_0 + + + _enabled + True + + + src_mac + [0x12, 0x34, 0x56, 0x78, 0x90, 0xab] + + + dst_mac + [0x30, 0x14, 0x4a, 0xe6, 0x46, 0xe4] + + + bss_mac + [0x42, 0x42, 0x42, 0x42, 0x42, 0x42] + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (303, 258) + + + _rotation + 0 + + ieee802_11_ether_encap_0 blocks_tuntap_pdu_0 @@ -2507,18 +2594,6 @@ pdus from tap - - ieee802_11_ofdm_mac_0 - ieee802_11_ether_encap_0 - app out - from wifi - - - ieee802_11_ether_encap_0 - ieee802_11_ofdm_mac_0 - to wifi - app in - ieee802_11_ofdm_mac_0 foo_wireshark_connector_0 @@ -2579,4 +2654,22 @@ 0 0 + + wifi_phy_hier_0 + wxgui_scopesink2_0 + 1 + 0 + + + ieee802_11_ether_encap_0 + ieee802_11_ofdm_mac_0 + to wifi + app in + + + wifi_phy_hier_0 + ieee802_11_ether_encap_0 + mac_out + from wifi + From 7fa4397590ecfe99a2e3602830daab46c13f4bea Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 16 Apr 2015 16:39:51 +0200 Subject: [PATCH 38/38] update basic tx radio --- examples/wifi_tx.grc | 1042 +++++++++++++++++++++++------------------- 1 file changed, 569 insertions(+), 473 deletions(-) diff --git a/examples/wifi_tx.grc b/examples/wifi_tx.grc index 56aa15d..d554b58 100644 --- a/examples/wifi_tx.grc +++ b/examples/wifi_tx.grc @@ -1,7 +1,6 @@ - - Fri Jul 18 10:38:21 2014 + Fri Apr 17 13:08:32 2015 options @@ -66,50 +65,18 @@ - variable_slider + variable id - gain + out_buf_size _enabled True - - label - - value - 25 - - - min - 0 - - - max - 100 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - + 96000 alias @@ -117,7 +84,34 @@ _coordinate - (291, 12) + (996, 388) + + + _rotation + 0 + + + + variable + + id + antenna + + + _enabled + True + + + value + 'J1' + + + alias + + + + _coordinate + (873, 157) _rotation @@ -180,22 +174,26 @@ - blocks_message_strobe + ieee802_11_ofdm_mac id - blocks_message_strobe_0 + ieee802_11_ofdm_mac_0 _enabled True - msg - pmt.intern(" Hello World") + src_mac + [0x23, 0x23, 0x23, 0x23, 0x23, 0x23] - period - 300 + dst_mac + [0x42, 0x42, 0x42, 0x42, 0x42, 0x42] + + + bss_mac + [0xff, 0xff, 0xff, 0xff, 0xff, 255] alias @@ -215,7 +213,7 @@ _coordinate - (113, 154) + (446, 187) _rotation @@ -223,58 +221,97 @@ - variable_slider + blocks_message_strobe id - mult + blocks_message_strobe_0_0 _enabled True - label - + msg + pmt.intern("".join("x" for i in range(pdu_length))) - value - .38 - - - min - 0 - - - max - 2 - - - num_steps - 100 - - - style - wx.SL_HORIZONTAL - - - converver - float_converter - - - grid_pos - - - - notebook - + period + period alias + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + _coordinate - (979, 10) + (81, 135) + + + _rotation + 0 + + + + blocks_socket_pdu + + id + blocks_socket_pdu_0 + + + _enabled + True + + + type + "UDP_SERVER" + + + host + + + + port + 52001 + + + mtu + 10000 + + + tcp_no_delay + False + + + alias + + + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + + + _coordinate + (177, 222) _rotation @@ -337,18 +374,148 @@ - wifi_phy_hier + variable_chooser id - wifi_phy_hier_0 + freq _enabled True - encoding - encoding + 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 + + + + alias + + + + _coordinate + (428, 10) + + + _rotation + 0 + + + + variable_slider + + id + pdu_length + + + _enabled + True + + + label + + + + value + 100 + + + min + 0 + + + max + 1500 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (982, 130) + + + _rotation + 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 @@ -360,7 +527,7 @@ minoutbuf - 0 + out_buf_size maxoutbuf @@ -368,11 +535,184 @@ _coordinate - (461, 299) + (84, 444) _rotation - 180 + 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 + + id + mult + + + _enabled + True + + + label + + + + value + .4 + + + min + 0 + + + max + 2 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (980, 10) + + + _rotation + 0 + + + + variable_slider + + id + period + + + _enabled + True + + + label + + + + value + 100 + + + min + 1 + + + max + 10000 + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + converver + int_converter + + + grid_pos + + + + notebook + + + + alias + + + + _coordinate + (972, 264) + + + _rotation + 0 @@ -419,7 +759,7 @@ _coordinate - (668, 333) + (733, 333) _rotation @@ -427,203 +767,58 @@ - blocks_multiply_const_vxx + variable_slider id - blocks_multiply_const_vxx_0 + tx_gain _enabled True - type - complex + label + - const - mult + value + 10 - vlen - 1 + min + 0 + + + max + 100 + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + converver + float_converter + + + grid_pos + + + + notebook + alias - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - _coordinate - (231, 329) - - - _rotation - 180 - - - - foo_packet_pad2 - - id - foo_packet_pad2_0 - - - _enabled - True - - - debug - False - - - delay - False - - - delay_sec - 0.01 - - - pad_front - 0 - - - pad_tail - 10000 - - - alias - - - - affinity - - - - minoutbuf - 100000 - - - maxoutbuf - 0 - - - _coordinate - (86, 444) - - - _rotation - 0 - - - - ieee802_11_ofdm_mac - - id - ieee802_11_ofdm_mac_0 - - - _enabled - True - - - src_mac - [0x23, 0x23, 0x23, 0x23, 0x23, 0x23] - - - dst_mac - [0x42, 0x42, 0x42, 0x42, 0x42, 0x42] - - - bss_mac - [0xff, 0xff, 0xff, 0xff, 0xff, 255] - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (446, 187) - - - _rotation - 0 - - - - blocks_socket_pdu - - id - blocks_socket_pdu_0 - - - _enabled - True - - - type - "UDP_SERVER" - - - host - - - - port - 52001 - - - mtu - 10000 - - - tcp_no_delay - False - - - alias - - - - affinity - - - - minoutbuf - 0 - - - maxoutbuf - 0 - - - _coordinate - (177, 222) + (292, 12) _rotation @@ -782,19 +977,15 @@ center_freq0 - uhd.tune_request(freq, rf_freq = freq - lo_offset, rf_freq_policy=uhd.tune_request.POLICY_MANUAL) + uhd.tune_request(freq - lo_offset, lo_offset) gain0 - gain - - - norm_gain0 - False + tx_gain ant0 - + antenna bw0 @@ -808,10 +999,6 @@ gain1 0 - - norm_gain1 - False - ant1 @@ -828,10 +1015,6 @@ gain2 0 - - norm_gain2 - False - ant2 @@ -848,10 +1031,6 @@ gain3 0 - - norm_gain3 - False - ant3 @@ -868,10 +1047,6 @@ gain4 0 - - norm_gain4 - False - ant4 @@ -888,10 +1063,6 @@ gain5 0 - - norm_gain5 - False - ant5 @@ -908,10 +1079,6 @@ gain6 0 - - norm_gain6 - False - ant6 @@ -928,10 +1095,6 @@ gain7 0 - - norm_gain7 - False - ant7 @@ -948,10 +1111,6 @@ gain8 0 - - norm_gain8 - False - ant8 @@ -968,10 +1127,6 @@ gain9 0 - - norm_gain9 - False - ant9 @@ -988,10 +1143,6 @@ gain10 0 - - norm_gain10 - False - ant10 @@ -1008,10 +1159,6 @@ gain11 0 - - norm_gain11 - False - ant11 @@ -1028,10 +1175,6 @@ gain12 0 - - norm_gain12 - False - ant12 @@ -1048,10 +1191,6 @@ gain13 0 - - norm_gain13 - False - ant13 @@ -1068,10 +1207,6 @@ gain14 0 - - norm_gain14 - False - ant14 @@ -1088,10 +1223,6 @@ gain15 0 - - norm_gain15 - False - ant15 @@ -1108,10 +1239,6 @@ gain16 0 - - norm_gain16 - False - ant16 @@ -1128,10 +1255,6 @@ gain17 0 - - norm_gain17 - False - ant17 @@ -1148,10 +1271,6 @@ gain18 0 - - norm_gain18 - False - ant18 @@ -1168,10 +1287,6 @@ gain19 0 - - norm_gain19 - False - ant19 @@ -1188,10 +1303,6 @@ gain20 0 - - norm_gain20 - False - ant20 @@ -1208,10 +1319,6 @@ gain21 0 - - norm_gain21 - False - ant21 @@ -1228,10 +1335,6 @@ gain22 0 - - norm_gain22 - False - ant22 @@ -1248,10 +1351,6 @@ gain23 0 - - norm_gain23 - False - ant23 @@ -1268,10 +1367,6 @@ gain24 0 - - norm_gain24 - False - ant24 @@ -1288,10 +1383,6 @@ gain25 0 - - norm_gain25 - False - ant25 @@ -1308,10 +1399,6 @@ gain26 0 - - norm_gain26 - False - ant26 @@ -1328,10 +1415,6 @@ gain27 0 - - norm_gain27 - False - ant27 @@ -1348,10 +1431,6 @@ gain28 0 - - norm_gain28 - False - ant28 @@ -1368,10 +1447,6 @@ gain29 0 - - norm_gain29 - False - ant29 @@ -1388,10 +1463,6 @@ gain30 0 - - norm_gain30 - False - ant30 @@ -1408,10 +1479,6 @@ gain31 0 - - norm_gain31 - False - ant31 @@ -1442,139 +1509,144 @@ - variable_chooser + wifi_phy_hier id - freq + wifi_phy_hier_0 _enabled True - label - Channel + encoding + encoding - 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 - + chan_est + 0 alias + + affinity + + + + minoutbuf + 0 + + + maxoutbuf + 0 + _coordinate - (419, 11) + (461, 299) _rotation - 0 + 180 - variable_chooser + blocks_null_sink id - lo_offset + blocks_null_sink_0 _enabled True - - label - LO Offset - - - value - 0 - - - choices - [0, 6e6, 11e6] - - - labels - ['0 MHz', '6 MHz', '11 MHz'] - type - drop_down + complex - style - wx.RA_HORIZONTAL + vlen + 1 - grid_pos - + num_inputs + 1 - notebook - + bus_conns + [[0,],] alias + + affinity + + _coordinate - (697, 165) + (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 + + _coordinate + (89, 363) + + + _rotation + 180 + - - blocks_message_strobe_0 - ieee802_11_ofdm_mac_0 - strobe - app in - - - blocks_socket_pdu_0 - ieee802_11_ofdm_mac_0 - pdus - app in - foo_packet_pad2_0 uhd_usrp_sink_0 0 0 - - wifi_phy_hier_0 - blocks_multiply_const_vxx_0 - 0 - 0 - blocks_multiply_const_vxx_0 foo_packet_pad2_0 @@ -1599,4 +1671,28 @@ 0 0 + + blocks_message_strobe_0_0 + ieee802_11_ofdm_mac_0 + strobe + app in + + + blocks_socket_pdu_0 + ieee802_11_ofdm_mac_0 + pdus + app in + + + wifi_phy_hier_0 + blocks_null_sink_0 + 1 + 0 + + + wifi_phy_hier_0 + blocks_multiply_const_vxx_0 + 0 + 0 +