filter.m
来自「基于Matlab编写的用于对数据进行插值分析和傅立叶变换的程序」· M 代码 · 共 16 行
M
16 行
clear all;
clc
N=40;%滤波器阶数
W1=0.1;
W2=0.2;%通带W1<W<W2
B=fir1(N,[W1 W2],hanning(N+1));
x=0:0.001:1;
y=sin(x)+sin(30*x)+sin(100*x)+sin(1000*x)+sin(0.1*x);
y1=filter(B,1,y);
figure
subplot(211)
plot(x,y,'r');
subplot(212)
plot(x,y1)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?