view m-toolbox/classes/@miir/mkbandreject.m @ 41:6def6533cb16
database-connection-manager
Report authentication errors to user
author |
Daniele Nicolodi <nicolodi@science.unitn.it> |
date |
Mon, 05 Dec 2011 18:04:34 +0100 (2011-12-05) |
parents |
f0afece42f48 |
children |
|
line source
% MKBANDREJECT return a low pass filter miir(). A Butterworth filter is used.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: MKBANDREJECT return a low pass filter miir().
% A Butterworth filter is used.
%
% CALL: f = mkbandreject(f, pl)
%
% VERSION: $Id: mkbandreject.m,v 1.11 2011/04/04 11:37:02 hewitson Exp $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function f = mkbandreject(f, pl)
g = find(pl, 'gain');
fc = find(pl, 'fc');
fs = find(pl, 'fs');
order = find(pl, 'order');
ripple = find(pl, 'ripple');
utils.helper.checkFilterOptions(pl);
% Build filter coefficients
[a, b] = cheby1(order, ripple, 2.*fc./fs, 'stop');
% Set filter properties
f.name = 'bandreject';
f.fs = fs;
f.a = g.*a;
f.b = b;
f.histin = zeros(1,f.ntaps-1); % initialise input history
f.histout = zeros(1,f.ntaps-1); % initialise output history
end