maad.features.filter_multires

maad.features.filter_multires(Sxx, kernels, npyr=4, rescale=True)[source]

Computes 2D wavelet coefficients at multiple scales using Gaussian pyramid transformation to downscale the input spectrogram.

Parameters:
Sxx: list of 2D arrays

List of input spectrograms to filter

kernels: list of 2D arrays

List of 2D kernels or filters

npyr: int, optional

Number of pyramids to compute. Default is 4.

rescale: boolean, optional

Indicates if the reduced images should be rescaled. Default is True.

Returns:
Sxx_out: list of 2D arrays

List of spectrograms filtered by each 2D kernel

Examples

>>> import maad
>>> from maad.sound import load, spectrogram 
>>> from maad.features import filter_bank_2d_nodc, filter_multires 
>>> from maad import util
>>> s, fs = load('../data/spinetail.wav') 
>>> Sxx, dt, df, ext = spectrogram(s, fs) 
>>> Sxx_db = util.power2dB(Sxx, db_range=80) + 80
>>> ax, fig = util.plot2d(Sxx_db, **{'extent':ext})
>>> params, kernels = filter_bank_2d_nodc(frequency=(0.5, 0.25), ntheta=2,gamma=2) 
>>> Sxx_out = filter_multires(Sxx, kernels, npyr=2)

Plot one of the resulting spectrograms.

>>> ax, fig = util.plot2d(Sxx_out[5], **{'extent':ext})