Stft#
- class ansys.sound.core.spectrogram_processing.Stft(signal=None, fft_size=2048, window_type='HANN', window_overlap=0.5)#
Computes the short-time Fourier transform (STFT) of a signal.
Class instantiation takes the following parameters.
- Parameters:
- signal
Field
|FieldsContainer
, default:None
Mono signal to compute the STFT on as a DPF field or fields container.
- fft_size
int
, default: 2048 Size (as an integer) of the FFT to compute the STFT. Use a power of 2 for better performance.
- window_type
str
, default: ‘HANN’ Window type used for the FFT computation. Options are
'BARTLETT'
,'BLACKMAN'
,'BLACKMANHARRIS'
,``’HAMMING’, ``'HANN'
,'KAISER'
, and'RECTANGULAR'
.- window_overlap
float
, default: 0.5 Overlap value between two successive FFT computations. Values can range from 0 to 1. For example,
0
means no overlap, and0.5
means 50% overlap.
- signal
Methods
Convert a DPF fields container to a NumPy array.
Get the STFT of the signal as a DPF fields container.
Get the STFT of the signal as a NumPy array.
Get the amplitude of the STFT as a NumPy array.
Get the phase of the STFT as a NumPy array.
Plot signals.
Compute the STFT.
Attributes
Number of FFT points.
Input signal as a DPF field.
Window overlap in %.
Window type.