Home > classes > @mfir > private > mkbandpass.m

mkbandpass

PURPOSE ^

MKBANDPASS return a bandpass filter miir(). A Cheby filter is used.

SYNOPSIS ^

function f = mkbandpass(f, pl)

DESCRIPTION ^

 MKBANDPASS return a bandpass filter miir(). A Cheby filter is used.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: MKBANDPASS return a bandpass filter miir().
              A Cheby filter is used.

 CALL:        f = mkbandpass(f, pl)

 VERSION: $Id: mkbandpass.m,v 1.4 2007/10/24 10:55:11 ingo Exp $

 HISTORY: 27-08-2002 M Hewitson
             Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function f = mkbandpass(f, pl)
0002 % MKBANDPASS return a bandpass filter miir(). A Cheby filter is used.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: MKBANDPASS return a bandpass filter miir().
0007 %              A Cheby filter is used.
0008 %
0009 % CALL:        f = mkbandpass(f, pl)
0010 %
0011 % VERSION: $Id: mkbandpass.m,v 1.4 2007/10/24 10:55:11 ingo Exp $
0012 %
0013 % HISTORY: 27-08-2002 M Hewitson
0014 %             Creation
0015 %
0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 
0018 g      = find(pl, 'gain');
0019 fc     = find(pl, 'fc');
0020 fs     = find(pl, 'fs');
0021 order  = find(pl, 'order');
0022 win    = find(pl, 'Win');
0023 
0024 if(fc > fs/2)
0025   error('fc must be < fs/2');
0026 end
0027 if(fc(1) > fc(2))
0028   error('fc(1) must be < fc(2)');
0029 end
0030 
0031 f.name    = 'std bandpass';
0032 f.fs      = fs;
0033 f.ntaps   = order+1;
0034 f.a       = fir1(order, 2.*fc/fs, 'bandpass', win.win);
0035 f.gd      = (f.ntaps)/2;
0036 f.gain    = g;
0037 f.histout = zeros(1,f.ntaps-1);   % initialise output history
0038 
0039 % END
0040

Generated on Mon 31-Mar-2008 13:54:54 by m2html © 2003