view m-toolbox/classes/@mfir/mkbandreject.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line source

% MKBANDREJECT return a low pass filter mfir(). A Butterworth filter is used.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: MKBANDREJECT return a low pass filter mfir().
%              A Butterworth filter is used.
%
% CALL:        f = mkbandreject(f, pl)
%
% VERSION: $Id: mkbandreject.m,v 1.10 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');
  win    = find(pl, 'Win');
  
  utils.helper.checkFilterOptions(pl);
  
  f.name    = 'bandreject';
  f.fs      = fs;
  f.a       = g.*fir1(order, 2.*fc/fs, 'stop', win.win);
  f.gd      = (f.ntaps-1)/2;
  f.histout = zeros(1,f.ntaps-1);   % initialise output history
end