Main Content

filterbank

Wavelet time scattering filter banks

Description

filters = filterbank(sf) returns the filter banks used in the computation of the scattering coefficients. filters is a cell array of structure arrays with norder elements, where norder is the number of scattering orders. The first element of filters contains the scaling filter, phift, used in the computation of the 0th-order scattering coefficients. Subsequent elements of filters contain the wavelet filters, psift, and scaling filter, phift, for the corresponding filter banks of the scattering decomposition.

The precision of phift and psift depends on the precision specified in the scattering network sf.

[filters,f] = filterbank(sf) returns the frequencies corresponding to the DFT bins in the psift and phift fields of filters. If you specify a sampling frequency in the construction of sf, f is measured in hertz. Otherwise, f is measured in cycles/sample.

[filters,f,filterparams] = filterbank(sf) returns the filter parameters for each element of filters. filterparams is a cell array with norder elements. Each element of filterparams is a MATLAB® table.

example

[___] = filterbank(sf,order) returns the filter banks used to compute the specified order scattering coefficients. order is an integer between 0 and nfilters inclusive, where nfilters is the number of filter banks in the scattering network. These input arguments can be used with any of the output syntaxes shown previously.

Examples

collapse all

Create a wavelet time scattering network for a signal sampled at 25 Hz.

sf = waveletScattering(SamplingFrequency=25)
sf = 
  waveletScattering with properties:

          SignalLength: 1024
       InvarianceScale: 20.4800
        QualityFactors: [8 1]
              Boundary: 'periodic'
     SamplingFrequency: 25
             Precision: 'double'
    FilterDownsampling: 'fullband'
    OversamplingFactor: 0
          OptimizePath: 0

Obtain the filter banks, DFT frequency bins, and filter bank parameters.

[filters,f,fparams] = filterbank(sf);

Plot the wavelet filters used in computing the first-order coefficients. Plot the wavelet center frequencies as well.

coefOrder = 1;
wvFilters = filters{coefOrder+1}.psift;
wvcenFrq = fparams{coefOrder+1}.omegapsi;
plot(f,wvFilters)
hold on
cf = plot(wvcenFrq,max(wvFilters),"x");
hold off
grid on
title("Wavelet Filters")
xlabel("Hz")
ylabel("Magnitude")
legend(cf,"Center Frequencies")

Figure contains an axes object. The axes object with title Wavelet Filters, xlabel Hz, ylabel Magnitude contains 42 objects of type line. One or more of the lines displays its values using only markers This object represents Center Frequencies.

Create a wavelet scattering network with SignalLength set to 500.

sigLen = 500;
sf = waveletScattering(SignalLength=sigLen);

Obtain the filter banks and filter bank parameters.

[fbank,~,fparams] = filterbank(sf);

Obtain the wavelet filters in the first filter bank and their metadata. Confirm that the number of columns in the filter bank matrix is equal to the number of center frequencies in the metadata. Keep in the mind that the filters and metadata in the second element of fbank and fparams, respectively.

wfb = 1;
wavFilters = fbank{wfb+1}.psift;
wavCF = fparams{wfb+1}.omegapsi;
[size(wavFilters,2) length(wavCF)]
ans = 1×2

    33    33

Plot the wavelet center frequencies on a linear scale. Center frequencies are logarithmically spaced from the highest frequency to the frequency that corresponds to the invariance scale. Frequencies lower than the invariance scale are spaced linearly.

plot(wavCF,"x-")
title("Wavelet Center Frequencies")
xlabel("Wavelet Filter Index")
ylabel("Frequency (cycles/sample)")
grid on

Figure contains an axes object. The axes object with title Wavelet Center Frequencies, xlabel Wavelet Filter Index, ylabel Frequency (cycles/sample) contains an object of type line.

Change the y-axis scale to logarithmic. The logarithmically spaced center frequencies now form on a straight line, while the linearly spaced frequencies form a curved line.

yscale("log")

Figure contains an axes object. The axes object with title Wavelet Center Frequencies, xlabel Wavelet Filter Index, ylabel Frequency (cycles/sample) contains an object of type line.

Input Arguments

collapse all

Wavelet time scattering network, specified as a waveletScattering object.

Order of scattering coefficients, specified as a positive integer between 0 and nfilters inclusive, where nfilters is the number of filter banks in the scattering decomposition sf.

Data Types: double

Output Arguments

collapse all

Filter banks using in the computation of the scattering coefficients, returned as a cell array of structure arrays. filters has norder elements, where norder is the number of scattering orders. The first element of filters is a structure with the single field phift. phift contains the scaling filter used in the computation of the 0th-order scattering coefficients. Subsequent elements of filters contain the wavelet filters, psift, and the scaling filter, phift, for the corresponding filter banks of the scattering network in the structure fields.

The precision of phift and psift depends on the precision specified in the scattering network sf.

Frequencies corresponding to the DFT bins in the psift and phift fields of filters. If you specify a sampling frequency in the construction of sf, f is measured in hertz. Otherwise, f is measured in cycles/sample.

Data Types: double

Filter bank parameters for each element of filters, returned as a cell array. Each element of filterparams is a MATLAB table.filterparams has norder elements, where norder is the number of scattering orders.

The first element of filterparams contains metadata describing the lowpass (scaling) filter. The table has these variables:

  • boundary — Signal extension method applied to the boundary.

  • precision — Network numeric precision.

  • sigmaphi — Time standard deviation of the scaling function. If you specify a sampling frequency, sigmaphi is in seconds. Otherwise, sigmaphi is in samples.

  • freqsigmaphi — Frequency standard deviation of the scaling function. If you specify a sampling frequency, freqsigmaphi is in hertz. Otherwise, freqsigmaphi is in cycles/sample.

  • phiftsupport — Frequency support of the scaling function. If you specify a sampling frequency, phiftsupport is in hertz. Otherwise, phiftsupport is in cycles/sample.

  • phi3dBbw — 3-dB bandwidth of the scaling function.

  • philog2ds — Maximum downsampling factor on a base-2 logarithmic scale. (since R2026a)

Subsequent elements of filterparams contain metadata describing the wavelet filters. For i = 0, 1, …, norder-2, the i+1st element of filterparams contains the metadata describing the wavelet filters in the ith filter bank. The tables have these additional variables:

  • Q — Filter bank quality factor. The quality factor is the number of wavelet filters per octave.

  • J — Integer number of logarithmically spaced wavelet filters in the filter bank.

  • omegapsi — Center frequencies for the wavelet filters in descending order (highest to lowest), returned as a vector. The omegapsi variable includes the center frequencies for any linearly spaced filters. If you specify a sampling frequency, omegapsi is in hertz. Otherwise, omegapsi is in cycles/sample.

  • freqsigmapsi — Wavelet frequency standard deviations, returned as a vector. If you specify a sampling frequency, freqsigmapsi is in hertz. Otherwise, freqsigmapsi is in cycles/sample.

  • timesigmapsi — Wavelet time standard deviations, returned as a vector. If you specify a sampling frequency, timesigmapsi is in seconds. Otherwise, timesigmapsi is in samples.

  • psi3dBbw — Wavelet 3-dB bandwidths, returned as a vector.

  • psiftsupport — Wavelet frequency supports, returned as a vector. If you specify a sampling frequency, psiftsupport is in hertz. Otherwise, psiftsupport is in cycles/sample.

  • psilog2ds — Maximum downsampling factor of wavelet filters on a base-2 logarithmic scale, returned as a vector. (since R2026a)

For those table variables containing vectors, the jth element of the vector corresponds to the wavelet filter in the jth column of filters{i+1}.psift.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced in R2018b

expand all