Complete demodulation chain implementation (from a RF or IF signal to a binary sequence).

Calling sequence

[demod,b] = demod_process(demod,x);
[demod,b,y] = demod_process(demod,x);
[demod,b,y,dbg] = demod_process(demod,x);



Demodulation object (can be created with the function demod_init)


Input RF or IF signal


Decoded binary sequence (hard-decoding)


Decoded symbols, which can be used for soft-decoding (optionnal output parameter)


Debug structure, containing the intermediate results of the demodulation process (optionnal output parameter)


Proceed to demodulation of the input signal. The demodulation consists in the following steps:

  1. Downconversion to baseband (if the configured intermediate frequency is not null), including image frequency filtering.

  2. Carrier recovery: detection and removing of carrier offset and residual frequency shift (with phase detector automatically choosen according to the currently used modulation scheme, and a second order loop)

  3. Matched filtering: filter matched to the pulse shaping filter (e.g. moving average for NRZ, or RC/SRRC filter for RC/SRRC pulses, etc.)

  4. Clock recovery: using an interpolator and a timing error detector automatically choosen according to the modulation being used.

  5. Symbol demapping: conversion of the symbol sequence to a binary sequence using hard decoding (this step may not be used in the case of soft-decoding after the demodulation stage).

In case of frequency modulation (FSK, MSK, ...),


// QPSK demodulator (NRZ matched filter),
// sampling frequency = 1 MHz, IF = 200 KHz, FSYMB = 20 KHz
demod = demod_init('qpsk', 1e6, 200e3, 20e3);
// Create a modulator to simulate RF signal
mod = mod_init('qpsk', 1e6, 200e3, 20e3);
b1 = prbs(100); // Random bit vector
[mod,x] = mod_process(mod,b1);
// Proceed to demodulation
[demod,b2] = demod_process(demod, x);
// Alignment of the two bit vectors (and phase ambiguity resolution)
[b1,b2,nerrs,ber] = cmp_bits(b1,b2,'p',;
// Verification
if(nerrs ~= 0)
error("No noise case and error(s) are detected!");