% Created by LI Xu
% 15 May, 2014
% Version 1.0
% Main program for Wavlet Analysis
clear;
clc;
load Prec
load ePrec
load cePrec
load Year
clear wname
% Location of the Original Arrary in
% the Extended Arrary
[st, ed]=entendvalue(Prec, ePrec);
% Retrieve the Coefs of Original Arrary
Orig_coefs=coefs(:, st:ed);
clear coefs ePrec st ed
% Retrieve the real part of Orig_coefs
realpart=real(Orig_coefs);
% Drawing the trend of the Precipitation
% LI_plot(Year, Prec, 600);
% xlabel('Year/a', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% ylabel('Annual Precipitation/mm', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% legend('Observation', 'Trend Line');
% export_fig 0_trend.png
% % Drawing the contourf map of the real part
% text_label=-500:100:600;
% text_x=1904:10:2004;
%
% LI_contourf(Year, realpart, scales, text_label, text_x, 14);
% xlabel('Year/a', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% ylabel('Period Scale/a', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% export_fig 3_real_contourf.png
% Drawing the modulus map of the Wavelet Coefficients
% mod_coef=abs(Orig_coefs);
% text_label=0:50:620;
% text_x=1904:10:2004;
%
% LI_contourf(Year, mod_coef, scales, text_label, text_x, 14);
% xlabel('Year/a', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% ylabel('Modulus/dimensionless', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% export_fig 4_mod_contourf.png
% Drawing the modulus square of the Wavelet Coefficients
% mod_square=(abs(Orig_coefs)).^2;
% text_label=0:15000:380000;
% text_x=1904:10:2004;
%
% LI_contourf(Year, mod_square, scales, text_label, text_x, 14);
% xlabel('Year/a', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% ylabel('Modulus Square/dimensionless', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% export_fig 5_mod_square_contourf.png
% Plot Wavelet Variance
% http://wenku.baidu.com/view/bec1ebc90c22590102029dce.html
Wavlet_var=sum(abs(Orig_coefs).^2, 2);
Wavlet_var=Wavlet_var./length(Wavlet_var);
LI_Var(scales, Wavlet_var);
set(gca, 'xgrid', 'on');
xlabel('Period Scale/a', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
ylabel('Wavelet Variance/dimensionless', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
export_fig 6_var.png
% Plot the wavelet coefficient for 55a-period scale
% a55_coef=realpart(55, :);
% LI_period_plot(Year, a55_coef);
% legend('55a-Period Scale', 'location', 'north');
%
% xlabel('Year/a', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% ylabel('Wavelet Coefficient/dimensionless', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% export_fig 7_55a_coefficient.png
% Plot the wavelet coefficient for 30a-period scale
% a30_coef=realpart(30, :);
% LI_period_plot(Year, a30_coef);
% legend('30a-Period Scale', 'location', 'north');
%
% xlabel('Year/a', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% ylabel('Wavelet Coefficient/dimensionless', 'fontangle', 'italic', 'fontsize', 20, 'fontweight', 'b');
% export_fig 8_30a_coefficient.png
% Close All Figures
close all;
Matlab程序小波分析时间序列数据
4星 · 超过85%的资源 需积分: 44 196 浏览量
2015-08-25
22:26:41
上传
评论 40
收藏 2.03MB RAR 举报
jerlli
- 粉丝: 7
- 资源: 1
- 1
- 2
前往页