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

    %% Wavelet Coherence of Two Sine Waves
% Use default |wcoherence| settings to obtain the wavelet coherence between 
% a sine wave with random noise and a frequency-modulated signal with 
% decreasing frequency over time. 
t  = linspace(0,1,1024);
x = -sin(8*pi*t) + 0.4*randn(1,1024);
x = x/max(abs(x));
y = wnoise('doppler',10);
wcoh = wcoherence(x,y);
%%
% The default coherence computation uses the Morlet wavelet, 12 voices per
% octave and smooths 12 scales. The default number of octaves is equal to
% |floor(log2(numel(x)))-1|, which in this case is 9.