?? plot_modwt_coef.m
字號:
function [hWplotAxes, hXplotAxes] = plot_modwt_coef(WJt, VJ0t, X, w_att, ... title_str, xaxis, xlabel_str, ... WplotAxesProp, XplotAxesProp, ... J0, level_range, plotOpts, ... masterPlotFrame, xaxis_range, scale_str)% plot_modwt_coef -- Plot the MODWT wavelet and scaling coefficients and the original time series.%%****f* wmtsa.dwt/plot_modwt_coef%% NAME% plot_modwt_coef -- Plot the MODWT wavelet and scaling coefficients and the% original time series.%% SYNOPSIS% [hWplotAxes, hXplotAxes] = plot_modwt_coef(WJt, VJ0t, [X], w_att, ... % [title_str], [xaxis], [xlabel_str], ...% [WplotAxesProp], [XplotAxesProp], ...% [J0], [level_range], [plotOpts], ...% [masterPlotFrame], [xaxis_range], [scale_str])% [hWplotAxes, hXplotAxes] = plot_modwt_coef(WJt, [], [X], w_att, ...% [title_str], [xaxis], [xlabel_str], ...% [WplotAxesProp], [XplotAxesProp], ...% [J0], [level_range], [plotOpts], ...% [masterPlotFrame], [xaxis_range], [scale_str])% [hWplotAxes, hXplotAxes] = plot_modwt_coef([], VJ0t, [X], w_att, ...% [title_str], [xaxis], [xlabel_str], ...% [WplotAxesProp], [XplotAxesProp], ...% [J0], [level_range], [plotOpts], ...% [masterPlotFrame], [xaxis_range], [scale_str])%% INPUTS% WJt = NxJ array of MODWT wavelet coefficents% where N = number of time intervals,% J = number of levels% VJ0t = Nx1 vector of MODWT scaling coefficients at level J0.% X = (optional) vector of observations of size N.% * w_att -- MODWT transform attributes (struct).% title_str = (optional) character string or cell array of strings containing title of plot.% xaxis = (optional) vector of values to use for plotting x-axis.% xlabel_str = (optional) character string or cell array of strings containing label x-axis.% WplotAxesProp = (optional) structure containing axes property values to% override for W subplot.% XplotAxesProp = (optional) structure containing axes property values to% override for X subplot.% J0 = (optional) override value of J0, if J ~= J0 or% if max(level_range) ~= J0.% level_range = (optional) number or range of numbers indicating subset of% levels (j's) to plot.% plotOpts = (optional) structure containing plot options.% masterPlotFrame = (optional) structure containing coordinates to % place X and W plots.% xaxis_range = (optional) range of xaxis values to plot.% scale_str = (optional) character cell array of strings containing% physcial scale values of levels to label left y-axis of W plot.%% OUTPUTS% hWplotAxes = (optional) handle to axes for MODWT coefficients (W) subplot.% hXplotAxes = (optional) handle to axes for original data series (X) subplot.%% SIDE EFFECTS% 1. If plotting VJ0t, without WJt (i.e. WJt = []), must specify a value for% J0; otherwise error.% 2. If a level_range is specified, must provide a value for J0; otherwise% error.% 3. Either WJt or VJ0t, or both WJt and VJ0t may be specified'; otherwise% error.%% DESCRIPTION% plot_modwt_coef plots the MODWT coefficients and optionally the original% data series. Either or both the MODWT wavelet and scaling coefficients% may be plotted (aka Wplot). The orignal time series is tagged the Xplot.% The MODWT coefficients are circularly shifted at each level so as to % properly align the coefficients with the original data series.%% By default, the wavelet coefficients (WJt) and scaling coefficient at% level J0 (VJ0t) are plotted. A subrange of wavelet coefficient levels% may be specified by via the parameter, level_range = [lower:upper]%% By default, the boundaries demarcing the circularly shifted MODWT% coefficients influenced by the circularity conditions are plot. % Plotting of the boundaries may be toggled off.% % By default, the mean value of VJ0t is subtracted from VJ0t, so that% when plotting a data series with large mean offsets, the VJ0t level% does not dominate the Wplot.%% Defaults for plotOpts:% plotOpts.PlotMODWTBoundary = 1;% plotOpts.PlotWJt = 1;% plotOpts.PlotVJ0t = 1;% plotOpts.PlotX = 1;% plotOpts.SubtractMeanVJ0t = 1;%% EXAMPLE% [WJt, VJ0t] = modwt(X, 'la8', 10, 'reflection');% plot_modwt_coef(WJt, VJ0t, X, 'la8');%% NOTES%%% BUGS% 1. MODWT Boundary lines do not draw across Y-axis range for values of VJ0t% with large offsets (means).%% REFERENCES% See figure 183 of WMTSA.%% SEE ALSO% modwt, modwt_filter, overplot_modwt_cir_shift_coef_bdry,% multi_yoffset_plot%% AUTHOR% Charlie Cornish%% CREATION DATE% 2003/05/01%% COPYRIGHT%%% CREDITS%%% REVISION% $Revision: 612 $%%***% $Id: plot_modwt_coef.m 612 2005-10-28 21:42:24Z ccornish $% Initialize constants and other parametersylabel_xoffset = .015;% Master Plot Frame - contains all subplotdefault_masterPlotFrame.left = .15;default_masterPlotFrame.bottom = .11;default_masterPlotFrame.width = .775;default_masterPlotFrame.height = .805;default_masterPlotFrame.subplot_yspacing = .010;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Check Input Arguments%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%usage_str = ['Usage: [hWplotAxes, hXplotAxes] = ', mfilename, ... '(WJt, VJ0t, [X], w_att' ... ', [title_str], [xaxis], [xaxis_label]', ... ', [WplotAxesProp], [XplotAxesProp]' ... ', [J0], [level_range], [plotOpts], ', ... ', [masterPlotFrame], [xaxis_range], [scale_str])'];%% Check input arguments and set defaults.error(nargerr(mfilename, nargin, [1:15], nargout, [0:2], 1, usage_str, 'struct'));if (~exist('w_att', 'var') || isempty(w_att) ) error('Must specify the MODWT attribute structure.');end wtfname = w_att.WTF;NX = w_att.NX;N = NX;NW = w_att.NW;J0 = w_att.J0;boundary = w_att.Boundary;%% Get a valid wavelet transform filter coefficients struct.if (ischar(wtfname)) try [wtf_s] = modwt_filter(wtfname); catch rethrow(lasterror); endelse error('WMTSA:invalidWaveletTransformFilter', ... encode_errmsg('WMTSA:invalidWaveletTransformFilter', wmtsa_err_table, 'wtf'));end wtfname = wtf_s.Name;gt = wtf_s.g;ht = wtf_s.h;% Initialize and set the plot optionsplot_WJt = 0;plot_VJ0t = 0;plot_X = 0;plot_modwt_boundary = 1;subtract_mean_VJ0t = 1;if (exist('WJt', 'var') && ~isempty(WJt) ) plot_WJt = 1;end if (exist('VJ0t', 'var') && ~isempty(VJ0t) ) plot_VJ0t = 1;endif (exist('X', 'var') && ~isempty(X) ) plot_X = 1;endif (~exist('plotOpts', 'var')) plotOpts = [];endif (isfield(plotOpts, 'PlotWJt')) if (plotOpts.PlotWJt) plot_WJt = 1; else plot_WJt = 0; endendif (isfield(plotOpts, 'PlotVJ0t')) if (plotOpts.PlotVJ0t) plot_VJ0t = 1; else plot_VJ0t = 0; endendif (isfield(plotOpts, 'PlotX')) if (plotOpts.PlotX) plot_X = 1; else plot_X = 0; endend%%% if (plot_WJt == 0 && plot_VJ0t == 0)%%% error('Must specify either WJt or VJ0t, or both for plotting');%%% endif (isfield(plotOpts, 'PlotMODWTBoundary')) if (plotOpts.PlotMODWTBoundary) plot_modwt_boundary = 1; else plot_modwt_boundary = 0; end endif (isfield(plotOpts, 'SubtractMeanVJ0t')) if (plotOpts.SubtractMeanVJ0t) subtract_mean_VJ0t = 1; else subtract_mean_VJ0t = 0; end endif (~exist('level_range', 'var') || isempty(level_range)) level_range = [];else error(argterr(mfilename, level_range, 'posint', [], 1, '', 'struct'));end% Initialized and override masterPlotFrameif (~exist('masterPlotFrame', 'var') || isempty(masterPlotFrame)) masterPlotFrame = default_masterPlotFrame;else if (~isfield(masterPlotFrame, 'left')) masterPlotFrame.left = default_masterPlotFrame.left; end if (~isfield(masterPlotFrame, 'bottom')) masterPlotFrame.bottom = default_masterPlotFrame.bottom; end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -