Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[931198]: wavelets / private / nodeFiltUps.m Maximize Restore History

Download this file

nodeFiltUps.m    32 lines (30 with data), 968 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function upsNo = nodeFiltUps(nodeNo,wt)
%NODEFILTUPS Node upsamplig factor
% Usage: upsNo = nodeFiltUps(nodeNo,wt)
%
% Input parameters:
% wt : Structure containing description of the filter tree.
%
% Output parameters:
% upsNo : Accumulated upsampling factor along path to root.
%
% `nodeFiltUps(wt)` Returns upsampling factor, which can be used to
% upsample the node filters using the a-trous algorithm.
% For definition of the structure see |wfbinit|.
%
% See also: wfbtinit
%
if(any(nodeNo>numel(wt.nodes)))
error('%s: Invalid node index range. Number of nodes is %d.\n',upper(mfilename),numel(wt.nodes));
end
nodesCount = numel(nodeNo);
upsNo = zeros(nodesCount,1);
for ii=1:nodesCount
tmpNodeNo = nodeNo(ii);
upsNo(ii) = 1;
while(wt.parents(tmpNodeNo))
parentNo = wt.parents(tmpNodeNo);
upsNo(ii)=upsNo(ii)*wt.nodes{parentNo}.a(wt.children{parentNo}==tmpNodeNo);
tmpNodeNo=parentNo;
end
end