Fast numerical estimation of the power spectral density or the cross spectral density
Contributed by:
Julien Kluge
Quantum Optical Metrology; Joint Lab Integrated Quantum Sensors
Department of Physics
Humboldt-Universität zu Berlin
julien@physik.hu-berlin.de
Examples
Basic Examples (1)
Calculate the spectral density of a random data sample:
Scope (2)
Evaluate the Cross Spectral Density (CSD) of two sinusoidal, noisy datasets and display amplitude and phase:
Compare the influence of different spectral windows on the PSD:
Options (12)
SegmentSize (1)
"SegmentSize" sets number of data points from which to calculate the Fourier transform; smaller numbers means more averaging but lower resolution:
OverlapOffset (2)
"OverlapOffset" allows to set the distance of the starting point between two partitioned segments; a smaller integer number means closer overlaps and thus more averaging:
"OverlapOffset" also allows the specification of an overlap fraction of the number of data points minus the segment size, as a real number between zero and one:
Window (3)
Use the "Window" option to specify windowing functions:
A list can be applied as the window function, provided the length is equal to its segment size:
Set a custom function as the window:
OneSided (1)
Set "OneSided" to False to get a two sided evaluation:
Reduction (1)
Specify Median as a reduction function:
DensityScaling (1)
Set "DensityScaling" to False to get a spectrum scaling:
Detrend (2)
The "Detrend" option can be used to detrend the initial data segments before transformations occur. The option can be specified with string arguments for constant or linear detrends:
A list of integers can be specified instead which polynomial orders should be detrended:
Applications (2)
Investigate the frequency response on white noise data for different kind of filters:
Estimate the system transfer function of a set state and its measured response:
Possible Issues (1)
Even for complex input, the "OneSided" option will still remain True by default and thus return only the front of the Fourier transform:
Neat Examples (1)
Estimate the uncertainty of the Fourier deviations by just choosing a different reduction function:
Publisher
Julien Kluge
Related Links
Version History
-
1.0.1
– 04 April 2025
-
1.0.0
– 10 February 2021