关闭

mtalab-fir1 带通滤波

1413人阅读 评论(0) 收藏 举报
分类:
function [ res ] = bandPassSef(data,Fs,Fc1,Fc2)
%BANDPASSSEF Summary of this function goes here
%   Detailed explanation goes here

%Fs = 48000;       % Sampling Frequency
N    = 100;          % Order
%Fc1  = 12000;         % First Cutoff Frequency
%Fc2  = 17000;         % Second Cutoff Frequency
flag = '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

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:339137次
    • 积分:4759
    • 等级:
    • 排名:第6061名
    • 原创:103篇
    • 转载:140篇
    • 译文:5篇
    • 评论:37条
    最新评论