# gregfreeman/matlabPyrTools

Switch branches/tags
Nothing to show
Fetching contributors…
Cannot retrieve contributors at this time
executable file 74 lines (54 sloc) 2.14 KB
 % [PYR, INDICES] = buildSCFpyrLevs(LODFT, LOGRAD, XRCOS, YRCOS, ANGLE, HEIGHT, NBANDS) % % Recursive function for constructing levels of a steerable pyramid. This % is called by buildSCFpyr, and is not usually called directly. % Original code: Eero Simoncelli, 5/97. % Modified by Javier Portilla to generate complex bands in 9/97. function [pyr,pind] = buildSCFpyrLevs(lodft,log_rad,Xrcos,Yrcos,angle,ht,nbands); if (ht <= 0) lo0 = ifft2(ifftshift(lodft)); pyr = real(lo0(:)); pind = size(lo0); else bands = zeros(prod(size(lodft)), nbands); bind = zeros(nbands,2); % log_rad = log_rad + 1; Xrcos = Xrcos - log2(2); % shift origin of lut by 1 octave. lutsize = 1024; Xcosn = pi*[-(2*lutsize+1):(lutsize+1)]/lutsize; % [-2*pi:pi] order = nbands-1; %% divide by sqrt(sum_(n=0)^(N-1) cos(pi*n/N)^(2(N-1)) ) %% Thanks to Patrick Teo for writing this out :) const = (2^(2*order))*(factorial(order)^2)/(nbands*factorial(2*order)); % % Ycosn = sqrt(const) * (cos(Xcosn)).^order; % % analityc version: only take one lobe alfa= mod(pi+Xcosn,2*pi)-pi; Ycosn = 2*sqrt(const) * (cos(Xcosn).^order) .* (abs(alfa)