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

📄 surfrec.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
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%	Surfrec.m
%%	
%%	First created: 09-20-05
%%	Last modified: 04-13-06
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function Rec = Surfrec(Y, Recinfo)

%   Surfacelet reconstruction
%
%   Input:
%
%   Y: an L+1 by 1 cell array containing the surfacelet coefficients.
%   Y{1} to Y{L} contain bandpass coefficients, with Y{1} corresponds to
%   the finest scale.
%   Y{end} contains the lowpass subband.
%
%   For the i-th scale, Y{i} contains an N by 1 cell
%   array. See NDFBdec.m for details. 

%
%   Recinfo: data structure used in the reconstruction.
%
%   Output:
%      
%   Rec: the reconstructed N-dimensional signal.
%
%   See also Surfdec.m
%

%% If possible, utilize the accelerated mex function.
%% Currently, the mex file is only compiled for Win32.

if (strcmp(computer, 'PCWIN') || strcmp(computer, 'GLNX86') || strcmp(computer, 'MAC'))
    Pyr_mode = Recinfo{1};

    if (Pyr_mode == 1.5)
        Pyr_mode = 15;
    end

    Recinfo = Recinfo{2};

    L = length(Y) - 1;

    Lev_array = cell(L, 1);

    for i = 1 : L
        Lev_array{i} = int32(Recinfo{i}{3});
    end

    bo = Recinfo{1}{5};

    dec_flts = get_cbd_filters_load(bo, 'd');
    rec_flts = get_cbd_filters_load(bo, 'r');

    mSize = Recinfo{1}{6};
    beta = Recinfo{1}{7};
    lambda = Recinfo{1}{8};

    %% call the mex function
    Rec = mexSurfaceletRec(Y, Pyr_mode, Lev_array, dec_flts, rec_flts, mSize, beta, lambda);

    return;
end

disp(' ');
disp('Note: Pure Matlab implementation of the surfacelet transform is currently used.');
disp('Try using the accelerated mex functions instead.');
disp(' ');


Pyr_mode = Recinfo{1};
Recinfo = Recinfo{2};

L = length(Y) - 1;

%% See if we need to perform the dual-tree wavelet transform at coarse
%% scales. (not included in the current implementation)
L_DT = 0; %% levels of decomposition that use the dual-tree decomposition.
for n = 1 : L
    if isscalar(Recinfo{n})
        %% start using the dual-tree wavelet transform
        L_DT = n;
        break;
    end
end

if L_DT ~= 0
    Y = {Y{1:L_DT-1}  DTrec(Y(L_DT : end))} .';
    Recinfo = Recinfo(1 : L_DT - 1);
end

L = length(Y) - 1;

smooth_func = @rcos;

subs = cell(L+1, 1);

for n = L :-1: 1
    if (Recinfo{n}{1} == 'P') & (Recinfo{n}{2} == 'H')
        subs{n} = fftn(Y{n}{1}{1});
    else
        subs{n} = NDFBrec(Y{n}, 'F', Recinfo{n});
    end
    Y{n} = [];
end

subs{L+1} = fftn(Y{L+1});

Rec = PyrNDRec_mm(subs, 'F', Pyr_mode, smooth_func);

%%	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 + -