Skip to content

pradosh-dash/VSX-support-scripts

Repository files navigation

Ultrasonic Signal Processing Scripts

A collection of MATLAB scripts for processing and analyzing ultrasonic signals, including attenuation, dispersion, nonlinear parameters, time of flight, impedance estimation, and spectral analysis.

Overview

This toolbox provides functions for comprehensive ultrasonic signal analysis, particularly useful for material characterization and non-destructive testing applications.

Features

  • Frequency-dependent attenuation calculation
  • Phase and group velocity dispersion analysis
  • Nonlinear acoustic parameter estimation
  • Time of flight measurement with enhanced precision
  • Acoustic impedance estimation
  • Detailed spectral analysis

Script Descriptions

calculateAttenuation.m

Calculates frequency-dependent attenuation coefficients:

  • Computes attenuation using frequency domain analysis
  • Returns both average attenuation (Np/m/MHz) and frequency-dependent array
  • Implements power law model fitting with outlier removal
  • Uses median absolute deviation for robust analysis

calculateDispersion.m

Analyzes wave dispersion characteristics:

  • Calculates phase velocity, group velocity, and dispersion
  • Uses unwrapped phase for accurate velocity calculations
  • Implements Savitzky-Golay filtering for phase derivatives
  • Provides robust median-based results in valid frequency ranges

calculateNonlinearParameters.m

Evaluates nonlinear acoustic parameters:

  • Computes second-order nonlinearity parameter β
  • Calculates Total Harmonic Distortion (THD)
  • Measures second and third harmonic ratios
  • Useful for material microstructure characterization

calculateTimeOfFlight.m

High-precision time-of-flight measurement:

  • Uses enhanced cross-correlation with sub-sample precision
  • Implements dual-method validation (envelope and phase correlation)
  • Provides confidence metrics based on correlation and SNR
  • Applies windowing for improved edge handling

estimateImpedance.m

Acoustic impedance estimation:

  • Calculates impedance from transmission coefficients
  • Assumes water/gel coupling medium (Z ≈ 1.5 MRayls)
  • Includes fallback estimation using velocity
  • Returns results in MRayls

spectralAnalysis.m

Comprehensive spectral analysis:

  • Calculates center frequency and bandwidth
  • Computes spectral moments and features
  • Provides spectral entropy and rolloff metrics
  • Uses Welch's method for power spectral density

Usage

Each function requires transmitted and received signals as inputs. Additional parameters may include:

  • thickness: Material thickness for attenuation and dispersion calculations
  • velocity: Sound velocity for impedance estimation
  • samplingRate: Sampling frequency of the signals
  • frequencyRange: Valid frequency range for analysis

Example:

% Calculate attenuation
[attenuation, freqDepAtten] = calculateAttenuation(obj, txSignal, rxSignal, thickness);

% Perform spectral analysis
[centerFreq, bandwidth, spectralFeatures] = spectralAnalysis(obj, txSignal, rxSignal);

Requirements

  • MATLAB with Signal Processing Toolbox
  • Input signals should be time-aligned and properly sampled
  • Signals should have adequate SNR for reliable analysis

Notes

  • All functions include robust error handling and outlier removal
  • Results are validated using multiple methods where applicable
  • Frequency ranges should be set appropriate to transducer characteristics
  • Window functions are applied to minimize edge effects

Contributing

Feel free to contribute to this project by submitting issues or pull requests. Please ensure any modifications maintain the robust error handling and validation present in the current implementation.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages