2.4 Time-Frequency Analysis

Summary

This Time-Frequency Analysis app can be used to perform time-frequency analysis based on continuous wavelet transform, including the following features:

  1. Specify XY signal data, and get sampling interval from time (X) data automatically.
  2. Specify frequency range for the continuous wavelet transform.
  3. Wavelet types include Morlet, Derivative of Gaussian, and Mexican Hat.
  4. Output calculated scale value and pseudo-frequency.
  5. Output coefficient matrix and scalogram matrix.
  6. Create graph with raw data as line plot, and coefficient or scalogram contour plot.
  7. Support both scale vs time and frequency vs time contour plot.

Tutorial

  1. With an empty worksheet activated, run the following LabTalk script in Script Window (Open by menu Window: Script Window) to import data.
    fname$ = "%@ATime-Frequency Analysis\bluejay.wav";
    impWav;
    Time-Frequency Analysis 01.png
  2. Highlight column A of the imported data by clicking the column header, then launch the app by clicking the Time-Frequency Analysis icon Time-Frequency Analysis icon.png from the Apps gallery.
  3. In the dialog, set Frequency Range from 1500 to 4000, and Wave Number to be 20.
    Time-Frequency Analysis 02.png
  4. Click OK button to generate the results, including scales, pseudo-frequency, virtual matrix for coefficients, coefficient matrix, scalogram matrix, and a graph with raw data plot and contour of scalogram matrix.
    Time-Frequency Analysis 03.png
  5. Focus on the created graph. Double click on the contour plot on the bottom layer to bring up the Plot Details dialog. Under the Colormap/Contours tab, click the Level... header of the table to set the levels, as the following image shows, setting From as 5e-4.
    Time-Frequency Analysis 04.png
  6. Go back to Plot Details dialog and click OK button to finish the setting, and get the result graph.
    Time-Frequency Analysis 05.png

Algorithm

  1. Continuous wavelet transform
    Please refer to this page: http://www.originlab.com/doc/Origin-Help/CWT-Algorithm
  2. Scalogram calculation
    Assume coefficient matrix (calculated from continuous wavelet transform) is matCoef. First we compute the product of matCoef multiplied by matCoef itself element by element, to generate matrix matProd. Then we get the absolute value of each value in matProd, to generate matrix matProdAbs. Then we calculate the sum of matProdAbs as sum. Finally, the scalogram matrix, matScalogram is calcualted as 100*matProdAbs/sum.