Tuesday 6 August 2013

Amplitude modulation Code in Matlab


Program

fs=500;
fc=50;
t=[0:2*fs]/fs;
x=2*sin(2*pi*t);
y=ammod(x,fc,fs);
z=fft(y);
f=[0:length(z)-1];
subplot(2,2,1);
plot(t,x);
xlabel('time');
xlabel('Freequency');
ylabel('amplitude');
title('Input Waveform');
subplot(2,2,2);
plot(f,y);
ylabel('amplitude');
title('modulated waveform');
subplot(2,2,3);
plot(f,z);
xlabel('Freequency');
ylabel('amplitude');
title('spectrum diagram');x= ammod(y,fc,fs);
subplot(2,2,4);
plot(t,x);
xlabel('time);
ylabel('amplitude);
title('demodulated waveform)




Output waveforms



No comments:

Post a Comment