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