📄 滤波.txt
字号:
f=100; %取样频率
N=1024; %总点数
Ts=1/f; %取样间隔
T=Ts*N; %取样总时间
n=0:N-1;
t=n*Ts;
x1=cos(pi*t);
x2=cos(9*pi*t);
x3=x1.*x2;
subplot(511),plot(x1);% 绘出调制信号
grid;title('调制信号');
subplot(512),plot(x3);% 绘出己调信号
grid;title('己调信号');
Y=abs(fft(x3,N)); %已调信号频谱
subplot(513)
plot(n,Y);title('己调信号频谱')
x4=x3.*cos(9*pi*t); %解调信号
Wp=1;Ws=3;Rp=2;Rs=30;
[N,Wn]=buttord(Wp/50,Ws/50,Rp,Rs);
[b,a]=butter(N,Wn);
y=filter(b,a,x4); %滤波
Y2=abs(fft(y))
Y3=fft(y); %滤波后信号频谱
subplot(514)
plot(Y2);title('滤波后信号频谱');
Y4=ifft(Y3);
subplot(515)
plot(t,Y4); %滤波后得到原信号
title('滤波后得到原信号');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -