Search This Blog

Thursday 29 October 2015

AMPLITUDE MODULATION AND DEMODULATION



fs=input('enter the value of sampling frequency'); fc=input('enter the value of carrier frequency'); fm=input('enter the value of modulating frequency'); t=0:(1/fs):2;
A=cos(2*pi*fm*t); m1=1; opt=(-1)/m1;
AM=modulate(A,fc,fs,'amdsb-tc',opt); AM3=demod(AM,fc,fs,'amdsb-tc',opt); m2=0.9; opt=(-1)/m2;
AM1=modulate(A,fc,fs,'amdsb-tc',opt); AM4=demod(AM1,fc,fs,'amdsb-tc',opt); m3=1; opt=(-1)/m3;
AM2=modulate(A,fc,fs,'amdsb-tc',opt); AM5=demod(AM2,fc,fs,'amdsb-tc',opt);
subplot(3,3,1); plot(t,A); xlabel('time'); ylabel('amplitude'); title('modulating signal'); subplot(3,3,2); plot(t,AM); xlabel('time'); ylabel('amplitude'); title('AM for m=1 signal'); subplot(3,3,3); plot(t,AM1); xlabel('time'); ylabel('amplitude'); title('AM for m<1 signal'); subplot(3,3,4); plot(t,AM2); xlabel('time'); ylabel('amplitude'); title('AM for m>1 signal'); subplot(3,3,5); plot(t,AM3); xlabel('time'); ylabel('amplitude'); title('demodulating signal for m=1');
subplot(3,3,6); plot(t,AM4); xlabel('time'); ylabel('amplitude'); title('demodulating signal for m<1');

subplot(3,3,7); plot(t,AM5); xlabel('time'); ylabel('amplitude'); title('demodulating signal for m>1'); 

No comments:

Post a Comment