Deconvolution of a polynomial and exponential function

조회 수: 12 (최근 30일)
larry liu
larry liu 2022년 3월 11일
댓글: yicong 2024년 9월 6일
I got the same problem with following link:
I got trouble using Bayesian deconvolution
here I already got wt(z) and a'(z) with same one dimension size array
I have no idea how to got iterative.
If need my data, I will give my data. thanks a lot ><
  댓글 수: 4
高飞 支
高飞 支 2023년 12월 17일
이동: John D'Errico 2023년 12월 17일
I have the same trouble have you solved it?can you give me some advices?
Rui
Rui 2024년 8월 6일
hello, larry liu
i am doing the same work as you did, did u use the Bayes iteration that you showed in the picture? cuz i try to deal with time constant in this way. It doesn't work..

댓글을 달려면 로그인하십시오.

답변 (1개)

Yash
Yash 2023년 11월 24일
편집: Yash 2023년 11월 24일
Hi Larry,
I understand that you are facing issues while using the "deconv" function in MATLAB. "deconv(y,h)" deconvolves a vector "h" out of a vector "y" using polynomial long division, and returns the quotient "x" and remainder "r" such that "y = conv(x,h) + r".
Given that you already have a deconvolution function in your case, you may not need to use the "deconv" function. Instead, you can make an initial guess for "R(z)" and then obtain the approximation iteratively using a loop as follows:
n = length(df2);
w = Wzinstead';
a = df2';
R = randi(1000,n,1)/1000; % Initial guess, random values
nIter = 10;
for i=1:1:nIter
R1=R*(corr(w, a./(conv(w,R,'same'))));
R=R1;
end
Hope this helps you address the issue.
  댓글 수: 1
yicong
yicong 2024년 9월 6일
% Define initial parameters
R1 = 6.3;
R2 = 6.3;
R3 = 6.3;
tau1 = 1e-5;
tau2 = 1e-2;
tau3 = 1e1;
% Define the time range
t_min = 1e-6;
t_max = 1e2;
% Calculate the number of interpolation points
num_points_per_decade = 20;
num_decades = log10(t_max) - log10(t_min);
num_points = round(num_points_per_decade * num_decades);
% Generate logarithmically spaced time points
t_interp = logspace(log10(t_min), log10(t_max), num_points);
z_interp = log(t_interp);
% Calculate the analytical model a(t)
a_t = R1 * (1 - exp(-exp(log(t_interp))/tau1)) + ...
R2 * (1 - exp(-exp(log(t_interp))/tau2)) + ...
R3 * (1 - exp(-exp(log(t_interp))/tau3));
% Use gradient to compute da/dz
da_dz = gradient(a_t, z_interp);
% Define W(z) = exp(z - exp(z))
W_z = exp(z_interp - exp(z_interp));
% Uncomment to normalize each column of W_z
% for l = 1:num_points
% W_z(:, l) = W_z(:, l) / sum(W_z(:, l)); % Normalize each column
% end
max_iterations = 100; % Maximum number of iterations
tolerance = 1e-6; % Convergence threshold
% Initialize Psi(z) with da/dz
Psi_z = da_dz';
w=W_z';
a=da_dz';
% Iterative correction
for iter = 1:1:max_iterations
R1=Psi_z*(corr(w, a./(conv(w,Psi_z,'same'))));
Psi_z=R1;
end
% Plot the results
figure;
subplot(3,1,1);
plot(z_interp, da_dz);
title('da/dz vs z');
xlabel('z');
ylabel('da/dz');
subplot(3,1,2);
plot(z_interp, W_z);
title('W(z)');
xlabel('z');
ylabel('W(z)');
subplot(3,1,3);
plot(z_interp, Psi_z);
title('\Psi(z) after Van Cittert Deconvolution');
xlabel('z');
ylabel('\Psi(z)');
-----------
I apply your code here while get wrong time constant result.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by