📄 packbasiscoeff.m
字号:
function pkt = PackBasisCoeff(basis,opkt,x)
% PackBasisCoeff -- Stuff basis coefficients into packet table
% Usage
% pkt = PackBasisCoeff(btree,opkt,x)
% Inputs
% btree basis tree selecting basis the coefficients come from
% opkt wavelet or cosine packet table
% x 1-d signal; coefficients in the basis of btree
% Outputs
% pkt new packet table with coefficients in specified
% basis filled in from x
%
% Description
% Fill the packet table coefficients specified
% by the basis tree btree with the contents of x.
%
[n,L] = size(opkt);
pkt = opkt;
% initialize tree traversal stack
dstack = zeros(1,2^L);
bstack = zeros(1,2^L);
% pushdown root
k = 1;
dstack(k) = 0;
bstack(k) = 0;
while(k > 0),
% pop stack
d = dstack(k);
b = bstack(k);
k = k-1;
if(basis(node(d,b)) == 0) ,
% terminal node: extract coeff
pkt(packet(d,b,n),d+1) = x(packet(d,b,n))';
else
% nonterminal node: visit children
k = k+1;
dstack(k) = d+1; bstack(k) = 2*b;
k = k+1;
dstack(k) = d+1; bstack(k) = 2*b+1;
end
end
%
% Copyright (c) 1993. David L. Donoho
%
%% Part of Wavelab Version 850% Built Tue Jan 3 13:20:40 EST 2006% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail wavelab@stat.stanford.edu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -