| Hello! Could somebody please help me find a way to build the spectral density function for a given signal in Sage? Thank you! |
| A self-answer: The power spectral density (PSD) may be defined as $ S(\omega) = \lim \limits_{T \to +\infty} \frac{\left \vert F_T(\omega) \right \vert ^2}{T} $, where $ F_T (\omega)$ is the Fourier transform defined as follows: $ {F}_T(\omega) = \int \limits_0^T f(t) \exp(-i\omega t) ~ dt$ The accepted data set format is: Calling for such signal will return the Power Spectral Density of a signal. Sometimes it is useful to apply some kind of window function to a signal prior to calculating the PSD, since the sharp start and end of the data record may produce some spurious spectral components. Here is an example of the popular Hanning Window application for the time series: The result of its application looks like this:
One can simply call to get the power spectral density for a data set with Hanning window function applied. You can compare the results of spectral density calculation for the initial time series and "windowed" time series:
|
Asked: Jul 17 '12
Seen: 97 times
Last updated: Aug 03 '12
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.