File Exchange > Data Analysis >    Power Spectral Density

Author:
OriginLab Technical Support
9/28/2023
Last Update:
1/11/2024
137
Total Ratings:
0
File Size:
192 KB
Average Rating:
File Name:
Power_Spec...ty.opx
File Version:
1.00
Minimum Versions:
Type:
App
Summary:

Estimate power spectral density using periodogram and Welch methods.

Screen Shot and Video:
Description:

PURPOSE

This app can be used to perform FFT and create power spectral density plot using periodogram and Welch methods.

INSTALLATION

Download the file Power_Spectral_Density.opx, and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps Gallery window.
NOTE: This tool requires OriginPro.

OPERATION
1. Make a worksheet or graph active. Click Power Spectral Density app icon in Apps Gallery window.
2. In the opened dialog, select XY data as Input Data in Input tab. Set a value for Sampling Frequency if x data is not given.
3. In Settings tab, choose a method to calculate the power spectral density: Periodogram and Welch, the latter divides input data into several overlapping segments, and calculates the average of these segments' FFT results.
Window dropdown list supports nine window types: Rectangle, Welch, Triangular, Bartlett, Hanning, Hamming, Blackman, Gaussian and Kaiser.
FFT Length defines the length of FFT, and it determines the frequency resolution. The larger FFT Length is, the higher the frequency resolution becomes. If FFT length is larger than the data size, zeros are padded. If FFT length is less than the data size, data will be wrapped and summed first.
If Welch method is chosen, Each Segment Length specifies the length of each segment, and Overlap defines the number of points to overlap between segments.
4. In Plot tab, Power Spectrum Scale has two options: Power Spectral Density and Power Spectrum. Frequency Range supports One-sided and Two-sided. Convert to dB check box will show Y axis with dB unit.
5. Click OK button, a power spectral density plot will be created.
SAMPLE OPJU FILE

This app provides a sample OPJU file. Right click on the Power Spectral Density icon in the Apps Gallery window, and choose Show Samples Folder from the short-cut menu. A folder will open. Drag-and-drop the project file PSDEx.opju from the folder onto Origin. The Notes window in the project shows detailed steps.
Note: If you wish to save the OPJU after changing, it is recommended that you save to a different folder location (e.g. User Files Folder).

ALGORITHM
• Discrete Fourier transform (DFT)
$$F_n = \displaystyle \sum_{i=0}^{N-1} x_i e^{ - \frac{2 \pi n i}{N} j }, \; n=0, ... , N-1, \tag{1}$$
where $$x_i$$ is input data, N is the number of points, and $$F_n$$ is the DFT sequence.
• Power Spectrum Scale
• Power spectral density
$$s = \frac{1}{\displaystyle f_s \sum_{i=1}^{N} w_i^2} \tag{2}$$
where $$f_s$$ is the sampling frequency, $$w_i$$ is the window function, and s is the scale factor.
Power spectral density can be used to estimate power density at a given frequency, e.g. noise power density.
• Power spectrum
$$s = \frac{1}{\left(\displaystyle\sum_{i=1}^{N} w_i \right)^2} \tag{3}$$
Power spectrum can be used to estimate the RMS amplitude of a periodic signal with a fixed frequency, e.g. a sine voltage signal, and the square root of the power spectrum at the given frequency is the RMS amplitude.
Power spectral density/Power spectrum can be expressed as:
$$P_n = s |F_n|^2 \tag{4}$$
• One-sided Frequency Range
If the frequency range is one-sided and N is odd,
$${P_n}_\text{One} = \begin{cases} 2 P_n, & \text{if} \; n=1, ... , \lfloor N/2 \rfloor \\ P_n, & \text{if} \; n=0 \end{cases} \tag{5}$$
If N is even,
$${P_n}_\text{One} = \begin{cases} 2 P_n, & \text{if} \; n=1, ... , \lfloor N/2-1 \rfloor \\ P_n, & \text{if} \; n=0, \lfloor N/2 \rfloor \end{cases} \tag{6}$$
• Welch Method
Input data is divided into overlapping segments. Average the power spectral density over all segments.
• FFT Length
When FFT length is greater than input data size/segment length, zeroes are padded. If FFT length is less than input data size/segment length, input data is wrapped and summed according to FFT length first.
REFERENCE
1. P. Welch. (1967). “The use of the fast Fourier transform for the estimation of power spectra: A method based on time averaging over short, modified periodograms". IEEE Trans. Audio Electroacoust. Vol. 15, pp. 70-73.