MATLAB Examples

FSK Modulation in Fading Channel

Pass an FSK signal through a Rayleigh multipath fading channel. Change the signal bandwidth to observe the impact of the fading channel on the FSK spectrum.


FSK Modulation in Flat Fading

Set modulation order to 4, the modulated symbol rate to 45 bps, and the frequency separation to 200 Hz.

M = 4;                 % Modulation order
symbolRate = 45;       % Symbol rate (bps)
freqSep = 200;         % Frequency separation (Hz)

Calculate the samples per symbol parameter, sampPerSym, as a function of the modulation order, frequency separation, and symbol rate. To avoid output signal aliasing, the product of sampPerSym and symbolRate must be greater than the product of M and freqSep. Calculate the sample rate of the FSK output signal.

sampPerSym = ceil(M*freqSep/symbolRate);
fsamp = sampPerSym*symbolRate;

Create an FSK modulator.

fskMod = comm.FSKModulator(M, ...
    'FrequencySeparation',freqSep, ...
    'SamplesPerSymbol',sampPerSym, ...

Set the path delays and average path gains for the fading channel.

pathDelays = [0 3 10]*1e-6;     % Discrete delays of three-path channel (s)
avgPathGains = [0 -3 -6];       % Average path gains (dB)

By convention, the delay of the first path is typically set to zero. For subsequent paths, a 1 microsecond delay corresponds to a 300 m difference in path length. The path delays and path gains specify the average delay profile of the channel.

Create a Rayleigh channel using the defined parameters. Set the Visualization property to display the impulse and frequency responses.

channel = comm.RayleighChannel(...
    'SampleRate',fsamp, ...
    'PathDelays',pathDelays, ...
    'AveragePathGains',avgPathGains, ...
    'MaximumDopplerShift',0.01, ...
    'Visualization','Impulse and frequency responses', ...

Generate random data symbols and apply FSK modulation.

data = randi([0 3],2000,1);
modSig = fskMod(data);

Plot the spectrum of the FSK modulated signal.

spectrum = dsp.SpectrumAnalyzer('SampleRate',fsamp);

The modulated signal is composed of four tones each having approximately 20 dBm peak power separated by 200 Hz.

Pass the signal through the Rayleigh fading channel and apply AWGN having a 25 dB signal-to-noise ratio.

snrdB = 25;
rxSig = awgn(channel(modSig),snrdB);

The impulse and frequency responses show that the channel behaves as though it were flat. This is because the signal bandwidth, 800 Hz, is much smaller than the coherence bandwidth, 50 kHz.

Plot the received signal spectrum.


The four tones comprising the FSK signal maintain the same frequency separation and peak power levels relative to each other. The absolute peak power levels have decreased due to the fading channel.

FSK Modulation in Frequency-Selective Fading

Increase the symbol rate to 45 kbps and the frequency separation to 200 kHz. Calculate the new samples per symbol and sample rate parameters.

symbolRate = 45e3;
freqSep = 200e3;
sampPerSym = ceil(M*freqSep/symbolRate);
fsamp = sampPerSym*symbolRate;

Update the FSK modulator properties.

fskMod.SymbolRate = symbolRate;
fskMod.FrequencySeparation = freqSep;

Update the spectrum analyzer sample rate property, sa.SampleRate. Apply FSK modulation and plot the resulting spectrum.

spectrum.SampleRate = sampPerSym*symbolRate;

modSig = fskMod(data);

The spectrum has the same shape as in the flat-fading case but the four tones are now separated by 200 kHz.

Update the channel sample rate property. Pass the signal through the Rayleigh fading channel and apply AWGN.

channel.SampleRate = fsamp;

rxSig = awgn(channel(modSig),25);

The impulse and frequency responses show that the multipath fading is frequency selective.

Plot the received signal spectrum.


There are still four identifiable tones but their relative peak power levels differ due to the frequency-selective fading. The signal bandwidth, 800 kHz, is larger than the coherence bandwidth, 50 kHz.