scattergram

Visualize scattering or scalogram coefficients

Description

img = scattergram(sf,S) returns the scattergram as a matrix for the first-order scattering coefficients, S. The matrix S is the output of scatteringTransform computed using the scattering framework, sf.

img = scattergram(sf,U) returns the scattergram as a matrix for the first-order scalogram coefficients, U. The matrix U is the output of scatteringTransform computed using the scattering framework, sf.

img = scattergram(___,Name,Value) returns the scattergram with additional options specified by one or more Name,Value pair arguments. You can use this syntax with any of the input syntaxes shown previously.

example

scattergram(___) with no output arguments plots the scattergram in the current figure. You can use any of the input syntaxes shown previously.

Examples

collapse all

Load an ECG signal sampled at 180 Hz. Create a scattering decomposition framework that can be used with the signal.

load wecg
Fs = 180;
sf = waveletScattering('SignalLength',numel(wecg),...
    'SamplingFrequency',Fs);

Calculate the scattering transform of the signal.

[S,U] = scatteringTransform(sf,wecg);

Visualize the scattergram for the first-order scattering and scalogram coefficients.

scattergram(sf,S,'FilterBank',1)

figure
scattergram(sf,U,'FilterBank',1)

Input Arguments

collapse all

Scattering decomposition framework, specified as a waveletScattering object.

Scattering coefficients, specified as a cell array. S is the output of scatteringTransform computed using the scattering framework, sf. For more information, see scatteringTransform.

Scalogram coefficients, specified as a cell array. U is the output of scatteringTransform computed using the scattering framework, sf. For more information, see scatteringTransform.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'FilterBank',1 specifies the first filter bank.

Filter bank index, specified as a positive number between 1 and the number of filter banks in sf inclusive. scattergram returns the scattergram for the specified filter bank in sf. The number of filter banks in sf is equal to the number of specified QualityFactors in sf.

If FilterBank is greater than 1, scattergram averages the scalogram or scattering coefficients over all paths terminating at each wavelet bandpass filter. To obtain paths with a common parent, use the 'Parent' name-value pair.

Path parent index, specified as a nonnegative integer. The scalar P is a nonnegative integer representing the P-th wavelet filter at the filter bank FilterBank − 1. scattergram returns the scattergram for the path at the specified filter bank with parent P. If FilterBank is equal to 1, the zeroth filter bank corresponds to the input signal in the case of the scalogram coefficients and the lowpass filtering of the input signal with the scaling function in the case of the scattering coefficients. Lower values of P correspond to wavelets with higher bandpass frequencies.

If you specify P, you must specify the FilterBank name-value pair.

If you specify a value for P which results in a single child, the output img is a vector. The scattergram of a single child is a line plot. If you specify a value for P that results in no children, scattergram returns the scattergram for the filter bank specified by FilterBank.

Output Arguments

collapse all

Scattergram, returned as a real-valued matrix or vector. If you use the Parent name-value pair and specify a value which results in a single child, img is a vector. If the parent has more than one child, img is a matrix.

Introduced in R2018b