
- SciPy - Home
- SciPy - Introduction
- SciPy - Environment Setup
- SciPy - Basic Functionality
- SciPy - Relationship with NumPy
- SciPy Clusters
- SciPy - Clusters
- SciPy - Hierarchical Clustering
- SciPy - K-means Clustering
- SciPy - Distance Metrics
- SciPy Constants
- SciPy - Constants
- SciPy - Mathematical Constants
- SciPy - Physical Constants
- SciPy - Unit Conversion
- SciPy - Astronomical Constants
- SciPy - Fourier Transforms
- SciPy - FFTpack
- SciPy - Discrete Fourier Transform (DFT)
- SciPy - Fast Fourier Transform (FFT)
- SciPy Integration Equations
- SciPy - Integrate Module
- SciPy - Single Integration
- SciPy - Double Integration
- SciPy - Triple Integration
- SciPy - Multiple Integration
- SciPy Differential Equations
- SciPy - Differential Equations
- SciPy - Integration of Stochastic Differential Equations
- SciPy - Integration of Ordinary Differential Equations
- SciPy - Discontinuous Functions
- SciPy - Oscillatory Functions
- SciPy - Partial Differential Equations
- SciPy Interpolation
- SciPy - Interpolate
- SciPy - Linear 1-D Interpolation
- SciPy - Polynomial 1-D Interpolation
- SciPy - Spline 1-D Interpolation
- SciPy - Grid Data Multi-Dimensional Interpolation
- SciPy - RBF Multi-Dimensional Interpolation
- SciPy - Polynomial & Spline Interpolation
- SciPy Curve Fitting
- SciPy - Curve Fitting
- SciPy - Linear Curve Fitting
- SciPy - Non-Linear Curve Fitting
- SciPy - Input & Output
- SciPy - Input & Output
- SciPy - Reading & Writing Files
- SciPy - Working with Different File Formats
- SciPy - Efficient Data Storage with HDF5
- SciPy - Data Serialization
- SciPy Linear Algebra
- SciPy - Linalg
- SciPy - Matrix Creation & Basic Operations
- SciPy - Matrix LU Decomposition
- SciPy - Matrix QU Decomposition
- SciPy - Singular Value Decomposition
- SciPy - Cholesky Decomposition
- SciPy - Solving Linear Systems
- SciPy - Eigenvalues & Eigenvectors
- SciPy Image Processing
- SciPy - Ndimage
- SciPy - Reading & Writing Images
- SciPy - Image Transformation
- SciPy - Filtering & Edge Detection
- SciPy - Top Hat Filters
- SciPy - Morphological Filters
- SciPy - Low Pass Filters
- SciPy - High Pass Filters
- SciPy - Bilateral Filter
- SciPy - Median Filter
- SciPy - Non - Linear Filters in Image Processing
- SciPy - High Boost Filter
- SciPy - Laplacian Filter
- SciPy - Morphological Operations
- SciPy - Image Segmentation
- SciPy - Thresholding in Image Segmentation
- SciPy - Region-Based Segmentation
- SciPy - Connected Component Labeling
- SciPy Optimize
- SciPy - Optimize
- SciPy - Special Matrices & Functions
- SciPy - Unconstrained Optimization
- SciPy - Constrained Optimization
- SciPy - Matrix Norms
- SciPy - Sparse Matrix
- SciPy - Frobenius Norm
- SciPy - Spectral Norm
- SciPy Condition Numbers
- SciPy - Condition Numbers
- SciPy - Linear Least Squares
- SciPy - Non-Linear Least Squares
- SciPy - Finding Roots of Scalar Functions
- SciPy - Finding Roots of Multivariate Functions
- SciPy - Signal Processing
- SciPy - Signal Filtering & Smoothing
- SciPy - Short-Time Fourier Transform
- SciPy - Wavelet Transform
- SciPy - Continuous Wavelet Transform
- SciPy - Discrete Wavelet Transform
- SciPy - Wavelet Packet Transform
- SciPy - Multi-Resolution Analysis
- SciPy - Stationary Wavelet Transform
- SciPy - Statistical Functions
- SciPy - Stats
- SciPy - Descriptive Statistics
- SciPy - Continuous Probability Distributions
- SciPy - Discrete Probability Distributions
- SciPy - Statistical Tests & Inference
- SciPy - Generating Random Samples
- SciPy - Kaplan-Meier Estimator Survival Analysis
- SciPy - Cox Proportional Hazards Model Survival Analysis
- SciPy Spatial Data
- SciPy - Spatial
- SciPy - Special Functions
- SciPy - Special Package
- SciPy Advanced Topics
- SciPy - CSGraph
- SciPy - ODR
- SciPy Useful Resources
- SciPy - Reference
- SciPy - Quick Guide
- SciPy - Cheatsheet
- SciPy - Useful Resources
- SciPy - Discussion
SciPy - Multi-Resolution Analysis (MRA)
Multi-Resolution Analysis in SciPy
The Multi-Resolution Analysis (MRA) is a fundamental concept in wavelet analysis that enables the decomposition of signals into different resolution levels. It provides a systematic way to analyze signals at multiple scales by capturing both coarse and fine details. MRA is widely used in signal processing applications such as denoising, compression and feature extraction.
The Multi-Resolution Analysis is based on the scaling function (t) and the wavelet function (t) which are used to represent a signal f(t) at different resolution levels. Mathematically, MRA is defined as follows −
f(t) = ∑j ∑k cj, k φ(t - k 2j) + ∑j ∑k dj, k ψ(t - k 2j)
Where −
- f(t) is the original signal.
- (t) is the scaling function that represents the approximation at each level.
- (t) is the wavelet function that captures the detail components.
- cj,k are the approximation coefficients.
- dj,k are the detail coefficients.
Key Properties of Multi-Resolution Analysis
The Multi-Resolution Analysis provides the following key properties in SciPy −
- Hierarchical Signal Representation: MRA decomposes a signal into different levels of approximation and detail components.
- Localization: MRA provides time-frequency localization by making it useful for analyzing transient and non-stationary signals.
- Data Reduction: MRA reduces the amount of data needed to represent a signal by focusing on relevant features at each resolution.
- Smooth and Detail Separation: MRA separates the low-frequency (approximation) and high-frequency (detail) components effectively.
Multi-Resolution Decomposition of a signal
Multi-Resolution Decomposition (MRD) using PyWavelets allows breaking down a signal into different resolution levels by applying Discrete Wavelet Transform (DWT). This helps analyze both coarse and fine details of the signal efficiently. MRD is widely used in applications such as signal compression, feature extraction and denoising.
In PyWavelets, the wavedec() function is used to perform multi-level decomposition of a signal. It returns the approximation and detail coefficients at each decomposition level.
Following is the example which shows how to decompose a signal into multiple levels using PyWavelets −
import numpy as np import pywt import matplotlib.pyplot as plt # Generate a sample signal (a combination of sine waves) t = np.linspace(0, 1, 500, endpoint=False) # Time vector signal = np.sin(2 * np.pi * 5 * t) + np.sin(2 * np.pi * 20 * t) # Combination of frequencies # Perform Multi-Level DWT decomposition using Daubechies wavelet ('db4') coeffs = pywt.wavedec(signal, 'db4', level=3) # Extract approximation and detail coefficients cA3, cD3, cD2, cD1 = coeffs # cA3: Approximation at level 3, cD3: Detail at level 3, etc. # Plot the original signal and decomposition results plt.figure(figsize=(10, 10)) # Plot the original signal plt.subplot(5, 1, 1) plt.plot(t, signal) plt.title("Original Signal") plt.xlabel("Time") plt.ylabel("Amplitude") # Plot approximation coefficients at level 3 plt.subplot(5, 1, 2) plt.plot(cA3) plt.title("Approximation Coefficients at Level 3") # Plot detail coefficients at level 3 plt.subplot(5, 1, 3) plt.plot(cD3) plt.title("Detail Coefficients at Level 3") # Plot detail coefficients at level 2 plt.subplot(5, 1, 4) plt.plot(cD2) plt.title("Detail Coefficients at Level 2") # Plot detail coefficients at level 1 plt.subplot(5, 1, 5) plt.plot(cD1) plt.title("Detail Coefficients at Level 1") plt.tight_layout() plt.show()
Below is the output of the Multi-Level Wavelet Decomposition −

Multi-Resolution Decomposition of multiple signals
This example shows how multi-resolution decomposition works with a different signal and wavelet by giving a different perspective on how this technique can be applied to various types of signals −
import numpy as np import pywt import matplotlib.pyplot as plt # Generate a signal (combination of a sine wave and a high-frequency pulse) t = np.linspace(0, 1, 1000, endpoint=False) # Time vector signal = np.sin(2 * np.pi * 30 * t) + 0.5 * np.sin(2 * np.pi * 150 * t) # Combination of low and high frequencies # Perform Multi-Level DWT decomposition using the Symlet wavelet (sym2) coeffs = pywt.wavedec(signal, 'sym2', level=4) # Extract approximation and detail coefficients for each level cA4, cD4, cD3, cD2, cD1 = coeffs # cA4: Approximation at level 4, cD4: Detail at level 4, etc. # Plot the original signal and the decomposition results plt.figure(figsize=(10, 12)) # Plot the original signal plt.subplot(6, 1, 1) plt.plot(t, signal) plt.title("Original Signal") plt.xlabel("Time") plt.ylabel("Amplitude") # Plot approximation coefficients at level 4 plt.subplot(6, 1, 2) plt.plot(cA4) plt.title("Approximation Coefficients at Level 4") # Plot detail coefficients at level 4 plt.subplot(6, 1, 3) plt.plot(cD4) plt.title("Detail Coefficients at Level 4") # Plot detail coefficients at level 3 plt.subplot(6, 1, 4) plt.plot(cD3) plt.title("Detail Coefficients at Level 3") # Plot detail coefficients at level 2 plt.subplot(6, 1, 5) plt.plot(cD2) plt.title("Detail Coefficients at Level 2") # Plot detail coefficients at level 1 plt.subplot(6, 1, 6) plt.plot(cD1) plt.title("Detail Coefficients at Level 1") plt.tight_layout() plt.show()
Below is the output of the Multi-Level Wavelet Decomposition for multi signals −

Understanding the Decomposed Components
After performing the decomposition the signal is broken down into the following components −
- Approximation Coefficients: Represent the low-frequency (coarse) part of the signal.
- Detail Coefficients: Capture the high-frequency (fine) components at each level.
Applications of Multi-Resolution Decomposition
The Multi-Resolution Decomposition technique is useful in various fields such as −
- Image Compression: Used in JPEG2000 for progressive image reconstruction.
- Biomedical Signal Processing: Analyzing ECG and EEG signals for diagnosis.
- Fault Detection: Identifying faults in machinery through vibration analysis.
- Time-Series Forecasting: Extracting key features from financial or environmental data.
Choosing the Right Wavelet for MRA
The choice of wavelet function is critical for effective Multi-Resolution Analysis. Some commonly used wavelets and their applications are listed below −
Wavelet | Best For | Example Use Cases |
---|---|---|
Daubechies (db) | General-purpose smooth signals | Signal compression, denoising |
Coiflet | High vanishing moments, feature detection | Biomedical analysis |
Haar | Simple step-like signals | Edge detection, compression |
Note: Choosing the appropriate wavelet depends on the characteristics of the signal and the application requirements.