📄 combfilt.m
字号:
function out=combfilt(signal,fs,fcut,alpha)
%OUT=COMBFILT(SIGNAL,FS,FCUT,ALPHA) where Signal is the array to be filtered
% FS is the sampling frequency, FCUT is the cutoff frequency and ALPHA is
% is the ALPHA parameter.
% This Function was supplied by www.PATENWorks.com
k=round(fs/fcut);
%set Feed Forward Gain
ffgain=1;
%Set Output Gain
outgain=-1;
%Set Alpha parameters gain
alphagain=alpha^k;
%Initialise Buffer
buffer=zeros(1,k);
count=1;
fb=0;
delay=0;
for a=1:length(signal)
buffer(count)=signal(a)+fb;
ff=buffer(count);
fb=delay*alphagain;
out(a)=-delay+ff;
count=count+1;
if count==k+1;
count=1;
end
delay=buffer(count);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -