I am trying to demonstrate Conventional and DSB-SC modulation of a signal $ \sin(2\pi1000t) $ using MatLab. My carrier signal is $ \sin(2\pi f_ct)$ where $f_c = 100\text{ MHz}$. Now according to theory, after modulation, the modulated signal should have a spectrum same as that of message signal shifted to the frequency of carrier on both sides. But I am getting the plot as that of the carrier signal in the frequency domain. This is the code that I am using for DSB-SC modulation

% CODE FOR PLOTTING MESSAGE SIGNAL %%%%%%%%%%%%%%%%%%%%%%%%%%%%

Fs = 20*100*10^6/3;
Fm = 1000; %Hz
t = 0:1/Fs:0.005-1/Fs;

Am = 1;

m = Am*sin(2*pi*Fm*t);

temp = size(m);
N = temp(2);

f = -Fs/2:Fs/(N-1):Fs/2;

M = fftshift(fft(m));
title('Message signal')
xlabel('Frequency in Hertz') 

% CODE FOR PLOTTING CARRIER SIGNAL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Fc=100*10^6;%100 MHz

Fs = 20*Fc/3;
Ac = 1;%amplitude
c = Ac*sin(2*pi*Fc*t);

temp = size(c);
N = temp(2);

f = -Fs/2:Fs/(N-1):Fs/2;

C = fftshift(fft(c));
title('Carrier signal')
xlabel('Frequency in Hertz') 

% CODE FOR PLOTTING DSB-SC MODUALTED SIGNAL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

s = Ac*m.*sin(2*pi*Fc*t);

temp = size(s);
N = temp(2);

f = -Fs/2:Fs/(N-1):Fs/2;

S = fftshift(fft(s));
title('DSB-SB Modulated signal')
xlabel('Frequency in Hertz') 

enter image description here And this is the spectrum of $S(f)$ in code. As you can see. there are only two peaks, one at $+f_c$ and one at $-f_c$(not shown in figure). But in reality, it should have been 2 peaks at $f_c+f_m , f_c-f_m$ and two peaks at $-f_c-f_m,-f_c+f_m$. So what is going wrong here? How can I fix this?


1 Answer 1


The problem is lack of frequency resolution in your plot. What you are seeing is in fact the two sidebands. Just zoom in to see them:

enter image description here

My advice is to use a much lower carrier frequency, such as 10 kHz. Doing so will make it much easier to study this modulation in Matlab, without sacrificing anything essential.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.