comparison m-toolbox/html_help/help/ug/specwin_using.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>Using spectral windows (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;">&nbsp;</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 "specwin_description.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="What are LTPDA spectral windows?"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "sigproc_methods.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="Spectral Estimation Methods"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Using spectral windows</h1>
37 <hr>
38
39 <p>
40 <p>
41 Spectral windows are typically used in spectral analysis algorithms. In all LTPDA spectral analysis
42 functions, spectral windows are specified as parameters in an input parameter list. The following
43 example shows the use of <tt>ao/psd</tt> to estimate an Amplitude Spectral Density of
44 the time-series captured in the input AO, <tt>a</tt>. The help for <a href="matlab:doc('ao/ao/psd')">ao/lpsd</a>
45 reveals that the required parameter for setting the window function is <tt>'Win'</tt>.
46 </p>
47 <div class="fragment"><pre>
48 <br> <span class="comment">% Parameters</span>
49 nsecs = 1000;
50 fs = 10;
51
52 <span class="comment">% Create input AOs</span>
53 x1 = ao(plist( <span class="string">'waveform'</span>, <span class="string">'sine wave'</span>, <span class="string">'f'</span>,0.1, <span class="string">'A'</span>,1, <span class="string">'nsecs'</span>,nsecs, <span class="string">'fs'</span>,fs));
54 x2 = ao(plist( <span class="string">'waveform'</span>, <span class="string">'noise'</span>, <span class="string">'type'</span>, <span class="string">'normal'</span>, <span class="string">'nsecs'</span>,nsecs, <span class="string">'fs'</span>,fs));
55
56 <span class="comment">% Add both</span>
57 x = x1 + x2;
58
59 <span class="comment">% Compute psd with Blackman-Harris window</span>
60 z = psd(x,plist(<span class="string">'win'</span>,<span class="string">'BH92'</span>));
61
62 <span class="comment">% Plot</span>
63 iplot(z);
64 </pre></div>
65 <p>
66 In this case, the size of the spectral window (number of samples) may not match the length
67 of the segments in the spectral estimation. The <tt>psd</tt> algorithm then
68 recomputes the window using the input design but for the correct length of window function.
69 </p>
70
71 <img src="images/specwin_using1.png" >
72
73 <h2>Selecting the Peak Side-Lobe level (psll) with Kaiser's window</h2>
74 <p>
75 The <a href="specwin_description.html">table</a> in the previous section shows how each standard spectral window is defined by the
76 Peak Side-Lobe level (<tt>psll</tt>). However, Kaiser's window allows the user to define the <tt>psll</tt> of the window.
77 </p>
78 <p>
79 The following example shows the importance of selecting a suitable <tt>psll</tt> according to each application. The example creates
80 1/f noise (in fact, noise generated
81 by a pole-zero model with a pole at low frequencies) and computes the Amplitude Spectrum Density (ASD) with three different <tt>psll</tt>
82 values. The ASD with the lowest value shows a bias at high frequencies compared with the response of the pzmodel used to generate
83 the data (in black). This effect is due to the power added by the high order lobes of the window. The ASD with the highet value of the
84 <tt>psll</tt> adds a feature at low frequencies because the main lobe of the window is too wide. Only the
85 middle value gives an estimation of the ASD without adding window related features.
86 </p>
87
88 <div class="fragment"><pre>
89 <br> <span class="comment">% Parameters</span>
90 nsecs = 10000;
91 fs = 1;
92
93 <span class="comment">% Create pzmodel with a low frequency pole</span>
94 pzm = pzmodel(1e5,[1e-7,0.1],[]);
95
96 <span class="comment">% Build (nearly) 1/f noise</span>
97 x = ao(plist(<span class="string">'pzmodel'</span>,pzm, <span class="string">'nsecs'</span>,nsecs, <span class="string">'fs'</span>,fs));
98
99 <span class="comment">% Compute psd with Blackman-Harris window</span>
100 z1 = psd(x,plist(<span class="string">'scale'</span>,<span class="string">'ASD'</span>,<span class="string">'win'</span>,<span class="string">'Kaiser'</span>,<span class="string">'psll'</span>,50));
101 z1.setName(<span class="string">'psll = 50'</span>);
102 z2 = psd(x,plist('scale',<span class="string">'ASD'</span>,<span class="string">'win'</span>,<span class="string">'Kaiser'</span>,<span class="string">'psll'</span>,100));
103 z2.setName(<span class="string">'psll = 100'</span>);
104 z3 = psd(x,plist(<span class="string">'scale'</span>,<span class="string">'ASD'</span>,<span class="string">'win'</span>,<span class="string">'Kaiser'</span>,<span class="string">'psll'</span>,1000));
105 z3.setName(<span class="string">'psll = 1000'</span>);
106
107 <span class="comment">% Plot</span>
108 r = resp(pzm,plist(<span class="string">'f1'</span>,1e-4,<span class="string">'f2'</span>,1));
109 r.setName(<span class="string">'response'</span>)
110 r.setPlotinfo(plist(<span class="string">'color'</span>,<span class="string">'k'</span>))
111 iplot(z1,z2,z3,abs(r));
112 </pre></div>
113
114 <img src="images/specwin_using2.png" >
115
116
117
118
119 </p>
120
121 <br>
122 <br>
123 <table class="nav" summary="Navigation aid" border="0" width=
124 "100%" cellpadding="0" cellspacing="0">
125 <tr valign="top">
126 <td align="left" width="20"><a href="specwin_description.html"><img src=
127 "b_prev.gif" border="0" align="bottom" alt=
128 "What are LTPDA spectral windows?"></a>&nbsp;</td>
129
130 <td align="left">What are LTPDA spectral windows?</td>
131
132 <td>&nbsp;</td>
133
134 <td align="right">Spectral Estimation Methods</td>
135
136 <td align="right" width="20"><a href=
137 "sigproc_methods.html"><img src="b_next.gif" border="0" align=
138 "bottom" alt="Spectral Estimation Methods"></a></td>
139 </tr>
140 </table><br>
141
142 <p class="copy">&copy;LTP Team</p>
143 </body>
144 </html>