www.gusucode.com > wavelet 源码程序 matlab案例代码 > wavelet/ReconstructFrequencyLocalizedEarthquakeDataExample.m

    %% Reconstruct Frequency-Localized Data
% Reconstruct a frequency-localized approximation to the Kobe earthquake 
% data by extracting information from the CWT. The extracted information
% corresponds to frequencies in the range [0.030 0.070] Hz.
load kobe;
%% 
% Obtain the CWT. Then, obtain the inverse CWT and add the signal mean back
% into the reconstructed data. The CWT does not preserve the signal mean.
[wt,f] = cwt(kobe,1);
xrec = icwt(wt,f,[0.030 0.070],'SignalMean',mean(kobe));
%%
% Plot the original and reconstructed data.
subplot(211)
plot(kobe);
grid on
title('Original Data');
ylabel('Amplitude')

subplot(212)
plot(xrec);
grid on
title('Bandpass Filtered Reconstruction [0.030 0.070] Hz');
xlabel('Frequency');
ylabel('Amplitude');