1 function y = sfb3D(lo, hi, sf1, sf2, sf3)
3 % 3D Synthesis Filter Bank
6 % y = sfb3D(lo, hi, sf1, sf2, sf3);
8 % lo, hi - lowpass subbands
9 % sfi - synthesis filters for dimension i
14 % WAVELET SOFTWARE AT POLYTECHNIC UNIVERSITY, BROOKLYN, NY
15 % http://taco.poly.edu/WaveletSoftware/
31 % filter along dimension 3
32 LL = sfb3D_A(LLL, LLH, sf3, 3);
33 LH = sfb3D_A(LHL, LHH, sf3, 3);
34 HL = sfb3D_A(HLL, HLH, sf3, 3);
35 HH = sfb3D_A(HHL, HHH, sf3, 3);
37 % filter along dimension 3
38 L = sfb3D_A(LL, LH, sf2, 2);
39 H = sfb3D_A(HL, HH, sf2, 2);
41 % filter along dimension 1
42 y = sfb3D_A(L, H, sf1, 1);
47 function y = sfb3D_A(lo, hi, sf, d)
49 % 3D Synthesis Filter Bank
50 % (along single dimension only)
52 % y = sfb3D_A(lo, hi, sf, d);
53 % sf - synthesis filters
54 % d - dimension of filtering
57 lpf = sf(:, 1); % lowpass filter
58 hpf = sf(:, 2); % highpass filter
60 % permute dimensions of lo and hi so that dimension d is first.
61 p = mod(d-1+[0:2], 3) + 1;
65 [N1, N2, N3] = size(lo);
68 y = zeros(N+L-2, N2, N3);
71 y(:, :, k) = upfirdn(lo(:, :, k), lpf, 2, 1) + upfirdn(hi(:, :, k), hpf, 2, 1);
73 y(1:L-2, :, :) = y(1:L-2, :, :) + y(N+[1:L-2], :, :);
75 y = cshift3D(y, 1-L/2, 1);
77 % permute dimensions of y (inverse permutation)