uwacan.spectral.Filterbank#
- class Filterbank(*, bands_per_decade=None, frame_step=None, frame_duration=None, frame_overlap=0.5, min_frequency=None, max_frequency=None, hybrid_resolution=None, fft_window='hann')[source]#
Bases:
objectCalculates spectrograms, both linear and banded.
- Parameters:
- bands_per_decadefloat, optional
The number of frequency bands per decade for logarithmic scaling.
- frame_stepfloat
The time step between stft frames, in seconds.
- frame_durationfloat
The duration of each stft frame, in seconds.
- frame_overlapfloat, default=0.5
The overlap factor between stft frames. A negative value leaves gaps between frames.
- min_frequencyfloat
The lowest frequency to include in the processing.
- max_frequencyfloat
The highest frequency to include in the processing.
- hybrid_resolutionfloat
A frequency resolution to aim for. Only used if
frame_durationis 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
frame_duration,frame_stepframe_overlap, andhybrid_resolution. At least one ofduration,step, orresolutionhas to be given, seetime_frame_settingsfor further details. At least one ofmin_frequencyandhybrid_resolutionhas to be given. Note that theframe_durationandframe_stepcan be auto-chosen from the overlap and required frequency resolution, either fromhybrid_resolutionormin_frequency.Methods
Inherited methods