Frequency shift keying demodulation


z = fskdemod(y,M,freq_sep,nsamp)
z = fskdemod(y,M,freq_sep,nsamp,Fs)
z = fskdemod(y,M,freq_sep,nsamp,Fs,symbol_order)


z = fskdemod(y,M,freq_sep,nsamp) noncoherently demodulates the complex envelope y of a signal using the frequency shift key method. M is the alphabet size and must be an integer power of 2. freq_sep is the frequency separation between successive frequencies in Hz. nsamp is the required number of samples per symbol and must be a positive integer greater than 1. The sampling frequency is 1 Hz. If y is a matrix with multiple rows and columns, the function processes the columns independently.

z = fskdemod(y,M,freq_sep,nsamp,Fs) specifies the sampling frequency in Hz.

z = fskdemod(y,M,freq_sep,nsamp,Fs,symbol_order) specifies how the function assigns binary words to corresponding integers. If symbol_order is set to 'bin' (default), the function uses a natural binary-coded ordering. If symbol_order is set to 'gray', it uses a Gray-coded ordering.


collapse all

Pass an FSK signal through an AWGN channel and estimate the resulting bit error rate (BER). Compare the estimated BER to the theoretical value.

Set the simulation parameters.

M = 2;         % Modulation order
k = log2(M);   % Bits per symbol
EbNo = 5;      % Eb/No (dB)
Fs = 16;       % Sample rate (Hz)
nsamp = 8;     % Number of samples per symbol
freqsep = 10;  % Frequency separation (Hz)

Generate random data symbols.

data = randi([0 M-1],5000,1);

Apply FSK modulation.

txsig = fskmod(data,M,freqsep,nsamp,Fs);

Pass the signal through an AWGN channel

rxSig  = awgn(txsig,EbNo+10*log10(k)-10*log10(nsamp),...

Demodulate the received signal.

dataOut = fskdemod(rxSig,M,freqsep,nsamp,Fs);

Calculate the bit error rate.

[num,BER] = biterr(data,dataOut);

Determine the theoretical BER and compare it to the estimated BER. Your BER value might vary because the example uses random numbers.

BER_theory = berawgn(EbNo,'fsk',M,'noncoherent');
[BER BER_theory]
ans = 1×2

    0.0958    0.1029


[1] Sklar, Bernard. Digital Communications: Fundamentals and Applications. Upper Saddle River, NJ: Prentice-Hall, 2001.

Introduced before R2006a