📄 stufilnoise.m
字号:
%filter test
%generate signal
fs = 100;
t = 0:1/fs:1;
noise = randn(1,length(t));
s = sin(2*pi*t*5)+sin(2*pi*t*15)+sin(2*pi*t*30);%0.5*noise;
%a = 1; % FIR filter
%b = Num; % from FDAtool
b = [-4.9537e-018 -0.0088982 0.010813 0.056032 0.069341 -2.0882e-017...
-0.11389 -0.15675 -0.056777 0.11511 0.2 0.11511 -0.056777 -0.15675...
-0.11389 -2.0882e-017 0.069341 0.056032 0.010813 -0.0088982 -4.9537e-018];
sf = fftfilt(b,s);
% compare two spectrum
SS = fft(s,512);
ASS = abs(SS)/fs;
SFF = fft(sf,512);
ASFF = abs(SFF)/fs;
deltaF = fs*(0:255)/512;
figure(1);
subplot(221);
plot(t,s);
subplot(223);
plot(deltaF,ASS(1:256));
subplot(222);
plot(t,sf);
subplot(224);
plot(deltaF,ASFF(1:256));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -