Deconvolution of two Bragg Curves

4 views (last 30 days)
Tim
Tim on 1 Jan 2025
Commented: Tim on 2 Jan 2025
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 Comment
Image Analyst
Image Analyst on 1 Jan 2025
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:

Sign in to comment.

Accepted Answer

Paul
Paul on 1 Jan 2025
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 Comment
Tim
Tim on 2 Jan 2025
Thanks Paul. That makes sense. I just wonder how others are doing it but that's outside the scope of these forums.

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!