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 $\text{nm}/{\text{sec}}^{2}$) 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. By default, plots are with respect to sample index and frequencies are in cycles per sample. Select the Sample Rate radio button. Because the data sample rate is 1 hertz, you do not have to change the default value. The plots and frequencies update to use the sample rate.

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.

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. Placing the cursor over parameter will show a tooltip.

• Interpolation — Interpolation method for envelope construction: `spline` (default) | `pchip`

• Sift Relative Tolerance — Cauchy-type convergence criterion: `0.2` (default) | positive scalar

• Sift Max Iterations — Maximum number of sifting iterations: `100` (default) | positive integer between 1 and 10,000

• Max Number IMF — Maximum number of IMFs extracted: positive integer between 1 and 10,000

• Max Number Extrema — Maximum number of extrema in the residual signal: `1` (default) | positive integer between 1 and 10,000

• Max Energy Ratio — Signal to residual energy ratio: `20` (default) | positive scalar

To learn more about the parameters and the EMD algorithm, see `emd`.

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 $\text{nm}/{\text{sec}}^{2}$) 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`. Click the Sample Rate radio button so that plots are with respect to time.

Create a new six-level decomposition using the order 4 Coiflet. 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: 4

• Level: 6

In Level Selection, note which components of the decomposition are included in the reconstruction: the approximation and the level 5 and level 6 details.

Level 4 has approximately 60% of the total energy. Remove levels 5 and 6 from the reconstruction, and instead include level 4. Show only the approximation and level 4 details in the Decomposition pane. To approximately align the decomposition with the reconstruction, drag the Decomposition pane beneath the Reconstructions pane.

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 opens in your editor with the following executable code:

```% Logical array for selecting reconstruction elements levelForReconstruction = [false, false, false, true, false, false, true]; % Perform the decomposition using modwt wt = modwt(kobe, 'coif4', 6); % Construct MRA matrix using modwtmra mra = modwtmra(wt, 'coif4'); % 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.

```t = 0:numel(kobe)-1; plot(t,kobe) grid on hold on plot(t,kobe1Copy,'LineWidth',2) xlabel('Seconds') 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 .

`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, David L., and Iain M. Johnstone. “Ideal Spatial Adaptation by Wavelet Shrinkage.” Biometrika 81, no. 3 (September 1, 1994): 425–55. https://doi.org/10.1093/biomet/81.3.425.

Topics

Introduced in R2018b

Get trial now