信号调制的方法有调幅、调频、调相,相对于第一种而言,后两者的频宽比较大,相对占用资源比较多。
Fs=44100;
Fc=1000;
dt=1.0/Fs;
T=1; N=T/dt;
t=[0:N-1]/N;
x1=sin(2*pi*100*t)+1.3;
% amplitude modulation, dev is coefficient of x1(t)
y1=ammod(x1,Fc,Fs);
subplot(3,2,1)
plot(t,y1);
axis([0,0.05,-2.5,2.5]);
P=fft(y1,N);
Pyy=2*sqrt(P.*conj(P))/N;
f=linspace(0,Fs/2,N/2);
Pdb=20*log10(Pyy);
subplot(3,2,2)
plot(f,Pdb(1:N/2));
% frequency modulation
y2=fmmod(x1,Fc,Fs,200);
P=fft(y2,N);
subplot(3,2,3)
plot(t,y2);
axis([0,0.05,-2.5,2.5]);
Pyy=2*sqrt(P.*conj(P))/N;
f=linspace(0,Fs/2,N/2);
Pdb=20*log10(Pyy);
subplot(3,2,4)
plot(f,Pdb(1:N/2));
% phase modulation, cannot solve bias, need to be fixed
y3=pmmod(x1,Fc,Fs,3.14,-3.14*1.3);
P=fft(y3,N);
subplot(3,2,5)
plot(t,y3);
axis([0,0.05,-2.5,2.5]);
Pyy=2*sqrt(P.*conj(P))/N;
f=linspace(0,Fs/2,N/2);
Pdb=20*log10(Pyy);
subplot(3,2,6)
plot(f,Pdb(1:N/2));