uwacan.spectral.FilterbankRoller#

class FilterbankRoller(time_data, duration=None, step=None, overlap=None, min_frequency=None, max_frequency=None, bands_per_decade=None, hybrid_resolution=None, fft_window='hann')[source]#

Bases: Roller

Rolling computation of power spectra and spectrograms, both linear and banded.

Parameters:
time_dataTimeData

The time-data wrapper to process.

durationfloat, optional

The duration of the fft windows, in seconds.

stepfloat, optional

The step size between consecutive fft windows, in seconds.

overlapfloat, optional

The amount of overlap between fft windows, as a fraction of the duration.

min_frequencyfloat

The lowest frequency to include in the processing.

max_frequencyfloat

The highest frequency to include in the processing.

bands_per_decadefloat, optional

The number of frequency bands per decade for logarithmic scaling.

hybrid_resolutionfloat

A frequency resolution to aim for. Only used if frame_duration is not given

fft_windowstr, default=”hann”

The window function to apply to each rolling window before computing the FFT. Can be a string specifying a window type (e.g., "hann", "kaiser", "blackman") or an array-like sequence of window coefficients..

Raises:
ValueError

If the processing settings are not compatible, e.g., - frequency bands with bandwidth smaller than the frame duration allows

Notes

The processing is done in stft frames determined by duration, step overlap, and hybrid_resolution. At least one of duration, step, or resolution has to be given, see time_frame_settings for further details. At least one of min_frequency and hybrid_resolution has to be given. Note that the duration and step can be auto-chosen from the overlap and required frequency resolution, either from hybrid_resolution or min_frequency.

Methods

batches(batch_size)

Generate batches of spectrogram frames.

check_frequency_resolution()

Validate the frequency resolution against the temporal window settings.

make_frequency_vectors()

Construct frequency vectors and band definitions based on spectrogram settings.

numpy_frames()

Generate numpy frames with data.

Inherited methods

Attributes

coords

The coords of the output frames.

dims

The dimensions of the output frames.

num_frames

The number of frames in this rolling output.

shape

The shape of the output frames.