필터 지우기
필터 지우기

Baseline removal front fingerprint raman spectra

조회 수: 6 (최근 30일)
Valeria Iazzetta
Valeria Iazzetta 2023년 4월 6일
댓글: Mathieu NOE 2023년 4월 11일
Hi everyone, I have to pre-process this row data from the firgerprint region of the raman spectra. How can I remove the baseline? Hope someone can help me.
Thank you.

채택된 답변

Mathieu NOE
Mathieu NOE 2023년 4월 7일
hello
a simple code based on this FEX submission
load('ramandata.mat')
x = ramandata(:,1);
y = ramandata(:,2);
[Base, Corrected_y]=baseline(y);
figure
plot(x,y,x,Base,x,Corrected_y);
legend('raw','base','corrected');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Base, Corrected_Spectrum]=baseline(Spectrum)
%Input
%-------
%Spectrum: vector of size (N*1)
%Output
%-------
%Base: Identified Baseline vector of size (N*1)
%Corrected_Spectrum: Corrected Spectrum vector of size (N*1)
l=length(Spectrum);
lp=ceil(0.5*l);
initial_Spectrum=[ones(lp,1)*Spectrum(1) ; Spectrum ; ones(lp,1)*Spectrum(l)];
l2=length(initial_Spectrum);
S=initial_Spectrum;
n=1;
flag1=0;
while flag1==0
n=n+2;
i=(n-1)/2;
[Baseline, stripping]=peak_stripping(S,n);
A(i)=trapz(S-Baseline);
Stripped_Spectrum{i}=Baseline;
S=Baseline;
if i>3
if A(i-1)<A(i-2) && A(i-1)<A(i)
i_min=i-1;
flag1=1;
end
end
end
Base=Stripped_Spectrum{i_min};
Corrected_Spectrum=initial_Spectrum-Base; Corrected_Spectrum=Corrected_Spectrum(lp+1:lp+l);
Base=Base(lp+1:lp+l);
end
  댓글 수: 2
Valeria Iazzetta
Valeria Iazzetta 2023년 4월 8일
Thank you very much, it's very useful for me!
Mathieu NOE
Mathieu NOE 2023년 4월 11일
as always, my pleasure !

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by