fskdemod

Frequency shift keying demodulation

Syntax

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)

Description

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.

Examples

expand all

Modulation and Demodulation of an FSK Signal in AWGN

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),...
    'measured',[],'dB');

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 =

    0.0958    0.1029

See Also

| |

Was this topic helpful?