AM, FM, and PM Modulation Implementation in MATLAB
Advertisement
This section provides MATLAB source code demonstrating AM, FM, and PM modulation. It utilizes the modulate MATLAB function.
Using the modulate MATLAB Function
% Parameters for signal creation
Fs = 8000; % Sampling frequency
t = (0:1000-1)/Fs; % Time vector
s = 4*cos(2*pi*500*t); % Modulating signal
% Frequency Domain analysis of unmodulated signal
sdft = fft(s);
N = length(s);
sdft = sdft(1:N/2+1);
psdy1 = (1/(Fs*N)) * abs(sdft).^2;
psdy1(2:end-1) = 2*psdy1(2:end-1);
freq = 0:Fs/length(s):Fs/2;
figure;
plot(freq,10*log10(psdy1));
title('Frequency Spectrum of Unmodulated Signal');
xlabel('Frequency (Hz)');
ylabel('Power Spectral Density (dB/Hz)');
% AM Modulation
y = modulate(s, 3e3, Fs, 'am', 0.1); % Modulated signal
% Frequency Domain analysis of modulated signal
ydft = fft(y);
N = length(y);
ydft = ydft(1:N/2+1);
psdy = (1/(Fs*N)) * abs(ydft).^2;
psdy(2:end-1) = 2*psdy(2:end-1);
freq = 0:Fs/length(y):Fs/2;
figure;
plot(freq,10*log10(psdy));
title('Frequency Spectrum of AM Modulated Signal');
xlabel('Frequency (Hz)');
ylabel('Power Spectral Density (dB/Hz)');
Unmodulated Input Signal:

AM Modulated Signal Output:

FM and PM Modulation
Similar to AM, FM and PM modulation can also be implemented using the modulate function by changing the fourth argument to 'fm' or 'pm' respectively. For example:
% FM Modulation
y_fm = modulate(s, 3e3, Fs, 'fm', 10); % 10 is the modulation index here
% PM Modulation
y_pm = modulate(s, 3e3, Fs, 'pm', 5); % 5 is the modulation index here
Explore MATLAB Wireless Communications & Modulation
- AM/FM/PM Modulation in MATLAB
- ASK Modulation in MATLAB
- FSK Modulation in MATLAB
- MSK Modulation in MATLAB
- GMSK Modulation in MATLAB
- PSK Modulation (MATLAB Code)
- BPSK, QPSK, 16-QAM, 64-QAM (MATLAB Code)
- On-Off Keying (OOK) (MATLAB Code)
- OFDM (MATLAB Code)
- OFDMA Basics (MATLAB Code)
- SC-FDMA Basics (MATLAB Implementation)
- WiMAX OFDM Basics (MATLAB Code)
- WLAN OFDM Basics (MATLAB Code)
- LTE Basics (MATLAB Code)
- OFCDM (MATLAB Code)
- Beamforming (MATLAB Code QAM)
- 2x2 MIMO & STBC (MATLAB Code)
- CDMA (MATLAB Code)
- Zigbee Transceiver (MATLAB Code)
Continue Learning Modulation Types
- AM Vs. FM Vs. PM : Difference between Analog Modulation Techniques
- ASK Vs. FSK Vs. PSK : Difference between Digital Modulation Techniques
- PAM Vs. PWM Vs. PPM : Difference between Pulse Modulation Techniques
- BPSK Vs. QPSK : Key Differences
- 16-QAM Vs. 64-QAM Vs. 256-QAM : Key Differences
- 512-QAM Vs. 1024-QAM Vs. 2048-QAM Vs. 4096-QAM
- 4096QAM Modulation Used in Wi-Fi 7
- MSK Vs. GMSK : Modulation Technique used in GSM
- LORa Modulation Used in LoRaWAN
- 10% ASK & 100% ASK Modulation used in NFC
- OOK Vs. VPPM Vs. CSK : Visible Light Communication (VLC) Modulation Techniques
- QPSK Vs. OQPSK Vs. PI/4 QPSK
- PAM4 Modulation Used in Gigabit Ethernet
- CCK Vs. DSSS Vs. OFDM Used in WLAN (Wi-Fi) Standards
