returns a demodulated signal
z = amdemod(
z, given the input amplitude modulated
y, where the carrier signal has frequency
Fc. The carrier signal and
y have sampling
Fs. The modulated signal
y has zero
initial phase and zero carrier amplitude, resulting from a suppressed-carrier
The value of
Fs must satisfy
Set the carrier frequency to 10 kHz and sampling frequency to 80 kHz. Generate a time vector having a duration of 0.01 s.
fc = 10e3; fs = 80e3; t = (0:1/fs:0.01)';
Create a two-tone sinusoidal signal with frequencies 300 and 600 Hz.
s = sin(2*pi*300*t)+2*sin(2*pi*600*t);
Create a lowpass filter.
[num,den] = butter(10,fc*2/fs);
Amplitude modulate the signal
y = ammod(s,fc,fs);
Demodulate the received signal.
z = amdemod(y,fc,fs,0,0,num,den);
Plot the original and demodulated signals.
plot(t,s,'c',t,z,'b--') legend('Original Signal','Demodulated Signal') xlabel('Time (s)') ylabel('Amplitude')
The demodulated signal is nearly identical to the original signal.
y— Amplitude modulated input signal
Amplitude modulated input signal, specified as a scalar, vector, matrix, or 3-D
array. Each element of
y must be real.
Fc— Carrier signal frequency
Carrier signal frequency in hertz (Hz), specified as a positive real scalar.
Fs— Sampling frequency
Sampling frequency of the carrier signal and input message signal in hertz (Hz),
specified as a positive real scalar. To avoid aliasing, the value of
Fs must satisfy
BW is the
bandwidth of the original modulated signal.
ini_phase— Initial phase
Initial phase of the modulated signal in radians, specified as a real scalar.
carramp— Carrier amplitude
Carrier amplitude of the modulated signal, specified as a real scalar.
num— Lowpass Butterworth filter numerator
Lowpass Butterworth filter numerator, specified as a real scalar.
den— Lowpass Butterworth filter denominator
Lowpass Butterworth filter denominator, specified as a real scalar.
z— Amplitude demodulated output signal
Amplitude demodulated output signal, returned as a scalar, vector, matrix, or 3-D array.