GNU Radio World

OFDM Loopback and Bit Error Counter

OFDM tx and rx with packet rate counter

Press Load to open this flowgraph in an editor embedded above, then ▶ to run it. Nothing is downloaded until you do.

Open in the full editor ▶ Download the .grc

Blocks used

BlockModuleUsed
Vector SourceGNU Radio3
XorGNU Radio2
AddGNU Radio1
IntegrateGNU Radio1
Noise SourceGNU Radio1
OFDM ReceiverGNU Radio1
OFDM TransmitterGNU Radio1
QT GUI Number SinkGNU Radio1
QT GUI RangeGNU Radio1
QT GUI Time SinkGNU Radio1
Stream to Tagged StreamGNU Radio1
Tag GateGNU Radio1
ThrottleGNU Radio1
UChar To FloatGNU Radio1
Unpack K BitsGNU Radio1
WASM Packet Rate SinkGNU Radio1

Flowgraph source

ofdm/ofdm.grc
options:
    parameters:
        author: Marc
        copyright: ''
        description: OFDM tx and rx with packet rate counter
        generate_options: qt_gui
        id: OFDM_Loopback_and_Bit_Error_Counter
        title: OFDM Loopback and Bit Error Counter
    states:
        coordinate: [10, 10]
        rotation: 0
        state: enabled
blocks:
-   name: noise_amplitude
    id: variable_qtgui_range
    parameters:
        comment: ''
        label: Noise amplitude
        min_len: '200'
        orient: QtCore.Qt.Horizontal
        rangeType: float
        start: '0'
        step: '0.1'
        stop: '10'
        value: '0'
        widget: counter_slider
    states:
        coordinate: [600, 10]
        rotation: 0
        state: enabled
-   name: add_noise
    id: blocks_add_xx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        num_inputs: '2'
        type: complex
        vlen: '1'
    states:
        coordinate: [1100, 380]
        rotation: 0
        state: enabled
-   name: bit_error_display
    id: qtgui_number_sink
    parameters:
        affinity: ''
        alias: ''
        autoscale: 'False'
        avg: '0'
        color1: ("black", "black")
        color10: ''
        color2: ''
        color3: ''
        color4: ''
        color5: ''
        color6: ''
        color7: ''
        color8: ''
        color9: ''
        comment: ''
        factor1: '1'
        factor10: ''
        factor2: ''
        factor3: ''
        factor4: ''
        factor5: ''
        factor6: ''
        factor7: ''
        factor8: ''
        factor9: ''
        graph_type: qtgui.NUM_GRAPH_NONE
        gui_hint: ''
        label1: '"Bit errors in latest packet"'
        label10: ''
        label2: ''
        label3: ''
        label4: ''
        label5: ''
        label6: ''
        label7: ''
        label8: ''
        label9: ''
        max: '768'
        min: '0'
        name: '"OFDM Bit Errors"'
        nconnections: '1'
        type: float
        unit1: '" bits"'
        unit10: ''
        unit2: ''
        unit3: ''
        unit4: ''
        unit5: ''
        unit6: ''
        unit7: ''
        unit8: ''
        unit9: ''
        update_time: '0.1'
    states:
        coordinate: [620, 1290]
        rotation: 0
        state: enabled
-   name: byte_errors
    id: blocks_xor_xx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        num_inputs: '2'
        type: byte
    states:
        coordinate: [1130, 820]
        rotation: 0
        state: enabled
-   name: channel_noise
    id: analog_noise_source_x
    parameters:
        affinity: ''
        alias: ''
        amp: noise_amplitude
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        seed: '0'
        type: complex
    states:
        coordinate: [730, 590]
        rotation: 0
        state: enabled
-   name: error_bits
    id: blocks_unpack_k_bits_bb
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        k: '8'
        maxoutbuf: '0'
        minoutbuf: '0'
    states:
        coordinate: [1370, 830]
        rotation: 0
        state: enabled
-   name: error_inject
    id: blocks_xor_xx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        num_inputs: '2'
        type: byte
    states:
        coordinate: [760, 810]
        rotation: 0
        state: enabled
-   name: error_pattern
    id: blocks_vector_source_x
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        repeat: 'True'
        tags: '[]'
        type: byte
        vector: '[1, 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, 0, 2, 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, 0, 4, 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, 0]'
        vlen: '1'
    states:
        coordinate: [370, 1010]
        rotation: 0
        state: enabled
-   name: errors_as_float
    id: blocks_uchar_to_float
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
    states:
        coordinate: [80, 1320]
        rotation: 0
        state: enabled
-   name: errors_per_packet
    id: blocks_integrate_xx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        decim: '768'
        maxoutbuf: '0'
        minoutbuf: '0'
        type: float
        vlen: '1'
    states:
        coordinate: [350, 1320]
        rotation: 0
        state: enabled
-   name: packet_rate_display
    id: wasm_packet_rate_sink
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        items_per_packet: '96'
        label: '"Packets decoded"'
        name: '"OFDM Link Rate"'
        type: byte
        unit: '" pkt/s"'
        update_time: '0.5'
    states:
        coordinate: [760, 1050]
        rotation: 0
        state: enabled
-   name: packet_tagger
    id: blocks_stream_to_tagged_stream
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        len_tag_key: length
        maxoutbuf: '0'
        minoutbuf: '0'
        packet_len: '96'
        type: byte
        vlen: '1'
    states:
        coordinate: [350, 380]
        rotation: 0
        state: enabled
-   name: payload
    id: blocks_vector_source_x
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        repeat: 'True'
        tags: '[]'
        type: byte
        vector: '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95]'
        vlen: '1'
    states:
        coordinate: [10, 370]
        rotation: 0
        state: enabled
-   name: receiver
    id: digital_ofdm_rx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        cp_len: '16'
        fft_len: '64'
        header_mod: '"BPSK"'
        log: 'False'
        maxoutbuf: '0'
        minoutbuf: '0'
        occupied_carriers: ()
        packet_len_key: '"length"'
        payload_mod: '"BPSK"'
        pilot_carriers: ()
        pilot_symbols: ()
        scramble_bits: 'False'
        sync_word1: ()
        sync_word2: ()
    states:
        coordinate: [370, 710]
        rotation: 0
        state: enabled
-   name: reference_payload
    id: blocks_vector_source_x
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        repeat: 'True'
        tags: '[]'
        type: byte
        vector: '[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95]'
        vlen: '1'
    states:
        coordinate: [760, 930]
        rotation: 0
        state: enabled
-   name: strip_tx_tags
    id: blocks_tag_gate
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        propagate_tags: 'False'
        single_key: '""'
        type: complex
        vlen: '1'
    states:
        coordinate: [80, 810]
        rotation: 0
        state: enabled
-   name: throttle
    id: blocks_throttle2
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        ignoretag: 'True'
        limit: auto
        maximum: '0.1'
        maxoutbuf: '0'
        minoutbuf: '0'
        samples_per_second: '192000'
        type: complex
        vlen: '1'
    states:
        coordinate: [1340, 370]
        rotation: 0
        state: enabled
-   name: transmitter
    id: digital_ofdm_tx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        cp_len: '16'
        fft_len: '64'
        header_mod: '"BPSK"'
        log: 'False'
        maxoutbuf: '0'
        minoutbuf: '0'
        occupied_carriers: ()
        packet_len_key: length
        payload_mod: '"BPSK"'
        pilot_carriers: ()
        pilot_symbols: ()
        rolloff: '0'
        scramble_bits: 'False'
        sync_word1: ()
        sync_word2: ()
    states:
        coordinate: [730, 270]
        rotation: 0
        state: enabled
-   name: x16
    id: qtgui_time_sink_x
    parameters:
        affinity: ''
        alias: ''
        alpha1: '1'
        alpha2: '1'
        autoscale: 'False'
        axislabels: 'True'
        color1: blue
        color2: red
        comment: ''
        ctrlpanel: 'False'
        grid: 'False'
        label1: Signal 1
        label2: Signal 2
        legend: 'True'
        marker1: '0'
        marker2: '-1'
        name: Scope
        srate: '32000'
        size: '1024'
        stemplot: 'False'
        style1: '1'
        style2: '1'
        tr_chan: '0'
        tr_delay: '0'
        tr_level: '0'
        tr_mode: qtgui.TRIG_MODE_FREE
        tr_slope: qtgui.TRIG_SLOPE_POS
        tr_tag: ''
        type: complex
        update_time: '0.1'
        width1: '1'
        width2: '1'
        ylabel: Amplitude
        ymax: '20'
        ymin: '-20'
        yunit: ''
    states:
        coordinate: [370, 1130]
        rotation: 0
        state: enabled
connections:
- [add_noise, '0', throttle, '0']
- [byte_errors, '0', error_bits, '0']
- [channel_noise, '0', add_noise, '1']
- [error_bits, '0', errors_as_float, '0']
- [error_inject, '0', byte_errors, '0']
- [error_pattern, '0', error_inject, '1']
- [errors_as_float, '0', errors_per_packet, '0']
- [errors_per_packet, '0', bit_error_display, '0']
- [packet_tagger, '0', transmitter, '0']
- [payload, '0', packet_tagger, '0']
- [receiver, '0', error_inject, '0']
- [receiver, '0', packet_rate_display, '0']
- [reference_payload, '0', byte_errors, '1']
- [strip_tx_tags, '0', receiver, '0']
- [strip_tx_tags, '0', x16, '0']
- [throttle, '0', strip_tx_tags, '0']
- [transmitter, '0', add_noise, '0']
metadata:
    file_format: 1
    grc_version: 3.11.0.0