Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/sigproc_cpsd.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>Cross-spectral density estimates (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_psd.html"><img src="b_prev.gif" border="0" align= | |
30 "bottom" alt="Power spectral density estimates"></a> <a href= | |
31 "sigproc_cohere.html"><img src="b_next.gif" border="0" align= | |
32 "bottom" alt="Cross coherence estimates"></a></td> | |
33 </tr> | |
34 </table> | |
35 | |
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Cross-spectral density estimates</h1> | |
37 <hr> | |
38 | |
39 <p> | |
40 <h2>Description</h2> | |
41 <p> | |
42 Cross-power spectral density is performed by the Welch's averaged, modified periodogram method. | |
43 The LTPDA method <a href="matlab:doc('ao/cpsd')">ao/cpsd</a> estimates the cross-spectral density of time-series | |
44 signals, included in the input <tt>ao</tt>s following the Welch's averaged, modified periodogram method <a href="#references">[1]</a>. | |
45 Data are windowed prior to the estimation of the spectra, by multiplying | |
46 it with a <a href="specwin.html">spectral window object</a>, and can be detrended by polinomial of time in order to reduce the impact | |
47 of the border discontinuities. The window length is adjustable to shorter lenghts to reduce the spectral | |
48 density uncertainties, and the percentage of subsequent window overlap can be adjusted as well. | |
49 <br> | |
50 <br> | |
51 <h2>Syntax</h2> | |
52 </p> | |
53 <div class="fragment"><pre> | |
54 <br> b = cpsd(a1,a2,pl) | |
55 </pre> | |
56 </div> | |
57 <p> | |
58 <tt>a1</tt> and <tt>a2</tt> are the 2 <tt>ao</tt>s containing the input time series to be evaluated, <tt>b</tt> is the output object, | |
59 and <tt>pl</tt> is an optional parameters list. | |
60 <h2>Parameters</h2> | |
61 The parameter list <tt>pl</tt> includes the following parameters:</p> | |
62 <ul> | |
63 <li> <tt>'Nfft'</tt> - number of samples in each fft [default: length of input data] | |
64 A string value containing the variable 'fs' can | |
65 also be used, e.g., plist('Nfft', '2*fs') </li> | |
66 <li> <tt>'Win'</tt> - the window to be applied to the data to remove the | |
67 discontinuities at edges of segments. [default: taken from user prefs].<br> | |
68 The window is described by a string with its name and, only in the case of Kaiser window, | |
69 the additional parameter <tt>'psll'</tt>. <br>For instance: plist('Win', 'Kaiser', 'psll', 200). </li> | |
70 <li> <tt>'Olap'</tt> - segment percent overlap [default: -1, (taken from window function)] </li> | |
71 <li> <tt>'Order'</tt> - order of segment detrending <ul> | |
72 <li> -1 - no detrending </li> | |
73 <li> 0 - subtract mean [default] </li> | |
74 <li> 1 - subtract linear fit </li> | |
75 <li> N - subtract fit of polynomial, order N </li> </ul> </li> | |
76 <li><tt>'Navs'</tt> - number of averages. If set, and if Nfft was set to 0 or -1, the number of points for each window will be calculated to match the request. [default: -1, not set] </li> | |
77 <li><tt>'Times'</tt> - interval of time to evaluate the calculation on. If empty [default], it will take the whole section.</li> | |
78 </ul> | |
79 <p> | |
80 The length of the window is set by the value of the parameter <tt>'Nfft'</tt>, so that the window | |
81 is actually rebuilt using only the key features of the window, i.e. the name and, for Kaiser windows, the PSLL. | |
82 </p> | |
83 | |
84 <p>As an alternative to setting the number of points <tt>'Nfft'</tt> in each window, it's possible to ask for a given number of CPSD estimates by setting the <tt>'Navs'</tt> parameter, and the algorithm takes care of calculating the correct window length, according to the amount of overlap between subsequent segments.</p> | |
85 <p> | |
86 <table cellspacing="0" class="note" summary="Note" cellpadding="5" border="1"> | |
87 <tr width="90%"> | |
88 <td> | |
89 If the user doesn't specify the value of a given parameter, the default value is used. | |
90 </td> | |
91 </tr> | |
92 </table> | |
93 </p> | |
94 | |
95 <p> | |
96 The function makes CPSD estimates between the 2 input <tt>ao</tt>s. The input argument | |
97 list must contain 2 analysis objects, and the output will contain the CPSD estimate. | |
98 If passing two identical objects <tt>ai</tt>, the output will be equivalent to the output of <tt>psd(ai)</tt>. | |
99 </p> | |
100 </pre> </div> | |
101 </p> | |
102 <p> | |
103 <h2>Algorithm</h2> | |
104 <p> | |
105 The algorithm is based in standard MATLAB's tools, as the ones used by <a href="matlab:doc('pwelch')">pwelch</a>. However, in order to | |
106 compute the standard deviation of mean for each frequency bin, the averaging of the different segments is performed using Welford's | |
107 algorithm <a href="#references">[2]</a> which allows to compute mean and variance in one loop. | |
108 </p> | |
109 <h2>Example</h2> | |
110 </p> | |
111 <p> | |
112 Evaluation of the CPSD of two time-series represented by: a low frequency sinewave signal superimposed to | |
113 white noise, and a low frequency sinewave signal at the same frequency, phase shifted and with different | |
114 amplitude, superimposed to white noise. | |
115 </p> | |
116 <div class="fragment"><pre> | |
117 nsecs = 1000; | |
118 x = 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>,10)) + ... | |
119 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>,10)); | |
120 x.setYunits(<span class="string">'m'</span>); | |
121 y = 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>,2,<span class="string">'nsecs'</span>,nsecs,<span class="string">'fs'</span>,10,<span class="string">'phi'</span>,90)) + ... | |
122 4*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>,10)); | |
123 y.setYunits(<span class="string">'V'</span>); | |
124 z = cpsd(x,y,plist(<span class="string">'nfft'</span>,1000)); | |
125 iplot(z); | |
126 </pre> | |
127 </div> | |
128 | |
129 <img src="images/cpsd_1.png" alt="" border="3"> | |
130 <br> | |
131 | |
132 <h2><a name="references">References</a></h2> | |
133 | |
134 <ol> | |
135 <li> P.D. Welch, The Use of Fast Fourier Transform for the Estimation of Power Spectra: A Method Based on Time Averaging Over Short, | |
136 Modified Periodograms, <i>IEEE Trans. on Audio and Electroacoustics</i>, Vol. 15, No. 2 (1967), pp. 70 - 73</a></li> | |
137 <li> B. P. Weldford, Note on a Method for Calculating Corrected Sums of Squares and Products, | |
138 <i>Technometrics<i>, Vol. 4, No. 3 (1962), pp 419 - 420.</li> | |
139 </ol> | |
140 | |
141 | |
142 | |
143 | |
144 | |
145 </p> | |
146 | |
147 <br> | |
148 <br> | |
149 <table class="nav" summary="Navigation aid" border="0" width= | |
150 "100%" cellpadding="0" cellspacing="0"> | |
151 <tr valign="top"> | |
152 <td align="left" width="20"><a href="sigproc_psd.html"><img src= | |
153 "b_prev.gif" border="0" align="bottom" alt= | |
154 "Power spectral density estimates"></a> </td> | |
155 | |
156 <td align="left">Power spectral density estimates</td> | |
157 | |
158 <td> </td> | |
159 | |
160 <td align="right">Cross coherence estimates</td> | |
161 | |
162 <td align="right" width="20"><a href= | |
163 "sigproc_cohere.html"><img src="b_next.gif" border="0" align= | |
164 "bottom" alt="Cross coherence estimates"></a></td> | |
165 </tr> | |
166 </table><br> | |
167 | |
168 <p class="copy">©LTP Team</p> | |
169 </body> | |
170 </html> |