Signal Multiresolution Analyzer

Decompose signals into time-aligned components

Description

The Signal Multiresolution Analyzer app is an interactive tool for visualizing multilevel wavelet and empirical mode decompositions of real-valued 1-D signals and comparing results. With the app, you can:

  • Access all the signals in the MATLAB® workspace.

  • Adjust default parameters and generate multiple decompositions using modwt and modwtmra (default) or emd methods.

  • Choose decomposition levels to include in the signal reconstruction.

  • Visualize and compare results.

  • Obtain frequency ranges of the decomposition levels. (See powerbw for more information.)

  • Determine the relative energy of the signal across levels.

  • Export reconstructed signals and decompositions to your workspace.

  • Recreate the decomposition in your workspace by generating a MATLAB script.

Open the Signal Multiresolution Analyzer App

  • MATLAB Toolstrip: On the Apps tab, under Signal Processing and Communications, click Signal Multiresolution Analyzer .

  • MATLAB command prompt: Enter signalMultiresolutionAnalyzer.

Examples

expand all

Load in the Kobe earthquake data. The data are seismograph measurements (vertical acceleration in nm/sec2) recorded at Tasmania University, Hobart, Australia, on 16 January 1995, beginning at 20:56:51 (GMT) and continuing for 51 minutes at one second intervals.

load kobe

Open Signal Multiresolution Analyzer and click Load Signal. A window appears listing all the workspace variables the app can process.

Select the Kobe data from the dialog box and click OK. A four-level MODWTMRA decomposition of the signal appears. The decomposed signal is named kobe1 in the Decomposed Signals pane. The suffix [modwtmra] identifies the decomposition as wavelet based.

The plots in the middle Decomposition pane are the projections of the wavelet decompositions of the signal at each scale on the original signal subspace. The original signal, kobe, and the reconstruction, kobe1, are plotted in the Reconstruction pane. The Level Selection pane shows the relative energies of the signal across scales, as well as the frequency bands.

A check box in the Show column controls whether or not that level is displayed in the Decomposition pane. A check box in the Include column controls whether or not to include that level of the wavelet decomposition in the reconstruction. Clicking a plot in the Decomposition pane is another way to include or exclude that level in the signal reconstruction. To generate a new wavelet decomposition, change one of the wavelet parameters in the toolstrip and click Decompose.

  • Wavelet - Wavelet family

  • Number - Wavelet filter number

  • Level - Wavelet decomposition level

Changing any setting in the toolstrip will enable the Decompose button.

Load the noisy Doppler signal. The signal is a noisy version of the Doppler test signal of Donoho and Johnstone [1].

load noisdopp

Open Signal Multiresolution Analyzer and load the signal into the app. By default, the app creates a four-level MODWTMRA decomposition of the signal. In the Decomposed Signals pane, the wavelet decomposition is named noisdopp1. The Reconstruction pane shows the original and reconstructed signals plotted in two different colors.

To add the EMD decomposition, click Add ▼ and select EMD.

After a few moments the EMD decomposition noisdopp2 appears in the app. Because the EMD decomposition is selected in the Decomposed Signals pane, the toolstrip changes to show options related to EMD, and the residual is now the thickest plot in the Reconstructions pane.

To more easily see the differences between the two reconstructions, click noisdopp in the plot legend. The text fades, and the plot of the original signal is hidden. You can use the legend to hide any plot in the Reconstruction pane.

You can change the parameters in the toolstrip to generate a different EMD decomposition:

  • Interpolation - Interpolation method for envelope construction

  • Sift Relative Tolerance - Cauchy type convergence criterion

  • Sift Max Iterations - Maximum number of sifting iterations

  • Max Number IMF - Maximum number of IMFs extracted

  • Max Number Extrema - Maximum number of extrema in the residual signal

  • Max Energy Ratio - Signal to residual energy ratio

See emd for more information about the parameters.

This example shows how to change the app default settings to duplicate a decomposition for modification, and then how to generate a script to recreate the decomposition in your workspace.

Load the Kobe earthquake data into your workspace. The data are seismograph measurements (vertical acceleration in nm/sec2) recorded at Tasmania University, Hobart, Australia, on 16 January 1995, beginning at 20:56:51 (GMT) and continuing for 51 minutes at one second intervals.

load kobe

Open Signal Multiresolution Analyzer and load the earthquake data into the app. By default, the app creates a four-level MODWTMRA decomposition of the signal called kobe1 using the order 4 Symlet sym4.

Create a new six-level decomposition using the order 1 Coiflet coif1. Click Duplicate in the toolstrip. Since kobe1 is the currently selected item in Decomposed Signals, a duplicate of the first decomposition is created. The duplicate is called kobe1Copy. The plots in Reconstruction are updated to include the new decomposition. Except for the color, the duplicate will be identical with the first decomposition. You can change the name of the duplicate by right-clicking on the name in Decomposed Signals.

Change the settings in the toolstrip to the following values and then click Decompose.

  • Wavelet: coif

  • Number: 1

  • Level: 6

In Level Selection, note which components of the decomposition are included in the reconstruction: the approximation and the level 5 and 6 details. The signal does not have much energy at level 6, while level 4 has nearly one half the total energy. Remove Level 6 from the reconstruction, and instead include level 4.

The plot of the kobe1Copy reconstruction changes noticeably.

You have three export options. You can export the reconstruction or the entire decomposition to your workspace, or you can create a MATLAB™ script. To generate a script, click Export > Generate MATLAB Script.

An untitled script appears in your MATLAB Editor.

% Decompose Signal using the MODWT
% Generated by MATLAB(R) 9.5 and Wavelet Toolbox 5.0.
% Generated on: 02-May-2018 18:41:50
% Logical array for selecting reconstruction elements
levelForReconstruction = [false, false, false, true, true, false, true];
% Perform the decomposition using modwt
wt = modwt(kobe, 'coif1', 6);
% Construct MRA matrix using modwtmra
mra = modwtmra(wt, 'coif1');
% Sum along selected multiresolution signals
kobe1Copy = sum(mra(levelForReconstruction,:),1);

The true-false values in levelForReconstruction correspond to which Include boxes are checked in Level Selection. You can save the script as is, or modify it to apply the same decomposition settings to other signals. Run the script and plot the original signal and reconstruction. Except for possibly the colors, the plot will match the kobe1Copy reconstruction shown in the app.

plot(kobe)
grid on
hold on
plot(kobe1Copy,'LineWidth',2)
xlabel('Samples')
title('Reconstruction')
legend('Original','Reconstruction','Location','northwest')
axis tight

Parameters

Orthogonal wavelet family to use to generate the multiresolution analysis (default), specified as:

  • sym — Symlets

  • coif — Coiflets

  • db — Daubechies wavelets

  • fk — Fejér-Korovkin wavelets

The Wavelet parameter is applicable only for generating a multiresolution analysis.

For more information about the wavelets, use the waveinfo function. For example, to learn more about Daubechies wavelets, enter waveinfo('db').

Interpolation method to use for envelope construction in empirical mode decomposition, specified as one of the following:

  • spline — Cubic spline interpolation

  • pchip — Piecewise cubic Hermite interpolating polynomial method

The Interpolation parameter is applicable only for generating an empirical mode decomposition. You can change other options with the app when creating empirical mode decompositions. For more information, see emd.

Programmatic Use

expand all

signalMultiresolutionAnalyzer opens the Signal Multiresolution Analyzer app. Once the app initializes, import a signal for analysis by clicking Load Signal.

signalMultiresolutionAnalyzer(sig) opens the Signal Multiresolution Analyzer app and imports, decomposes, and plots the multiresolution analysis of sig using modwtmra and modwt with the sym4 wavelet and default settings. sig is a real-valued vector.

By default, the app plots the decomposition levels as functions of sample index. To plot with respect to time, you can set a sample rate or sample period using the app.

Tips

To decompose more than one signal simultaneously, you can run multiple instances of the Signal Multiresolution Analyzer app.

Algorithms

The Signal Multiresolution Analyzer uses modwt and modwtmra to generate the multiresolution analysis and emd to generate the empirical mode decompositions.

References

[1] Donoho, D. L., and I. M. Johnstone. “Ideal Spatial Adaptation by Wavelet Shrinkage.” Biometrika. Vol. 81, 1994, pp. 425–455 1994.

Introduced in R2018b