PowerSpectralDensity#
- class ansys.sound.core.spectral_processing.PowerSpectralDensity(input_signal, fft_size=2048, window_type='HANN', window_length=2048, overlap=0.25)#
Power Spectral Density (PSD) class.
This class allows the calculation of Power Spectral Density (PSD) for a given signal, using Welch’s method
Class instantiation takes the following parameters.
- Parameters:
- signal
Field
Mono signal as a DPF field on which to compute the PSD.
- fft_size
int
, default: 2048 Number of FFT points to use for the PSD estimate. Use a power of 2 for better performance.
- window_type
str
, default: ‘HANN’ Window type used for the PSD computation. Options are
'BARTLETT'
,'BLACKMAN'
,'BLACKMANHARRIS'
,'HAMMING'
,'HANN'
,'KAISER'
, and'RECTANGULAR'
.- window_length
int
, default: 2048 Number of points of the window used for the PSD computation , by default 2048.
- overlap
float
, default: 0.25 Overlap value between two successive segments where the FFT is computed. Values range from 0 to 1. For example,
0
means no overlap, and0.5
means 50% overlap.
- signal
Methods
PowerSpectralDensity.convert_fields_container_to_np_array
(fc)Convert a DPF fields container to a NumPy array.
PowerSpectralDensity.get_PSD_dB
([ref_value])Get the PSD in dB/Hz, as a Field.
Get the PSD in dB/Hz as a NumPy array.
Get the PSD in squared linear unit, as a DPF field.
Get the PSD in squared linear unit, as NumPy arrays.
Get the frequencies associated with the PSD.
Get the PSD data as a DPF field.
Get the PSD data as NumPy arrays.
PowerSpectralDensity.plot
([display_in_dB])Plot the PSD.
Calculate the PSD.
Attributes
Number of FFT points.
Input signal as a DPF field.
Window overlap in %.
Number of window points.
Window type.