dhbw.dasp.fft module

dhbw.dasp.fft.abs(x, y, db=True, window='hanning')[source]

Returns DFT frequencies and corresponding absolute values of the specified timeline x and signal amplitudes y.

Alternatively specify the sample rate instead of the timeline x.

Parameters:
xarray or float

Timeline or sample rate.

yarray

Input signal amplitudes.

dbbool, optional

Express frequencies in decibel.

windowstr, optional

Window name.

Returns:
freqsarray

Frequency array.

powerarray

Corresponding absolute values.

dhbw.dasp.fft.arg(x, y, wrap=None, window='hanning')[source]

Returns DFT frequencies and corresponding argument values of the specified timeline x and signal amplitudes y.

Alternatively specify the sample rate instead of the timeline x.

Parameters:
xarray or float

Timeline or sample rate.

yarray

Input signal amplitudes.

wrapbool, optional

Explicitly wrap or unwrap argument values.

windowstr, optional

Window name.

Returns:
freqsarray

Frequency array.

phasearray

Corresponding argument values.

dhbw.dasp.fft.fft(x, norm=True, window='hanning')[source]

Returns DFT of the specified real-valued array.

Parameters:
xarray

Real input array.

normbool, optional

Option whether to scale the output array by 1/N.

windowstr, optional

Window name.

Returns:
yarray

Complex output array.

dhbw.dasp.fft.ifft(x, norm=True)[source]

Returns IDFT of the specified complex-valued array.

Parameters:
xarray

Complex input array.

normbool, optional

Option whether to scale the output array by 1*N.

Returns:
yarray

Real output array.

dhbw.dasp.fft.window(name, size)[source]

Returns coefficients of the specified window and size.

Parameters:
namestring

Window function name (rectangular, bartlett, blackman, hamming, hanning, kaiser).

sizeint

Number of window coefficients to compute.