Mercurial > hg > ltpda
comparison m-toolbox/classes/@mfir/mklowpass.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % MKLOWPASS return a low pass filter mfir(). | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: MKLOWPASS return a low pass filter mfir(). | |
5 % | |
6 % CALL: f = mklowpass(f, pl) | |
7 % | |
8 % VERSION: $Id: mklowpass.m,v 1.8 2011/04/04 11:37:02 hewitson Exp $ | |
9 % | |
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
11 | |
12 function f = mklowpass(f, pl) | |
13 | |
14 g = find(pl, 'gain'); | |
15 fc = find(pl, 'fc'); | |
16 fs = find(pl, 'fs'); | |
17 order = find(pl, 'order'); | |
18 win = find(pl, 'Win'); | |
19 | |
20 utils.helper.checkFilterOptions(pl); | |
21 | |
22 f.name = 'lowpass'; | |
23 f.fs = fs; | |
24 f.a = g.*fir1(order, 2*fc(1)/fs, 'low', win.win); | |
25 f.gd = (f.ntaps-1)/2; | |
26 f.histout = zeros(1,f.ntaps-1); % initialise output history | |
27 end | |
28 |