⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ndfbrec.m

📁 A set of C++ and Matlab routines implementing the surfacelet transform surfacelet的一个非常好用的工具箱
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%	SurfBox-MATLAB (c)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%	Yue Lu and Minh N. Do
%%
%%	Department of Electrical and Computer Engineering
%%	Coordinated Science Laboratory
%%	University of Illinois at Urbana-Champaign
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%	NDFBrec.m
%%	
%%	First created: 04-20-05
%%	Last modified: 04-13-06
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function Rec = NDFBrec(Y, OutD, Recinfo)

%   NXDFB reconstruction
%
%   Y: N by 1 cell array. The k-th cell contains the subbands from
%   the k-th hourglass branch.
%
%   OutD: "S" if we want the output to be a usual signal in the spatial "F" if
%   we are want it to be in the Fourier domain. 
%   We use this to get rid of the unnecessary (and time-consuming)
%   "ifftn-fftn" operations in the middle steps.
%
%   Recinfo = {InD, InF, Level, HGfname, bo, msize, beta, lambda ...}
%
%   InD: "S" if the input is a usual signal in the spatial domain; "F" if
%   we are given the Fourier transform of the input. 
%   We use this to get rid of the unnecessary (and time-consuming)
%   "ifftn-fftn" operations in the middle steps.
%
%   InF: input data format. "B" (box) for a multidimensional array input; "C"
%   for a cell array input, with each cell containing one subband.
%
%   Level: an N by N matrix. The k-th row vector specifies the
%   subsequent decomposition levels for the k-th hourglass subband. The
%   individual elements of Level must be great than or equal to 0, except
%   the diagonal elements, which should be -1.
%
%   - HGfname: filter name for the hourglass filter bank. Supported types are
%     - 'ritf': rotational-invariant tight frame
%
%   - 'bo': the order of the checkerboard filters. Default: bo = 12
%   
%   - 'msize': size of the mapping kernel. This controls the quality of the
%   hourglass filters. Default = 15;
%   
%   - 'beta': beta value of the Kaiser window. This controls the quality of
%   the hourglass filters. Default = 2.5;
%
%   - 'lambda': the parameter lambda used in the hourglass filter design
%
%   Rec: the reconstructed N-dimensional signal.
%
%   See also NDFBdec.m
%


%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Preparation          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Get parameters

InD = Recinfo{1};
InF = Recinfo{2};
Level = Recinfo{3};
HGfname = Recinfo{4};
bo = Recinfo{5};
msize = Recinfo{6};
beta = Recinfo{7};
lambda = Recinfo{8};


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Signal Processing Part %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Dimension of the signal X
N = length(Level);
Subs = cell(N, 1);

%% get the reconstruction checkerboard filters
Gflt = get_cbd_filters_load(bo, 'r');

%% IRC reconstruction at pairs of dimensions
for k = 1 : N
    
    subband = Y{k};
    
    %% Convert the input to 'F' (Fourier) domain and 'B' (box) format
    if InD == 'F'
        if InF == 'C'
            %% just change the data format from 'Cell' to 'Box' array.
            subband = cell2box(subband, Level(k, :));
        else
            %% the easiest case: do nothing.
        end
    else
        %% First change the data format from 'Box' to 'Cell' array.
        if InF == 'B'
            subband = box2cell(subband, Level(k, :));
        end
        
        %% Take the fft and then remove the redundant part
        for n = 1 : length(subband)
            subband{n} = ccsym(fftn(subband{n}), k, 'c');
        end
        
        %% Then go back to the box format
        subband = cell2box(subband, Level(k, :));
    end
    
    %% Iteratively Resampled Checkerboard Filter Bank
    subband = IRCrecF(subband, k, Level(k,:), Gflt);
    
    Subs{k} = subband;

end

%% Last level: undecimated hourglass filter bank
Rec = HourGlassRec(Subs, 'F', OutD, HGfname, msize, beta, lambda);


%%	This software is provided "as-is", without any express or implied
%%	warranty. In no event will the authors be held liable for any 
%%	damages arising from the use of this software.   
        
        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -