Decompose signals into time-aligned components
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 your MATLAB® workspace.
Choose decomposition levels to include in the signal reconstruction.
Visualize and compare results.
Obtain frequency ranges of the decomposition levels. (See
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.
MATLAB Toolstrip: On the Apps tab, under Signal Processing and Communications, click Signal Multiresolution Analyzer .
MATLAB command prompt: Enter
Load in the Kobe earthquake data. The data are seismograph measurements (vertical acceleration in ) 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.
Open Signal Multiresolution Analyzer and click Import. A window appears listing all the workspace variables the app can process.
Select the Kobe data from the dialog box and click Import. A four-level MODWTMRA decomposition of the signal appears. The decomposed signal is named
kobe1 in the Decomposed Signals pane. The suffix
[MODWT] 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 Reconstructions 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 .
Open Signal Multiresolution Analyzer and import 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 Reconstructions 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 Reconstructions 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) |
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
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 ) 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.
Open Signal Multiresolution Analyzer and import 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 Reconstructions 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.
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
Wavelet— Orthogonal wavelet family
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
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,
Interpolation— Interpolation method
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
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
signalMultiresolutionAnalyzer opens the Signal Multiresolution
Analyzer app. Once the app initializes, import a signal for analysis by clicking
signalMultiresolutionAnalyzer( opens the
Signal Multiresolution Analyzer app and imports, decomposes, and plots the
multiresolution analysis of
modwt with the
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.
To decompose more than one signal simultaneously, you can run multiple instances of the Signal Multiresolution Analyzer app.
 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.