Main Content

Frequency- and Time-Localized Reconstruction from the Continuous Wavelet Transform

Reconstruct a frequency-localized approximation of Kobe earthquake data. Extract information from the CWT for frequencies in the range of [0.030, 0.070] Hz.

loadkobe

Obtain the CWT of the data.

[wt,f] = cwt(kobe,1);

Reconstruct the earthquake data, adding the signal mean back into the transformed data.

xrec = icwt(wt,[],f,[0.030 0.070],“SignalMean”,mean(kobe));

Plot and compare the original data and the data for frequencies in the range of [0.030, 0.070] Hz.

subplot(2,1,1) plot(kobe) gridontitle('Original Data') subplot(2,1,2) plot(xrec) gridontitle('Bandpass Filtered Reconstruction [0.030 0.070] Hz')

Figure contains 2 axes objects. Axes object 1 with title Original Data contains an object of type line. Axes object 2 with title Bandpass Filtered Reconstruction [0.030 0.070] Hz contains an object of type line.

You can also use time periods, instead of frequency, with the CWT. Load the El Nino data and obtain its CWT, specifying the time period in years.

loadninoairdata[cfs,period] = cwt(nino,years(1/12));

Obtain the inverse CWT for years 2 through 8.

xrec = icwt(cfs,[],period,[years(2) years(8)]);

Plot the CWT of the reconstructed data. Note the absence of energy outside the band of periods from 2 to 8 years.

figure cwt(xrec,years(1/12))

Figure contains an axes object. The axes object with title Magnitude Scalogram contains 3 objects of type image, line, area.

Compare the original data with the reconstructed data for years 2 through 8.

figure subplot(2,1,1) plot(nino) gridontitle('Original Data') subplot(2,1,2) plot(xrec) gridontitle('El Nino Data - Years 2-8')

Figure contains 2 axes objects. Axes object 1 with title Original Data contains an object of type line. Axes object 2 with title El Nino Data - Years 2-8 contains an object of type line.