pdfb_nest.m

来自「contourlet算法作为二阶小波算法的延续」· M 代码 · 共 31 行

M
31
字号
function nstd = pdfb_nest(nrows, ncols, pfilt, dfilt, nlevs)
% PDFB_NEST  Estimate the noise standard deviation in the PDFB domain
%
%   nstd = pdfb_nest(nrows, ncols, pfilt, dfilt, nlevs)
%
% Used for PDFB denoising.  For an additive Gaussian white noise of zero
% mean and sigma standard deviation, the noise standard deviation in the
% PDFB domain (in vector form) is sigma * nstd.

% Number of interations
niter = 10;

% First run to get the size of the PDFB
x = randn(nrows, ncols);
y = pdfbdec(x, pfilt, dfilt, nlevs);
[c, s] = pdfb2vec(y);

nstd = zeros(1, length(c));
nlp = s(1, 3) * s(1, 4);	% number of lowpass coefficients
nstd(nlp+1:end) = nstd(nlp+1:end) + c(nlp+1:end).^2;

for k = 2:niter
    x = randn(nrows, ncols);
    y = pdfbdec(x, pfilt, dfilt, nlevs);
    [c, s] = pdfb2vec(y);
    
    nstd(nlp+1:end) = nstd(nlp+1:end) + c(nlp+1:end).^2;
end

nstd = sqrt(nstd ./ (niter - 1));

⌨️ 快捷键说明

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