Communications Toolbox | ![]() ![]() |
Filter Design Issues
After demodulating, you might want to filter out the carrier signal, especially if you are using passband simulation. The Signal Processing Toolbox provides functions that can help you design your filter, such as butter
, cheby1
, cheby2
, and ellip
. Different demodulation methods have different properties, and you might need to test your application with several filters before deciding which is most suitable. This subsection mentions two issues that relate to the use of filters: cutoff frequency and time lag.
Example: Varying the Filter's Cutoff Frequency
In many situations, a suitable cutoff frequency is half the carrier frequency. Because the carrier frequency must be higher than the bandwidth of the message signal, a cutoff frequency chosen in this way limits the bandwidth of the message signal. If the cutoff frequency is too high, then the carrier frequency might not be filtered out. If the cutoff frequency is too low, then it might narrow the bandwidth of the message signal.
The code below modulates a sawtooth message signal, demodulates the resulting signal using a Butterworth filter, and plots the original and recovered signals. Note that the scaling in the butter
function causes the cutoff frequency of the filter to be F*Fs/2
, not F
itself.
Fc = 25; % Carrier frequency Fs = 100; % Signal sampling rate t = [0:1/Fs:2]'; % Times to sample the signal x = sawtooth(6*t,0); % Signal is a sawtooth. y = amod(x,Fc,Fs,'amssb'); % Modulate. F = Fc/Fs; % Change F to vary the filter's cutoff frequency. [num,den] = butter(2,F); % Design Butterworth filter. z = ademod(y,Fc,Fs,'amssb',num,den); % Demodulate and filter. plot(t,x,'-',t,z,'--') % Plot original and recovered signals.
The plots below show the effects of three lowpass filters with different cutoff frequencies. In each plot, the dotted curve is the demodulated signal and the solid curve is the original message signal. The top plot uses the suggested cutoff frequency (F = Fc/Fs
). The lower left plot uses a higher cutoff frequency (F = 3.9*Fc/Fs
), which allows the carrier signal to interfere with the demodulated signal. The lower right plot uses a lower cutoff frequency (F = Fc/Fs/4
), which narrows the bandwidth of the demodulated signal.
Original and Recovered Signals, with Filter Cutoff F = Fc/Fs, 3.9*Fc/Fs, and Fc/Fs/4
Example: Time Lag From Filtering
There is invariably a time delay between a demodulated signal and the original received signal. Both the filter order and the filter parameters directly affect the length of this delay. The example below illustrates the time delay by plotting a signal before and after the modulation, demodulation, and filtering processes. The solid curve is the original sine wave and the dashed curve is the recovered signal.
Fs = 100; % Sampling rate of signal [num,den] = butter(2,0.8); % Design Butterworth filter. t = [0:1/Fs:10]'; % Times to sample the signal x = sin(t); % Signal is a sine wave. y = amodce(x,Fs,'pm'); % Modulate. z = ademodce(y,Fs,'pm',num,den); % Demodulate and filter. plot(t,x,t,z,'r--') % Plot original signal and recovered signal.
![]() | Other Options in Analog Modulation | Digital Modulation Overview | ![]() |