Академический Документы
Профессиональный Документы
Культура Документы
Assignment 1: MATLAB
[ m>1 ] ; m=0.5
Programme Script:
Programme Script:
%total modulation
Fs=10;
Fm=2;
figure;
mu=1;
t=0:1/Fs:50;
mt=cos(2*pi*Fm*t);
st=Ac*(1+mu*mt).*cos(2*pi*Fc*t);
subplot(2,1,1);
plot(t,st,t,Ac*(mu*mt+ones(1,length(mt))),'r');
title('\mu=1 total modulation£ºAc(1+\mucos(2\pi0.05t))cos(2\pi0.4t)');
xlabel('time (s)');ylabel('amplitude');
st_fft=fft(st);
st_fft=fftshift(st_fft);
st_fft_fre=Fs/2*linspace(-1,1,length(st_fft));
subplot(2,1,2);
plot(st_fft_fre,abs(st_fft));
title('spectrum£ºside frequency amplitude=carrier frequency amplitude*\mu/2');
xlabel('Frequency (Hz)');axis([-1 1 0 1000*Ac+100]);
[ Command Window ]
[ Waveform and Frequency Spectrum for m=1 ]
[ m>1 ] ; m=2.0
Programme Script:
%%overmodulation
figure;
mu=2;
t=0:1/Fs:50;
mt=cos(2*pi*Fm*t);
st=Ac*(1+mu*mt).*cos(2*pi*Fc*t);
subplot(2,1,1);
plot(t,st,t,Ac*(mu*mt+ones(1,length(mt))),'r');
title('\mu=2 overmodulation£ºAc(1+\mucos(2\pi0.05t))cos(2\pi0.4t)');
xlabel('time (s)');ylabel('amplitude');
st_fft=fft(st);
st_fft=fftshift(st_fft);
st_fft_fre=Fs/2*linspace(-1,1,length(st_fft));
subplot(2,1,2);
plot(st_fft_fre,abs(st_fft));
title('spectrum£ºside frequency amplitude=carrier frequency amplitude*\mu/2');
xlabel('Frequency (Hz)');axis([-1 1 0 1000*Ac+100]);
[ Command Window ]
[ Waveform and Frequency Spectrum for m=2 (m>1) ]
b) Show a wave with a variety of harmonics.
Programme Script:
t = 0:.1:10;
y = sin(t);
plot(t,y);
[ Command Window ]
[ Waveform ]
If a third harmonic is added to the system;
Programme Script:
y = sin(t) + sin(3*t)/3;
plot(t,y);
[ Command Window ]
[ Waveform ]
Then, first, third, fifth, seventh, and ninth harmonics were added to system;
Programme Script:
[ Command Window ]
[ Waveform ]