Main Content

numFirst2SecondFilterBank

Number of paths from first- to second-order time wavelet filter bank in joint time-frequency scattering network

Since R2024b

    Description

    npaths = numFirst2SecondFilterBank(jtfn) returns the number of first-order time wavelet filter paths going through each second-order time wavelet filter in a joint time-frequency scattering (JTFS) network. The frequency invariance scale of a network cannot exceed the maximum number of paths going through a second-order filter.

    example

    Examples

    collapse all

    Load the quadratic chirp signal. The signal has 4001 samples. Create a joint time-frequency scattering network appropriate for the signal. Specify a frequency invariance scale of 128 samples.

    load quadchirp
    len = numel(quadchirp);
    jtfn = timeFrequencyScattering(SignalLength=len, ...
        FrequencyInvarianceScale=128);

    Use the numFirst2SecondFilterBank object function to obtain the number of first-order time wavelet filter paths going through each second-order time wavelet filter. Find the maximum number of paths going through a second-order time wavelet filter.

    numPaths = numFirst2SecondFilterBank(jtfn);
    maxPaths = max(numPaths.('Number of First Filter Bank Wavelets'))
    maxPaths = 
    61
    

    Inspect the size of the frequency invariance scale of the network. Because the desired scale, 128, exceeds the maximum number of paths, 61, the frequency invariance scale is set to maxPaths.

    jtfn.FrequencyInvarianceScale
    ans = 
    61
    

    Obtain as a tensor the JTFS transform of the signal. The format of the tensor is path-by-frequency-by-time. The size of the frequency dimension of the tensor depends on the maximum number of paths and the frequency invariance scale.

    smat = scatteringFeatures(jtfn,quadchirp);
    size(smat,2)
    ans = 
    2
    
    ceil(maxPaths/2^floor(log2(jtfn.FrequencyInvarianceScale)))
    ans = 
    2
    

    Create a second network with a frequency invariance scale of 7 samples.

    jtfn2 = timeFrequencyScattering(SignalLength=len, ...
        FrequencyInvarianceScale=7);
    jtfn2.FrequencyInvarianceScale
    ans = 
    7
    

    Use the second network to obtain as a tensor the JTFS of the signal. Confirm the size of the frequency dimension of the tensor is equal to ceil(maxPaths/2^floor(log2(fis))), where fis = jtfn2.FrequencyInvarianceScale.

    smat2 = scatteringFeatures(jtfn2,quadchirp);
    size(smat2,2)
    ans = 
    16
    
    ceil(maxPaths/2^floor(log2(jtfn2.FrequencyInvarianceScale)))
    ans = 
    16
    

    Input Arguments

    collapse all

    Joint time-frequency scattering network, specified as a timeFrequencyScattering object.

    Output Arguments

    collapse all

    Number of first-order time wavelet filter paths to each second-order time wavelet filter, returned as a MATLAB® table with these variables:

    • Second Filter Bank Center Frequency — Center frequency of second-order time wavelet filter

    • Number of First Filter Bank Wavelets — Number of paths from first-order time wavelet filter bank to the second-order time wavelet filter

    Version History

    Introduced in R2024b