You are on page 1of 25

 

ë ë 
 
ë ë 

ë 
 ë ëë  

ë ë 


   ë
 ë 
  ë  
   

 

Y 

 
   
  
 
  
   
     
 
  
 
  
 
Y 

M  
          

M 
 



 
  
 
 


  
 
  

 
 
  
  
 
  

  
AMPLITUDE MODULATION MAY BE DEFINED AS A SYSTEM OF MODULATION IN
WHICH THE AMPLITUDE OF THE CARRIER IS MADE PROPORTIONAL TO THE
INSTANTANEOUS AMPLITUDE OF THE MODULATING VOLTAGE.

 

  Y
    
 


x
x  ×M  x  ëx  ë  x



  






 
 



 

 

 
 



 

 

 
  


 
 
 




  
Y
 
   



   
 
   


Y  

   Y 

 


 
 
Y



 
Y  
   
Y 
 



     

   Y
 


   

 

  

  
 
   


    ë ë  OÔ     ë ë OÔ

   
 

 M        


   M
 
 
    M M M  
      M
 
      M  

 
M   

         M




   M 
M   
   
  
M M  
Y

 


 

 





  
Y Y

  
 

  
 

   
   Y Y
Y Y
M   

á VARIABLE NAMES:
á Starts with a Letter

á Up to 31 characters can be used

á May contain letters, digits and underscore_

á Case sensitive (͞A͟ is not the same as ͞a͟)

á 

   

M   M M  






       !  !" 



##$  % "# $  
  !!#
&  &(#    ! !"'

'
) *%+ !# (' 



  !   
   ! 
!
 !" #Y     

 
  
 
 
 
  

 

 !" #


$

Y %
 &



N = [0:29];
X = COS(2*PI*N/10); % Fs=10

     
  

   Y


   

Y     
Y


  


N1 = 64;
X1 = ABS(FFT(X,N1));





   
!
   &     Y


  $


   
!
  "&&' #
F1 = [0 : N1 - 1]/N1;
PLOT(F1,X1); % Frequency Plot
DSB-AM APPROACH



% Amplitude Modulation with Single Tone Signal and its Spectrum Analysis
% Show the Time Domain and Frequency Domain Representation of DSB-AM

clc;

N = 1024; % N point FFT N>fc to avoid freq domain aliasing


fs = 4096; % sample frequency
t = (0:N-1)/fs;

% Taking User Input for Frequencies


% This is a Cell Array!
prompt={'Enter Carrier Frequency','Enter Message Signal Frequncy'};

% Name of the Dialog Box


name='FREQUENCIES';
numlines=1; % Number of lines visible for User Input
% Default Answer
defaultanswer={'0','0'};

% Creating the Dialog box where the User Input is stored into a Cell Array
answer=inputdlg(prompt,name,numlines,defaultanswer);

% We use {} to Extract the data from the cell array

fc = str2double(answer{1}); % Carrier Frequency


fm = str2double(answer{2}); % Message Signal Frequency

% Taking User Input for Amplitudes


% Cell Array
prompt={'Enter Carrier Amplitude','Enter Message Signal Amplitude'};

% Name of the Dialog Box


name='AMPLITUDE';

numlines=1; % Number of lines visible for User Input

% Default Answer
defaultanswer={'0','0'};
% Creating the Dialog box where the User Input is stored into a Cell Array
answer1=inputdlg(prompt,name,numlines,defaultanswer);

% We use {} to Extract the data from the cell array

Vc = str2double(answer1{1}); % Carrier Amplitude


Vm = str2double(answer1{2}); % Message Signal Amplitude

Vc1 = Vc*sin(2*pi*fc*t);
Vm1 = Vm*sin(2*pi*fm*t);

figure('Name','Time Domain Representation of Carrier Wave and Message Signal')


subplot(2,1,1); % Time Domain Plot
plot(t(1:N),Vm1(1:N));
title('Message Signal');
xlabel('Time');
ylabel('Amplitude');
subplot(2,1,2);
plot(t(1:N),Vc1(1:N));
title('Carrier Wave');
xlabel('Time');
ylabel('Amplitude');
%---------Double SideBand Full Carrier Modulation (DSB-FC(AM))

A = Vc + Vm*sin(2*pi*fm*t); % Envelope/eliminate the carrier amplitude


m = A.*[sin(2*pi*fc*t)]; % To Multiply two same sized vectors term by term

Mf = 2/N*abs(fft(m,N)); % Normalise the Data


f = fs * (0 : N/2)/N; % Since the fft result is symmetrical, only the positive half is
sufficient for spectral representation

figure('Name','Time/Frequency Domain Representation of DSB-AM Signal');


subplot(2,1,1); %Time domain plot
plot(t,m,t,A,'r',t,-A,'r');
title('Time Domain Representation');
xlabel('Time');
ylabel('Modulated signal');

subplot(2,1,2); %Frequency Domain Plot


plot(f(1:300),Mf(1:300)); % Take First 300 Samples
title('Frequency Domain Representation');
xlabel('Frequency (Hz)'); ylabel('Spectral Magnitude');

 

 

 
SSB-AM APPROACH



%Single SideBand Modulation


%Time domain and Frequency domain representation

N = 1024;
fs = 2048;
t = (0:N-1)/fs;

% Taking User Input for Frequencies


% This is a Cell Array!
prompt={'Enter Carrier Frequency','Enter Message Signal Frequncy'};

% Name of the Dialog Box


name='FREQUENCIES';

% Number of lines visible for User Input


numlines=1;
% Default Answer
defaultanswer={'0','0'};

% Creating the Dialog box where the User Input is stored into a Cell Array
answer=inputdlg(prompt,name,numlines,defaultanswer);

% We use {} to Extract the data from the cell array

fc = str2double(answer{1}); % Carrier Frequency


fm = str2double(answer{2}); % Message Signal Frequency

% Taking User Input for Amplitudes


% Cell Array
prompt={'Enter Carrier Amplitude','Enter Message Signal Amplitude'};

% Name of the Dialog Box


name='AMPLITUDE';

% Number of lines visible for User Input


numlines=1;
% Default Answer
defaultanswer={'0','0'};

% Creating the Dialog box where the User Input is stored into a Cell Array
answer1=inputdlg(prompt,name,numlines,defaultanswer);

% We use {} to Extract the data from the cell array

Vc = str2double(answer1{1}); % Carrier Amplitude


Vm = str2double(answer1{2}); % Message Signal Amplitude

m = Vm*sin(2*pi*fm*t); %Message
n = Vm*sin(2*pi*fm*t+(pi*90/180)); % 90 Degree Phase Shift of Message Signal
a = Vc*sin(2*pi*fc*t); % Carrier
b = Vc*sin(2*pi*fc*t+(pi*90/180)); % 90 Degree Phase Shift of Carrier Signal

x=n.*a;
y=m.*b;
p=x+y;
q=x-y;
SBU=2/N*abs(fft(p));
SBL=2/N*abs(fft(q));
freq=fs*(0:N/2)/N;
figure('Name','Time Domain Representation of BM Outputs');
subplot(211); % Time Domain Plot
plot(t(1:200),x(1:200),'b'); % Take First 200 Samples
title('Time Domain Representation - OUTPUT AT BM-A ');
xlabel('Time');
ylabel('Modulated Signal');

subplot(212); % Time Domain Plot


plot(t(1:200),y(1:200),'r'); % Take First 200 Samples
title('Time Domain Representation - OUTPUT AT BM-B ');
xlabel('Time'); ylabel('Modulated Signal');

figure('Name','Time/Frequency Domain Representation of SSB Modulated Signal');


subplot(311); % Time Domain Plot
plot(t(1:200),p(1:200),'b'); % Take First 200 Samples
title('Time Domain Representation - Individual Outputs are Added (USB)');
xlabel('Time'); ylabel('Modulated Signal');
subplot(312); % Time Domain Plot
plot(t(1:200),q(1:200),'magenta'); % Take First 200 Samples
title('Time Domain Representation - Individual Outputs are Subtracted (LSB)');
xlabel('Time'); ylabel('Modulated Signal');

subplot(313); % Frequency Domain Plot


plot(freq,SBU(1:N/2+1),͛b͛,freq,SBL(1:N/2+1),͛g͛);
title('Frequency Domain Representation ');
xlabel('Frequency (Hz)'); ylabel('Spectral Magnitude');
legend('USB','LSB');

 

   



   
  
 Y

 

ö Õ  
ö  
  
ö       
ö  

 

; D 
; Õ 
; Õ 

   
;  
; Õ
;  Õ   D Õ







i ((()*+,(-./01-)
i (((2345/6*778.1-)