GNU Radio World

Browser-Native Spectrum Analyzer

Three distinct signals across a simulated 1 MHz RF channel demonstrate automatic detection, per-signal peak measurement, center frequency, and 99% occupied bandwidth.

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
VariableGNU Radio4
Multiply ConstGNU Radio2
AddGNU Radio1
Constellation ModulatorGNU Radio1
Constellation ObjectGNU Radio1
GUI LayoutGNU Radio1
Noise SourceGNU Radio1
NoteGNU Radio1
OFDM TransmitterGNU Radio1
Random Uniform SourceGNU Radio1
RotatorGNU Radio1
Signal SourceGNU Radio1
Spectrum AnalyzerGNU Radio1
Stream to Tagged StreamGNU Radio1
ThrottleGNU Radio1
Vector SourceGNU Radio1

Notes in this flowgraph

Flowgraph source

spectrum-analysis/spectrum_analyzer.grc
options:
    parameters:
        author: GNU Radio World
        comment: ''
        copyright: ''
        description: Three distinct signals across a simulated 1 MHz RF channel demonstrate automatic detection, per-signal peak measurement, center frequency, and 99% occupied bandwidth.
        generate_options: qt_gui
        id: Browser_Native_Spectrum_Analyzer
        title: Browser-Native Spectrum Analyzer
    states:
        coordinate: [10, 10]
        rotation: 0
        state: enabled
blocks:
-   name: center_freq
    id: variable
    parameters:
        comment: ''
        value: '915000000'
    states:
        coordinate: [770, 10]
        rotation: 0
        state: enabled
-   name: ofdm_offset
    id: variable
    parameters:
        comment: ''
        value: '300000'
    states:
        coordinate: [1110, 10]
        rotation: 0
        state: enabled
-   name: samp_rate
    id: variable
    parameters:
        comment: ''
        value: '1000000'
    states:
        coordinate: [600, 10]
        rotation: 0
        state: enabled
-   name: tone_offset
    id: variable
    parameters:
        comment: ''
        value: '-300000'
    states:
        coordinate: [940, 10]
        rotation: 0
        state: enabled
-   name: analyzer
    id: wasm_spectrum_analyzer_sink
    parameters:
        affinity: ''
        alias: ''
        average: '0.2'
        center_freq: center_freq
        comment: ''
        db_per_div: '10'
        fftsize: '8192'
        level_offset_db: '0'
        level_unit: dBFS
        name: Three-Signal Spectrum
        reference_level: '0'
        samp_rate: samp_rate
        trace_mode: average
        type: complex
        update_time: '0.1'
        wintype: window.WIN_BLACKMAN_hARRIS
    states:
        coordinate: [1030, 1070]
        rotation: 0
        state: enabled
-   name: channel_sum
    id: blocks_add_xx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        num_inputs: '4'
        type: complex
        vlen: '1'
    states:
        coordinate: [460, 1150]
        rotation: 0
        state: enabled
-   name: channel_throttle
    id: blocks_throttle2
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        ignoretag: 'True'
        limit: time
        maximum: '0.02'
        maxoutbuf: '0'
        minoutbuf: '0'
        samples_per_second: samp_rate
        type: complex
        vlen: '1'
    states:
        coordinate: [700, 1170]
        rotation: 0
        state: enabled
-   name: gui_layout
    id: wasm_gui_layout
    parameters:
        affinity: ''
        alias: ''
        columns: '12'
        comment: ''
        layout: '{"analyzer":[0,0,12,8]}'
        row_height: '60'
    states:
        coordinate: [310, 10]
        rotation: 0
        state: enabled
-   name: ofdm_frequency_shift
    id: blocks_rotator_cc
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        phase_inc: 2*math.pi*ofdm_offset/samp_rate
        tag_inc_update: 'False'
    states:
        coordinate: [100, 1390]
        rotation: 0
        state: enabled
-   name: ofdm_level
    id: blocks_multiply_const_vxx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        const: '0.2'
        maxoutbuf: '0'
        minoutbuf: '0'
        mode: scalar
        type: complex
        vlen: '1'
    states:
        coordinate: [1090, 840]
        rotation: 0
        state: enabled
-   name: ofdm_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: [340, 620]
        rotation: 0
        state: enabled
-   name: ofdm_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, 610]
        rotation: 0
        state: enabled
-   name: ofdm_transmitter
    id: digital_ofdm_tx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        cp_len: '64'
        fft_len: '256'
        header_mod: '"BPSK"'
        log: 'False'
        maxoutbuf: '0'
        minoutbuf: '0'
        occupied_carriers: ()
        packet_len_key: length
        payload_mod: '"QPSK"'
        pilot_carriers: ()
        pilot_symbols: ()
        rolloff: '0'
        scramble_bits: 'True'
        sync_word1: ()
        sync_word2: ()
    states:
        coordinate: [720, 730]
        rotation: 0
        state: enabled
-   name: overview
    id: note
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        note: "A simulated 1 MHz channel centered at 915 MHz\n\nLeft: narrow carrier at -300 kHz\nCenter: pulse-shaped QPSK, 8 samples/symbol\nRight: QPSK OFDM at +300 kHz, 256-point FFT with 52 active carriers\n\nLow-level receiver noise gives the automatic detector a realistic floor to learn. Try changing Threshold, toggling Detect, or pressing Relearn in the running analyzer."
    states:
        coordinate: [10, 270]
        rotation: 0
        state: enabled
-   name: qpsk_constellation
    id: variable_constellation
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        const_points: '[-1-1j, -1+1j, 1+1j, 1-1j]'
        dims: '1'
        normalization: digital.constellation.AMPLITUDE_NORMALIZATION
        npwr: '1'
        precision: '8'
        rot_sym: '4'
        soft_dec_lut: None
        sym_map: '[0, 1, 3, 2]'
        type: qpsk
    states:
        coordinate: [1290, 10]
        rotation: 0
        state: enabled
-   name: qpsk_data
    id: analog_random_uniform_source_x
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        maximum: '255'
        maxoutbuf: '0'
        minimum: '0'
        minoutbuf: '0'
        seed: '23'
        type: byte
    states:
        coordinate: [720, 610]
        rotation: 0
        state: enabled
-   name: qpsk_level
    id: blocks_multiply_const_vxx
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        const: '0.22'
        maxoutbuf: '0'
        minoutbuf: '0'
        mode: scalar
        type: complex
        vlen: '1'
    states:
        coordinate: [100, 1290]
        rotation: 0
        state: enabled
-   name: qpsk_modulator
    id: digital_constellation_modulator
    parameters:
        affinity: ''
        alias: ''
        comment: ''
        constellation: qpsk_constellation
        differential: 'False'
        excess_bw: '0.35'
        log: 'False'
        maxoutbuf: '0'
        minoutbuf: '0'
        samples_per_symbol: '8'
        truncate: 'False'
        verbose: 'False'
    states:
        coordinate: [1090, 570]
        rotation: 0
        state: enabled
-   name: receiver_noise
    id: analog_noise_source_x
    parameters:
        affinity: ''
        alias: ''
        amp: '0.002'
        comment: ''
        maxoutbuf: '0'
        minoutbuf: '0'
        noise_type: analog.GR_GAUSSIAN
        seed: '7'
        type: complex
    states:
        coordinate: [100, 1510]
        rotation: 0
        state: enabled
-   name: tone
    id: analog_sig_source_x
    parameters:
        affinity: ''
        alias: ''
        amp: '0.3'
        comment: ''
        freq: tone_offset
        maxoutbuf: '0'
        minoutbuf: '0'
        offset: '0'
        phase: '0'
        samp_rate: samp_rate
        type: complex
        waveform: analog.GR_COS_WAVE
    states:
        coordinate: [100, 1110]
        rotation: 0
        state: enabled
connections:
- [channel_sum, '0', channel_throttle, '0']
- [channel_throttle, '0', analyzer, '0']
- [ofdm_frequency_shift, '0', channel_sum, '2']
- [ofdm_level, '0', ofdm_frequency_shift, '0']
- [ofdm_packet_tagger, '0', ofdm_transmitter, '0']
- [ofdm_payload, '0', ofdm_packet_tagger, '0']
- [ofdm_transmitter, '0', ofdm_level, '0']
- [qpsk_data, '0', qpsk_modulator, '0']
- [qpsk_level, '0', channel_sum, '1']
- [qpsk_modulator, '0', qpsk_level, '0']
- [receiver_noise, '0', channel_sum, '3']
- [tone, '0', channel_sum, '0']
metadata:
    file_format: 1
    grc_version: 3.11.0.0