# MATLAB代做-Tikhonov

### 时间：2018-12-13 13:49:25 点击：

核心提示：Tikhonov ...
% Example computations related to two-dimensional deconvolution.
% Here we apply Tikhonov regularization and the L-curve method
%
% Samuli Siltanen September 2007

% Construct example signal (two-dimensional)
N = 16;
x = zeros(N,N);
x(round(N/4):round(N/2),round(N/4):round(N/2)) = 1;

% Take a look at the signal
figure(1)
clf
imagesc(x)
colormap gray
title('Signal x')
axis square

% Construction of the measurement matrix A
A = oblur(N,3);

% Compute SVD
[U,D,V]   = svd(full(A));
svals     = diag(D);
[row,col] = size(D.');

% Construct ideal and noisy measurements m and mn
m          = A*x(:);
m          = reshape(m,N,N);
noiselevel = .2;
mn         = m + noiselevel*randn(size(m));

% Take a look at the noisy measurement
figure(1)
clf
subplot(1,2,1)
imagesc(x)
colormap gray
title('Signal x')
axis square
axis off
subplot(1,2,2)
imagesc(mn)
colormap gray
title('Measurement')
axis square
axis off

% Vector of regularization parameters
deltavec = 10.^linspace(-7,3,43);

% Loop over regularization parameters and record corresponding norms
Lx_norms   = zeros(size(deltavec));
Ax_m_norms = zeros(size(deltavec));
for iii=1:length(deltavec)
delta = deltavec(iii);
% Reconstruct from noisy data using Tikhonov regularization and delta as
% regularization parameter
Dplusdelta = diag(svals./(svals.^2+delta));
recn       = V*Dplusdelta*U.'*mn(:);
recn       = reshape(recn,N,N);

% Compute norms of the two competing terms in the regularization problem
Lx_norms(iii)   = norm(recn(:));
Ax_m_norms(iii) = norm(A*recn(:)-mn(:));

% Take a look at the reconstruction
figure(3)
clf
subplot(1,2,1)
imagesc(x)
colormap gray
title('Signal x')
axis square
axis off
subplot(1,2,2)
imagesc(recn)
colormap gray
title(['Tikhonov regularization with \delta=', num2str(delta)])
axis square
axis off
pause
end

% Plot the L-curve
figure(3)
clf
plot(log(Ax_m_norms),log(Lx_norms))
title('L-curve analysis','fontsize',16)
xlabel('log ||Ax-m||','fontsize',16)
ylabel('log ||Lx||','fontsize',16)
pause
hold on
% Choose the index of deltavec giving the delta value at the corner of the
% L-curve. Here we do this just visually, not automatically.
best_index = 20;
plot(log(Ax_m_norms(best_index)),log(Lx_norms(best_index)),'r*')
pause

% Compute "Best" reconstruction
delta      = deltavec(best_index);
Dplusdelta = diag(svals./(svals.^2+delta));
recn       = V*Dplusdelta*U.'*mn(:);
recn       = reshape(recn,N,N);
figure(4)
clf
subplot(1,2,1)
imagesc(x)
colormap gray
title('Signal x')
axis square
axis off
subplot(1,2,2)
imagesc(recn)
colormap gray
title(['Tikhonov regularization with \delta=', num2str(delta)])
axis square
axis off

QQ ：1224848052

Tags:TIKHONOV

• 百度搜索