Page 1 of 1

ploting the baseline

Posted: Mon Jan 27, 2025 12:50 pm
by htuner

Hi,
I am trying to simulate a spectrum using the baseline function during the simulation. My question is: how can I obtain the baseline signal given during esfit or plot it to use elsewhere?

I tried the following code, but it dose not give the same line as esfit.

[B, data] = eprload('SIM54KGY.spc'); % Load spectrum data
plot(B, data, 'k-', 'LineWidth', 1.5, 'DisplayName', 'Original Spectrum'); hold on;

% Perform baseline correction
[spc, baseline] = basecorr(data, 1, 3); % 3rd-order baseline correction

% Plot the baseline
plot(B, baseline, 'r--', 'LineWidth', 1.5, 'DisplayName', '3rd Order Baseline');

Here is the figure I got:
Image

this one is what esfit provide:
Image

Thank you in advance.
hasan


Re: ploting the baseline

Posted: Wed Jan 29, 2025 11:26 pm
by katarkon

You can export the results of the fit into MATLAB workspace.