Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/sigproc_fir.html @ 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 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> | |
3 | |
4 <html lang="en"> | |
5 <head> | |
6 <meta name="generator" content= | |
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org"> | |
8 <meta http-equiv="Content-Type" content= | |
9 "text/html; charset=us-ascii"> | |
10 | |
11 <title>FIR Filters (LTPDA Toolbox)</title> | |
12 <link rel="stylesheet" href="docstyle.css" type="text/css"> | |
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2"> | |
14 <meta name="description" content= | |
15 "Presents an overview of the features, system requirements, and starting the toolbox."> | |
16 </head> | |
17 | |
18 <body> | |
19 <a name="top_of_page" id="top_of_page"></a> | |
20 | |
21 <p style="font-size:1px;"> </p> | |
22 | |
23 <table class="nav" summary="Navigation aid" border="0" width= | |
24 "100%" cellpadding="0" cellspacing="0"> | |
25 <tr> | |
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td> | |
27 | |
28 <td valign="baseline" align="right"><a href= | |
29 "sigproc_iir.html"><img src="b_prev.gif" border="0" align= | |
30 "bottom" alt="IIR Filters"></a> <a href= | |
31 "sigproc_filterbanks.html"><img src="b_next.gif" border="0" align= | |
32 "bottom" alt="Filter banks"></a></td> | |
33 </tr> | |
34 </table> | |
35 | |
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>FIR Filters</h1> | |
37 <hr> | |
38 | |
39 <p> | |
40 <p> | |
41 Finite Impulse Response filters are those filters present a non-zero finite length response | |
42 when excited with a very brief (ideally an infinite peak) input signal. A linear causal | |
43 FIR filter can be described by the following difference equation | |
44 </p> | |
45 <div align="center"> | |
46 <IMG src="images/sigproc_8.png" width="157" height="56" align="middle" border="0"> | |
47 </div> | |
48 <p> | |
49 This operation describe a nonrecursive system, i.e. a system that only depends on current | |
50 and past samples of the input data stream <tt>x[n]</tt> | |
51 </p> | |
52 <h2><a name="FIRbuild">Creating a FIR filter in the LTPDA</a></h2> | |
53 <p> | |
54 The LTPDA Toolbox allows the implementation of FIR filters by means of the | |
55 <a href="class_desc_mfir.html"> mfir class</a>. | |
56 </p> | |
57 <h2><a name="FIRplist">Creating from a plist</a></h2> | |
58 <p> | |
59 The following example creates an order 64 highpass filter with high frequency gain 2. | |
60 The filter is designed for 1 Hz sampled data and has a cut-off frequency of 0.2 Hz. | |
61 </p> | |
62 <div class="fragment"><pre> | |
63 | |
64 pl = plist(<span class="string">'type'</span>, <span class="string">'highpass'</span>, ... | |
65 <span class="string">'order'</span>, 64, ... | |
66 <span class="string">'gain'</span>, 2.0, ... | |
67 <span class="string">'fs'</span>, 1, ... | |
68 <span class="string">'fc'</span>, 0.2); | |
69 f = mfir(pl) | |
70 </pre></div> | |
71 | |
72 <h2><a name="FIRdiff">Creating from a difference equation</a></h2> | |
73 <p> | |
74 The filter can be defined in terms of two vectors specifying the coefficients of the filter | |
75 and the sampling frequency. The following example creates a FIR filter with sampling frequency | |
76 1 Hz and the following recursive equation: | |
77 </p> | |
78 | |
79 <div align="center"> | |
80 <IMG src="images/sigproc_10.png" width="202" height="28" align="middle" border="0"></div> | |
81 </div> | |
82 | |
83 <p><br></p> | |
84 | |
85 <div class="fragment"><pre> | |
86 | |
87 b = [-0.8 10]; | |
88 fs = 1; | |
89 f = mfir(b,fs) | |
90 </pre></div> | |
91 | |
92 <h2><a name="FIRfromAO">Creating from an Analysis Object</a></h2> | |
93 <p> | |
94 A FIR filter can be generated based on the magnitude of the input Analysis Object or fsdata object. | |
95 In the following example a fsdata object is first generated and then passed to the mfir constructor | |
96 to obtain the equivalent FIR filter. | |
97 </p> | |
98 | |
99 <div class="fragment"><pre> | |
100 | |
101 fs = 10; <span class="comment">% sampling frequency</span> | |
102 f = linspace(0, fs/2, 1000); | |
103 y = 1./(1+(0.1*2*pi*f).^2); <span class="comment">% an arbitrary function</span> | |
104 fsd = fsdata(f,y,fs); <span class="comment">% build the fsdata object</span> | |
105 f = mfir(ao(fsd)); | |
106 | |
107 </pre></div> | |
108 <br> | |
109 <p> | |
110 Available methods for this option are: 'frequency-sampling' (uses fir2), 'least-squares' (uses firls) | |
111 and 'Parks-McClellan' (uses firpm) | |
112 </p> | |
113 <h2><a name="IIRimport">Importing an existing model</a></h2> | |
114 <p> | |
115 The mfir constructor also accepts as an input existing models in different formats: | |
116 </p> | |
117 <li> | |
118 <li><p>LISO files:<p> | |
119 <div class="fragment"><pre> | |
120 f = mfir(<span class="string">'foo_fir.fil'</span>) | |
121 </pre></div> | |
122 </li> | |
123 <li><p>XML files:</p> | |
124 <div class="fragment"><pre> | |
125 f = mfir(<span class="string">'foo_fir.xml'</span>) | |
126 </pre></div> | |
127 <li><p>MAT files:</p> | |
128 <div class="fragment"><pre> | |
129 f = mfir(<span class="string">'foo_fir.mat'</span>) | |
130 </pre></div> | |
131 </li> | |
132 <li><p>From repository:</p> | |
133 <div class="fragment"><pre> | |
134 f = mfir(plist(<span class="string">'hostname'</span>, <span class="string">'localhost'</span>, <span class="string">'database'</span>, <span class="string">'ltpda'</span>, <span class="string">'ID'</span>, [])) | |
135 </pre></div> | |
136 </li> | |
137 </ul> | |
138 | |
139 </p> | |
140 | |
141 <br> | |
142 <br> | |
143 <table class="nav" summary="Navigation aid" border="0" width= | |
144 "100%" cellpadding="0" cellspacing="0"> | |
145 <tr valign="top"> | |
146 <td align="left" width="20"><a href="sigproc_iir.html"><img src= | |
147 "b_prev.gif" border="0" align="bottom" alt= | |
148 "IIR Filters"></a> </td> | |
149 | |
150 <td align="left">IIR Filters</td> | |
151 | |
152 <td> </td> | |
153 | |
154 <td align="right">Filter banks</td> | |
155 | |
156 <td align="right" width="20"><a href= | |
157 "sigproc_filterbanks.html"><img src="b_next.gif" border="0" align= | |
158 "bottom" alt="Filter banks"></a></td> | |
159 </tr> | |
160 </table><br> | |
161 | |
162 <p class="copy">©LTP Team</p> | |
163 </body> | |
164 </html> |