log

Natural logarithm of scattering transform

Description

slog = log(sf,s) returns the natural logarithm of the scattering coefficients in the cell array s. s is the output of scatteringTransform and is a cell array of structure arrays with a signals field.

The precision of slog depends on the precision specified in the framework sf.

ulog = log(sf,u) returns the natural logarithm of the scalogram coefficients in the cell array u. u is the output of scatteringTransform and is a cell array of structure arrays with a coefficients field.

The precision of ulog depends on the precision specified in the framework sf.

example

xlog = log(sf,x) returns the natural logarithm of the 2-D matrix or 3-D array x. x is the output of featureMatrix.

The precision of xlog depends on the precision specified in the framework sf.

Examples

collapse all

This example shows how to obtain the natural logarithm of scattering coefficients.

Load a noisy Doppler signal and create a scattering decomposition framework that can be used with the signal. Return the scattering coefficients.

load noisdopp
sf = waveletScattering('SignalLength',numel(noisdopp));
S = scatteringTransform(sf,noisdopp);

Calculate the natural logarithm of the scattering coefficients. Display the number of rows in the table containing the first-order scattering coefficients.

slog = log(sf,S);
coefOrder = 1;
display(['Number of rows: ',...
    num2str(size(S{coefOrder+1},1))])
Number of rows: 40

Choose a row from the first-order scattering coefficients table. Take the natural logarithm of the absolute value of the scattering coefficients in that row. Compare with the corresponding row in slog and confirm they are equal.

row = 23;
tmp1 = slog{coefOrder+1}.signals{row};
tmp2 = log(abs(S{coefOrder+1}.signals{row}));
disp(['Max Difference of Scattering Coefficients: ',...
    num2str(max(abs(tmp1(:)-tmp2(:))))])
Max Difference of Scattering Coefficients: 0

Input Arguments

collapse all

Scattering decomposition framework, specified as a waveletScattering object.

Scattering coefficients, specified as a cell array of structure arrays. s is the output of scatteringTransform for the scattering decomposition framework sf.

Scalogram coefficients, specified as a cell array of structure arrays. u is the output of scatteringTransform for the scattering decomposition framework sf.

Scattering feature matrix, specified as a real-valued 2-D matrix or 3-D array. x is the output of featureMatrix for the scattering decomposition framework sf.

Output Arguments

collapse all

Natural logarithm of scattering coefficients, returned as a cell array. The dimensions of slog are equal to the dimensions of s.

The precision of slog depends on the precision specified in the framework sf.

Natural logarithm of scalogram coefficients, returned as a cell array. The dimensions of ulog are equal to the dimensions of u.

The precision of ulog depends on the precision specified in the framework sf.

Natural logarithm of scattering feature matrix, returned as a real-valued matrix or array. The dimensions of xlog are equal to the dimensions of x.

The precision of xlog depends on the precision specified in the framework sf.

Algorithms

log returns the natural logarithm of the absolute value of the input argument.

Introduced in R2018b