📄 plotcoeff.m
字号:
function PlotCoeff(c, n, NameOfDict, par1, par2, par3, Scale)
% PlotCoeff -- Display Coefficients for representation in various
% dictionaries
% Usage
% PlotCoeff(c, n, NameOfDict, par1, par2, par3[, Scale])
% Inputs
% c coefficients; column vector
% NameOfDict string; name of the dictionary
% par1,par2,par3 parameters of the dictionary
% Scale scale for multi-scale display
%
% Use 'help dictionary' for dictionary objects: NameOfDict,par1,par2,par3
% Description
%
%
[m L ] = SizeOfDict(n, NameOfDict, par1, par2, par3);
if strcmp(NameOfDict, 'DIRAC'),
t = (1:n)' / n;
plot(t, c);
xlabel('Time')
title('Discrete Dirac Coeff')
elseif strcmp(NameOfDict, 'DCT'),
f = (0:(m-1))' / m;
plot(f, c);
xlabel('Frequency/Nyquist')
title('Discrete Cosine Coeff')
elseif strcmp(NameOfDict, 'DST'),
f = (0:(m-1))' / m;
plot(f, c);
xlabel('Frequency/Nyquist')
title('Discrete Sine Coeff')
elseif strcmp(NameOfDict, 'PO') | strcmp(NameOfDict, 'PBS'),
if nargin < 7,
Scale = 0;
end
PlotWaveCoeff(c, par1, Scale);
elseif strcmp(NameOfDict, 'STAT') | strcmp(NameOfDict, 'SP'),
%Multi-Scale Display from the coarsest level to the finest level
if nargin < 7,
Scale = 0;
end
pkt = reshape(c, n, L);
PlotStatTable(pkt, Scale);
xlabel('Time'); ylabel('log(resolution)');
if strcmp(NameOfDict, 'STAT')
title('Stationary Wavelet Coeff');
else
title('Spline Coeff');
end
elseif strcmp(NameOfDict, 'WP') | strcmp(NameOfDict, 'CP'),
if nargin < 7,
Scale = 0;
end
pkt = reshape(c, n, L);
PlotPacketTable(pkt, Scale);
if strcmp(NameOfDict, 'WP'),
title('Wavelet Packets Coeff');
else
title('Cosine Packets Coeff');
end
elseif strcmp(NameOfDict, 'MDC'),
if nargin < 7,
Scale = .5 ./ max(abs(c));
end
D = par1;
pkt = reshape(c, n*par2, par1+1);
LockAxes([0 1 (-D-1) (1)]);
N = n * par2;
t =( .5:(N-.5)) ./N;
tt = zeros(1,3*N+2);
nxx = length(tt);
tt(1) = 0; tt(nxx)=1;
tt(2:3:nxx-3) = t;
tt(3:3:nxx-2) = t;
tt(4:3:nxx-1) = t;
xx = ones(size(tt));
for d=0:D
xx = xx-1;
xx(3:3:(nxx-2)) = -d + pkt(:,d+1) .* Scale;
plot(tt, xx);
end
UnlockAxes;
%
xlabel('Frequency/Nyquist'); ylabel('log(DecayingSpeed)');
title('Multi-Duration Cosine Coeff');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -