Matlab file
Matlab file
Theory:
Amplitude Modulation is a method used to transmit information (like voice or music) using a high-
frequency wave called a carrier wave. In AM, the amplitude (or height) of the carrier wave is changed
according to the message signal (also called modulating signal), while the frequency and phase of the
carrier wave remain the same.
Key Points:
Demodulation:
Demodulation is the process of recovering the original message signal from the AM wave.
There are two common methods:
1. Envelope Detection
This is used when modulation index μ ≤ 1.
It works by tracing the "envelope" (outer shape) of the AM wave.
A diode and capacitor circuit can do this in hardware.
In MATLAB, we can simulate this using the abs() function.
2. Coherent Detection
Requires a locally generated carrier signal that is exactly in sync with the original carrier.
It multiplies the AM signal with the same carrier, then applies a low-pass filter.
Block Diagram:
fc = 1000;
Ac = 2;
c = Ac * cos(2*pi*fc*t);
% AM SIGNAL
AM = (1 + (m / Ac)) .* c;
% DEMODULATION
demodulated = abs(AM);
demodulated_filtered = lowpass(demodulated, fm*2, fs);
% PLOT RESULTS
figure;
subplot(3,1,1);
plot(t, AM);
title('AM Signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(3,1,3);
plot(t, demodulated_filtered);
title('Demodulated Signal (After Low-pass Filter)');
xlabel('Time (s)');
ylabel('Amplitude');
Theory:
What is FM?
In Frequency Modulation, the frequency of a high-frequency carrier wave is changed based on the
amplitude of the message signal.
The amplitude of the carrier remains constant.
How it works?
If the message signal is positive, the carrier frequency increases.
If the message signal is negative, the carrier frequency decreases.
This makes the wave vary in frequency depending on the message, while its height (amplitude)
stays the same.
What is FM Demodulation?
FM demodulation is the process of getting the original message signal back from the FM wave.
Common Methods:
1. Frequency Discriminator (Slope Detection)
Converts frequency changes into amplitude changes.
Then uses an envelope detector to recover the message.
2. Phase-Locked Loop (PLL) – Most common
A PLL tracks the frequency of the FM signal.
It produces an output that follows the frequency changes.
Then, it converts these changes back into the original signal.
Advantages
Better noise immunity than AM
Constant amplitude → less power variation
Used in FM radio, telemetry, radar, and audio broadcasting
Disadvantages
Requires more bandwidth than AM
More complex circuits for modulation and demodulation
Block Diagram:
% MESSAGE SIGNAL
m = Am * cos(2 * pi * fm * t);
% CARRIER SIGNAL
c = Ac * cos(2 * pi * fc * t);
subplot(3,1,1);
plot(t, m, 'b', 'LineWidth', 1.5);
title('Message Signal');
xlabel('Time (s)'); ylabel('Amplitude');
grid on; axis tight;
subplot(3,1,2);
plot(t, s, 'r', 'LineWidth', 1.5);
title('FM Modulated Signal');
xlabel('Time (s)'); ylabel('Amplitude');
grid on; axis tight;
subplot(3,1,3);
plot(t, demod_signal, 'g', 'LineWidth', 1.5);
title('FM Demodulated Signal');
xlabel('Time (s)'); ylabel('Amplitude');
grid on; axis tight;
Theory:
What is PM?
Phase Modulation (PM) is a type of angle modulation where the phase of the carrier signal is varied
proportionally to the amplitude of the message signal, while the frequency and amplitude of the carrier
remain constant.
Mathematical Expression
Let:
m(t). : message signal (e.g., sine wave)
Ac : amplitude of the carrier
fc : carrier frequency
kp : phase sensitivity constant (radians/volt)
Key Concepts
Term Meaning
Carrier signal High-frequency sinusoid that carries the message
Phase deviation Δϕ = kp⋅m(t) (how much the phase shifts)
Modulation index β= kp ⋅Am (proportional to peak message amplitude)
Instantaneous phase Total angle = carrier phase + modulating signal's effect
Bandwidth Similar to FM, estimated using Carson’s Rule: BW≈2(β+fm)
PM Demodulation
PM demodulation is more complex and typically done by:
First converting phase variations to frequency variations
Then applying FM demodulation techniques
Advantages of PM
Better noise performance than AM
More efficient use of power
Often used in digital communications (e.g., PSK)
Disadvantages
Demodulation is more complex
Less popular for analog audio than FM
Block Diagram:
(i) Configuration (ii) Output waveform
Message Signal
Output Frequency Modulated Waveform:
Script:
fs = 5000;
fc = 500;
t = (0:1/fs:0.2)';
% MESSAGE SIGNAL
x = sin(2*pi*30*t) + 2*sin(2*pi*60*t);
% PHASE MODULATION
fDev = 1; % Increased frequency deviation
y = pmmod(x, fc, fs, fDev);
z = pmdemod(y, fc, fs, fDev);
% PLOT SIGNALS
plot(t, x, 'r', 'LineWidth', 1.5); % Original signal in red
hold on;
plot(t, y, 'b', 'LineWidth', 1.5); % Modulated signal in blue
hold off;
xlabel('Time (s)');
ylabel('Amplitude');
legend('Original Signal', 'Modulated Signal');
grid on;
title('Original vs. Phase Modulated Signal');
Theory:
What is DSB-SC?
DSB-SC is a type of amplitude modulation where the modulated signal contains only the upper and lower
sidebands, while the carrier is not transmitted. The information from the message signal is fully present in
these sidebands.
Characteristics of DSB-SC:
The signal has two sidebands: one above and one below the carrier frequency.
The carrier is not present in the transmitted signal.
The modulated signal is symmetrical around the carrier frequency.
Bandwidth is the same as standard AM, which is twice the highest frequency of the message signal.
Transmission is more power-efficient than regular AM.
Mathematical Expression:
Let:
m(t) : message signal
c(t) = Accos(2πfct) : carrier signal carrier signal
Ac : amplitude of the carrier
fc : carrier frequency
% DSB-SC SIGNAL
s_DSB_SC = m .* c;
% DSB-FC SIGNAL
mu = 1; % Modulation index
s_DSB_FC = (Ac * (1 + mu * cos(2*pi*fm*t))) .* cos(2*pi*fc*t);
% PLOT SIGNALS
figure;
subplot(4,1,1);
plot(t,m, 'b');
title('Message Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,2);
plot(t,s_DSB_SC , 'r');
title('DSB-SC Modulated Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(2,1,2);
plot(f, S_DSB_FC, 'b', 'LineWidth', 1.5);
xlabel('Frequency (Hz)'); ylabel('Magnitude');
title('Frequency Spectrum of DSB-FC');
grid on;
Output:
Aim:
To study the operation of Single Sideband Suppressed Carrier Amplitude Modulation
Theory:
What is SSB?
Single Sideband (SSB) is a type of amplitude modulation where only one of the two sidebands (either the
upper or lower) is transmitted, and both the carrier and the other sideband are suppressed.
In regular AM or DSB-SC, two sidebands are transmitted, but they carry the same information. So SSB
removes the redundancy by keeping only one.
Characteristics of SSB:
Only one sideband (upper or lower) is transmitted.
Carrier and other sideband are fully removed.
Bandwidth required is the same as the message signal's highest frequency.
SSB is more complex to generate and recover but highly efficient.
Mathematical Expression
Let:
m(t). : message signal (baseband)
fc : carrier frequency
The DSB-SC signal is:
sDSB-SC(t) = m(t)⋅cos(2πfct)
But this contains both upper and lower sidebands.To get SSB, we need to remove one sideband using
filtering or mathematical transformation.
The SSB modulated signal can be written as:
sSSB(t)=m(t)⋅cos(2πfct) ± m’(t)⋅sin(2πfct))
Where:
m’(t) is the Hilbert Transform of m(t)
+ sign gives upper sideband (USB)
− sign gives lower sideband (LSB)
Script:
% PARAMETERS
fs = 10000;
t = 0:1/fs:0.1;
fm = 100;
fc = 1000;
m = cos(2*pi*fm*t); % message signal
m_shifted = sin(2*pi*fm*t); % 90-degree phase-shifted message
signal
c1 = cos(2*pi*fc*t); % In-phase carrier
c2 = sin(2*pi*fc*t); % Quadrature carrier (90-degree
shifted)
subplot(3,2,3);
plot(t, ssb_usb);
title('SSB Upper Sideband (USB)');
xlabel('Time (s)'); ylabel('Amplitude');
subplot(3,2,5);
plot(t, ssb_lsb);
title('SSB Lower Sideband (LSB)');
xlabel('Time (s)'); ylabel('Amplitude');
subplot(3,2,4);
plot(f, USB_f);
title('Spectrum of SSB Upper Sideband (USB)');
xlabel('Frequency (Hz)'); ylabel('Magnitude');
subplot(3,2,6);
plot(f, LSB_f);
title('Spectrum of SSB Lower Sideband (LSB)');
xlabel('Frequency (Hz)'); ylabel('Magnitude');