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:
RollerRolling 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_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
duration,stepoverlap, 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 thedurationandstepcan be auto-chosen from the overlap and required frequency resolution, either fromhybrid_resolutionormin_frequency.Methods
batches(batch_size)Generate batches of spectrogram frames.
Validate the frequency resolution against the temporal window settings.
Construct frequency vectors and band definitions based on spectrogram settings.
Generate numpy frames with data.
Inherited methods
Attributes
coordsThe coords of the output frames.
dimsThe dimensions of the output frames.
num_framesThe number of frames in this rolling output.
shapeThe shape of the output frames.