sst = nianpj; % precipitation为保存在MATLAB workspace中的年降水量矢量数据
variance = std(sst)^2; %计算方差
sst = (sst - mean(sst))/sqrt(variance) %数据标准化。如果导入的降水量数据已经标准化,此步骤可忽略
n = length(sst); %降水量数据的矢量长度
dt = 1 %设置时间步长为1年
time = [0:n-1]*dt+ 1981 ; %设置时间矢量,从1961到2007
xlim = [1981,2013]; %绘图时x轴范围
pad = 1; %填补模式为1。本时间序列长度为47,不足26,故选择0填补
dj = 0.125; % this will do 4 sub-octaves per octave
s0 = 2*dt; %可分辨的最小尺度为2年
j1 = 6/dj; % 为26中的6,即以2的幂指数,根据时间序列长度确定
lag1 = 0.72; %红噪声背景谱的自相关检验参数
mother = 'Morlet'; %母小波为“Morlet”
%%-------------小波转换-