returns an amplitude modulated (AM) signal
y = ammod(
y, given the input message
x, where the carrier signal has frequency
Fc. The carrier signal and
x have a sampling
Fs. The modulated signal has zero initial phase and zero
carrier amplitude, so the result is suppressed-carrier modulation.
The value of
Fs must satisfy
Set the sample rate to 100 Hz. Create a time vector 100 seconds long.
fs = 100; t = (0:1/fs:100)';
Set the carrier frequency to 10 Hz. Generate a sinusoidal signal.
fc = 10; x = sin(2*pi*t);
x using single- and double-sideband AM.
ydouble = ammod(x,fc,fs); ysingle = ssbmod(x,fc,fs);
Create a spectrum analyzer object to plot the spectra of the two signals. Plot the spectrum of the double-sideband signal.
sa = dsp.SpectrumAnalyzer('SampleRate',fs, ... 'PlotAsTwoSidedSpectrum',false, ... 'YLimits',[-60 40]); step(sa,ydouble)
Plot the single-sideband spectrum.
x— Input message signal
Input message signal, specified as a scalar, vector, matrix, or a 3-D array. Each
x must be real.
Fc— Carrier signal frequency
Carrier signal frequency in hertz (Hz), specified as a positive real scalar.
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.
y— Amplitude modulated output signal
Amplitude modulated signal, returned as a scalar, vector, matrix, or 3-D array.