view m-toolbox/classes/@miir/mkhighpass.m @ 50:7d2e2e065cf1
database-connection-manager
Update unit tests
author |
Daniele Nicolodi <nicolodi@science.unitn.it> |
date |
Wed, 07 Dec 2011 17:24:37 +0100 (2011-12-07) |
parents |
f0afece42f48 |
children |
|
line source
% MKHIGHPASS return a high pass filter miir(). A Butterworth filter is used.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: MKHIGHPASS return a high pass filter miir().
% A Butterworth filter is used.
%
% CALL: f = mkhighpass(f, pl)
%
% VERSION: $Id: mkhighpass.m,v 1.9 2011/04/04 11:37:02 hewitson Exp $
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function f = mkhighpass(f, pl)
g = find(pl, 'gain');
fc = find(pl, 'fc');
fs = find(pl, 'fs');
order = find(pl, 'order');
utils.helper.checkFilterOptions(pl);
% Build filter coefficients
[a, b] = butter(order, 2*fc(1)/fs, 'high');
% Set filter properties
f.name = 'highpass';
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