mtalab-fir1 带通滤波

来源:互联网 发布:苏州高博软件 编辑:程序博客网 时间:2024/06/07 02:20
function [ res ] = bandPassSef(data,Fs,Fc1,Fc2)%BANDPASSSEF Summary of this function goes here%   Detailed explanation goes here%Fs = 48000;       % Sampling FrequencyN    = 100;          % Order%Fc1  = 12000;         % First Cutoff Frequency%Fc2  = 17000;         % Second Cutoff Frequencyflag = 'scale';     % Sampling Flag% Create the window vector for the design algorithm.%win = blackman(N+1);win=hamming(N+1);% Calculate the coefficients using the FIR1 function.%b  = fir1(N,Fc1/(Fs/2),'high',win,flag);b  = fir1(N, [Fc1 Fc2]/(Fs/2), 'bandpass', win, flag);Hd = dfilt.dffir(b);res = filter(Hd, data);end

0 0