资源描述:
《AM调制解调及matlab仿真程序和图》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、(1)所用滤波器函数:巴特沃斯滤波器%注:wp(或Wp)为通带截止频率ws(或Ws)为阻带截止频率Rp为通带衰减As为阻带衰减%butterworth低通滤波器原型设计函数要求Ws>Wp>0As>Rp>0function[b,a]=afd_butt(Wp,Ws,Rp,As)N=ceil((log10((10^(Rp/10)-1)/(10^(As/10)-1)))/(2*log10(Wp/Ws)));%上条语句为求滤波器阶数N为整数%ceil朝正无穷大方向取整fprintf('ButterworthFilterOrder=%2.0f',N)OmegaC
2、=Wp/((10^(Rp/10)-1)^(1/(2*N)))%求对应于N的3db截止频率[b,a]=u_buttap(N,OmegaC);(2)傅里叶变换函数function[Xk]=dft(xn,N)n=[0:1:N-1];k=[0:1:N-1];WN=exp(-j*2*pi/N);nk=n'*k;WNnk=WN.^(nk);Xk=xn*WNnk;设计部分:1.普通AM调制与解调%单音普通调幅波调制y=amod(x,t,fs,t0,fc,Vm0,ma)要求fs>2fc%x调制信号,t调制信号自变量,t0采样区间,fs采样频率,%fc载波频率,Vm0输出载波
3、电压振幅,ma调幅度t0=0.1;fs=12000;fc=1000;Vm0=2.5;ma=0.25;n=-t0/2:1/fs:t0/2;x=4*cos(150*pi*n);%调制信号y2=Vm0*cos(2*pi*fc*n);%载波信号figure(1)subplot(2,1,1);plot(n,y2);axis([-0.01,0.01,-5,5]);title('载波信号');N=length(x);Y2=fft(y2);subplot(2,1,2);plot(n,Y2);title('载波信号频谱');%画出频谱波形y=Vm0*(1+ma*x/Vm0).
4、*cos(2*pi*fc*n);figure(2)subplot(2,1,1);plot(n,x)title('调制信号');subplot(2,1,2)plot(n,y)title('已调波信号');X=fft(x);Y=fft(y);w=0:2*pi/(N-1):2*pi;figure(3)subplot(2,1,1);plot(w,abs(X))axis([0,pi/4,0,2000]);title('调制信号频谱');subplot(2,1,2);plot(w,abs(Y))axis([pi/6,pi/4,0,1200]);title('已调波信号频
5、谱');%画出频谱波形y1=y-2*cos(800*pi*n);y2=Vm0*y1.*cos(2*pi*fc*n);%将已调幅波信号的频谱搬移到原调制信号频谱处wp=40/N*pi;ws=60/N*pi;Rp=1;As=15;T=1;%滤波器参数设计OmegaP=wp/T;OmegaS=ws/T;[cs,ds]=afd_butt(OmegaP,OmegaS,Rp,As);[b,a]=imp_invr(cs,ds,T);y=filter(b,a,y2);figure(4)subplot(2,1,1);plot(n,y)title('解调波');Y=fft(y)
6、;subplot(2,1,2);plot(w,abs(Y))axis([0,pi/6,0,1000]);title('解调信号频谱');%画出频谱波形结果:ButterworthFilterOrder=6OmegaC=0.11712.抑制双边带调制与解调%单音抑制载波双边带调制y=amod(x,t,fs,t0,fc,Vm0,ma)要求fs>2fc%x调制信号,t0采样区间,fs采样频率,%fc载波频率,Vm0输出载波电压振幅,ma调幅度t0=0.1;fs=12000;fc=1000;Vm0=2.5;ma=0.25;n=-t0/2:1/fs:t0/2;x=4*
7、cos(150*pi*n);%调制信号y=Vm0*x.*cos(2*pi*fc*n);%载波信号figure(1)subplot(2,1,1)plot(n,x)title('调制信号');subplot(2,1,2)plot(n,y)title('已调波信号');N=length(x);X=fft(x);Y=fft(y);w=0:2*pi/(N-1):2*pi;figure(2)subplot(2,1,1)plot(w,abs(X))axis([0,pi/4,0,2000]);title('调制信号频谱');%画出频谱波形subplot(2,1,2)plot
8、(w,abs(Y))axis([pi/6,pi/4,