Deconvolution of two Bragg Curves

4 次查看(过去 30 天)
Hi all and happy new year.
I have two Bragg curves I'm trying to deconvolve. I expect the result to be a left-skewed Gaussian. But I'm getting nothing. Code is below and data files attached. VarName2 is the second column of 100_0.0_100k-Experiment-2-Analysis_waterBlock_EnergyLoss.csv and and e05 is the second column of 100_5.0_100k-Experiment-2-Analysis_waterBlock_EnergyLoss.csv
I have had success with a similar example and I can't figure out what I'm doing wrong in this example.
Regards
Tim
h = VarName2/max(VarName2);
figure;
plot(h);
title("100 MeV Pristine Bragg Peak")
grid on;
y = e05/max(e05);
figure
plot(y)
title("100 Mev 5 per cent energy spread")
grid on;
[x,r] = deconv(y, h, Method="least-squares");
figure
plot(x)
title("Deconvolved Signal Using ""least-squares"" Method")
grid on;
  1 个评论
Image Analyst
Image Analyst 2025-1-1
Make it easy for us to help you. Please supply the rest of the code (like where you read in the data and create the variables) and show the plots.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

请先登录,再进行评论。

采纳的回答

Paul
Paul 2025-1-1
D = dir;
D(3).name
ans = '100_0.0_100k-E...nergyLoss.csv'
T1 = readtable(D(3).name);
T1.Properties.VariableNames
ans = 1x3 cell array
{'Var1'} {'Var2'} {'Var3'}
VarName2 = T1.Var2;
D(4).name
ans = '100_5.0_100k-E...nergyLoss.csv'
T2 = readtable(D(4).name);
T2.Properties.VariableNames
ans = 1x3 cell array
{'Var1'} {'Var2'} {'Var3'}
e05 = T2.Var2;
h = VarName2/max(VarName2);
y = e05/max(e05);
h and y have the same number of elements
[numel(h), numel(y)]
ans = 1×2
512 512
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
which means that x will be scalar.
[x,r] = deconv(y, h, Method="least-squares");
x
x = 1.2806
  1 个评论
Tim
Tim 2025-1-2
Thanks Paul. That makes sense. I just wonder how others are doing it but that's outside the scope of these forums.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by