Spectrometer signal processing.

11 views (last 30 days)
Daniel
Daniel on 2 Dec 2024
Commented: Star Strider on 5 Feb 2025 at 12:23
Hi guys,
I got my spectrometer data in this format save as a notepad file:
I would like to covnert time on the graph strat from 0 seconds and dont know how to covvert that.
Units_11:211
1729167932375 13:25:32.375 405650.13
1729167932475 13:25:32.475 400621.04
1729167932575 13:25:32.575 398764.17
1729167932675 13:25:32.675 400905.63
1729167932775 13:25:32.775 400606.19
1729167932875 13:25:32.875 400141.29
Can someone help me with that? Thank you

Accepted Answer

Star Strider
Star Strider on 2 Dec 2024
One approach —
Data = {1729167932375 '13:25:32.375' 405650.13
1729167932475 '13:25:32.475' 400621.04
1729167932575 '13:25:32.575' 398764.17
1729167932675 '13:25:32.675' 400905.63
1729167932775 '13:25:32.775' 400606.19
1729167932875 '13:25:32.875' 400141.29};
T1 = cell2table(Data);
Time = datetime(T1{:,2}, InputFormat='HH:mm:ss.SSS', Format='HH:mm:ss.SSS');
ElapsedTime = seconds(Time - Time(1));
T1 = removevars(T1,2);
T1 = addvars(T1, ElapsedTime, 'Before',2)
T1 = 6x3 table
Data1 ElapsedTime Data3 __________ ___________ __________ 1.7292e+12 0 4.0565e+05 1.7292e+12 0.1 4.0062e+05 1.7292e+12 0.2 3.9876e+05 1.7292e+12 0.3 4.0091e+05 1.7292e+12 0.4 4.0061e+05 1.7292e+12 0.5 4.0014e+05
figure
plot(T1{:,2}, T1{:,3})
grid
title('Spectrometer Plot')
I suspect that you will import your file (not provided) with readtable. This approach should work with it.
.
  16 Comments
Daniel
Daniel on 5 Feb 2025 at 10:32
Great, thank you for your answer and brief explanation. I really appreciate it!
Star Strider
Star Strider on 5 Feb 2025 at 12:23
As always, my pleasure!

Sign in to comment.

More Answers (1)

Daniel
Daniel on 5 Feb 2025 at 10:30
Great, thank you for your answer and brief explanation. I really appreciate it!

Community Treasure Hunt

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

Start Hunting!