06.06.2022 Views

B. P. Lathi, Zhi Ding - Modern Digital and Analog Communication Systems-Oxford University Press (2009)

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

194 AMPLITUDE MODULATIONS AND DEMODULATIONS

S_qam= fftshift (fft(s_qam,Lfft) );

freqs= ( -Lfft/2 :Lfft/2-1)/(Lfft*ts) ;

% Demodulation begins by using a rectifier

s_deml=s_qam.*cos (2*pi*fc*t)*2;

S_deml=fftshift (fft (s_deml ,Lfft) );

% Demodulate the 2nd signal

s_dem2 =s_qam.*sin(2*pi*fc*t}*2;

S_dem2 =fftshift ( fft ( s_dem2 ,Lfft) );

%

% Using an ideal LPF with bandwidth 150 Hz

s_recl=filter (h, 1,s_deml );

S_recl=fftshift (fft (s_recl,Lfft) );

s_rec2=filter (h, 1,s_dem2 );

S_rec2=fftshift (fft (s_rec2 ,Lfft) );

Trange= [-0.025 0.025 -2 2) ;

Trange2=[-0.025 0.025 -2 4) ;

figure (l)

subplot (221) ;tdl=plot (t,m_sigl ) ;

axis ( Trange) ; set (tdl , 'Linewidth ' ,1.5) ;

xlabel ('{\it t} (sec ) '); ylabel ('{\it m} ({\ it t } )');

title ('message signal 1');

subplot (222) ;td2=plot (t,s_qam) ;

axis( Trange) ; set (td2 , 'Linewidth' ,1.5) ;

xlabel ('{\it t } (sec) '); ylabel ('{\it s } _{\rm DSB} ({\ it t}) ')

title ('QAM modulated signal');

subplot (223) ; td3=plot (t,s_deml );

axis( Trange2 }; set (td3 , 'Linewidth ' ,1.5) ;

xlabel ('{\ it t} (sec) '); ylabel ('{\it x }({\it t})')

title ('first demodulator output ');

subplot (224) ;td4=plot (t,s_recl ) ;

axis ( Trange ) ; set (td4, 'Linewidth' ,1.5) ;

xlabel ('{\it t} (sec) '); ylabel ('{\it m} _{dl} ( {\it t} )')

title ('detected signal 1');

figure (2)

subplot (221) ; td5=plot (t,m_sig2 );

axis ( Trange } ; set (td5 , 'Linewidth' ,1.5) ;

xlabel ('{\it t} (sec } '); ylabel ('{\it m} ({\i t t}) ');

title ('message signal 2');

subplot (222) ;td6=plot (t,s_qam) ;

axis( Trange) ; set (td6 , 'Linewidth ' ,1.5) ;

xlabel ('{\it t } (sec ) '); ylabel ('{\it s } _{\ rm DSB} ({\ it t} )')

title ('QAM modulated signal ');

subplot (223) ;td7=plot (t,s_dem2 ) ;

axis ( Trange2 ); set (td7 , 'Linewidth ' , 1 .5) ;

xlabel ('{\it t} (sec ) '); ylabel ('{\it e}_l({\it t} )')

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!