滤波程序.rar

  • tomdeng
    了解作者
  • matlab
    开发工具
  • 1KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 2
    下载次数
  • 2020-12-30 15:50
    上传日期
高通滤波器低通滤波器带通滤波器,信号能实现滤波,
滤波程序.rar
  • 滤波程序
  • main.m
    669B
  • Fcn_filtfilt_butterworth.m
    1.3KB
内容介绍
function yf = Fcn_filtfilt_butterworth(y, fSample, fPass, fStop, Rp, Rs, filterType) % This function is a Zero-phase Butterworth filter. % fSample represents the sampling rate % fPass represents the cut-off frequency % fStop represents the stop frequency % Rp denotes Passband ripple in decibels % Rs: denotes Stopband attenuation in decibels. This value is the number of decibels % the stopband is down from the passband. % filterType is the type of filter % FilterGroup = {'low','high','bandpass','stop' }; % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % FilterGroup = {'low','high','bandpass','stop' }; % switch filterType case 1 Wp = fPass(1)/(fSample/2); Ws = fStop(1)/(fSample/2); case 2 Wp = fPass(1)/(fSample/2); Ws = fStop(1)/(fSample/2); case 3 Wp = fPass(1:2)./(fSample/2); Ws = fStop(1:2)./(fSample/2); case 4 Wp = fPass(1:2)./(fSample/2); Ws = fStop(1:2)./(fSample/2); end [n,Wn] = buttord(Wp,Ws,Rp,Rs); [b,a] = butter(n,Wn,FilterGroup{filterType}); yf = filtfilt(b,a,y); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
评论
    相关推荐