Main Content

Using Wavelet Signal Analyzer App

App Workflow

A typical workflow for analyzing and compressing 1-D signals using the Wavelet Signal Analyzer app is:

  1. Select Signal to Analyze — Select a 1-D signal in the MATLAB® workspace. You can access all single-channel, real- and complex-valued signals.

  2. Decompose Signal — Choose a wavelet or wavelet packet decomposition method. Compare decompositions by varying wavelet parameters.

  3. Explore Signal Decomposition — Plot the histogram and autocorrelation of the coefficients at a decomposition level. Plot the energy for all levels.

  4. Compress Signal — Apply global or level-dependent thresholds to the decomposition.

  5. Share Results — Export results to the workspace. Generate scripts to reproduce analyses.

Example: Visualize Wavelet Decomposition

This example shows how to use the Wavelet Signal Analyzer app to visualize the wavelet decomposition of a 1-D signal using the nondecimated discrete wavelet transform.

Load an electroencephalogram (ECG) signal.

load wecg

Open Wavelet Signal Analyzer. On the Analyzer tab, click Import. A window appears with a list of all the workspace variables the app can process. Select wecg and click Import. A four-level nondecimated wavelet decomposition of the signal appears. The decomposed signal is named wecg1 in the Scenarios pane. The decomposition type Nondecimated Wavelet identifies the decomposition. The original signal, wecg, and the reconstruction, wecg1, are plotted in the Reconstructed-Compressed Signal pane. By default, the plots are identical. To hide the plot of the original signal, click wecg in the plot legend. The text fades and the plot of the original signal disappears. You can use the legend to hide any plot in the Reconstructed-Compressed Signal pane.

The plots in the Decomposition Coefficients pane are the amplitudes of the coefficients of the wavelet decomposition of the signal at each scale. To plot the magnitudes or the sorted magnitudes of the coefficients, choose an option from the Coefficients ▼ menu on the Analyzer tab.

By default, plots are with respect to sample index and frequencies are in cycles per sample. To specify a sample rate, select the Sample Rate radio button on the Analyzer tab. To instead specify a sample period, select the Sample Period radio button. Plots update automatically to reflect how you specify time.

visualize-decomposition-after-importing-data.png

For each scale, the Levels pane shows the number of coefficients, the number of nonzero coefficients, and the approximate frequency band. The frequency units depend on how you specify time. A check box in the Plot Coefficients column controls whether to plot the coefficients in the Decomposition Coefficients pane.

close-up-of-levels.png

See Also

Apps

Related Topics