f_iirnotch.m
来自「digital signal processing常用工具箱」· M 代码 · 共 33 行
M
33 行
function [b,a] = f_iirnotch (F_0,Delta_F,fs)
%F_IIRNOTCH: Design an IIR notch filter
%
% Usage: [b,a] = f_iirnotch (F_0,Delta_F,fs)
%
% Inputs:
% F_0 = notch frequency
% Delta_F = radius of 3dB bandwidth (Delta_F << fs)
% fs = sampling frequency
% Outputs:
% b = 1 by 3 numerator coefficient vector
% a = 1 by 3 denominator coefficient vector
%
% See also: F_IIIRES, F_IIRCOMB, F_IIRINV
% Initialize
fs = f_clip (fs,0,fs);
F_0 = f_clip (F_0,0,fs/2);
Delta_F = f_clip (Delta_F,0,fs/4);
% Find the parameters
r = 1 - (Delta_F*pi/fs);
theta_0 = 2*pi*F_0/fs;
b_0 = abs(1 - 2*r*cos(theta_0) + r^2)/(2*abs(1-cos(theta_0)));
% Find the coefficient vectors
b = b_0*[1,-2*cos(theta_0),1];
a = [1,-2*r*cos(theta_0),r^2];
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?