How to remove outliers from a Raman spectrum

조회 수: 3 (최근 30일)
Gaska
Gaska 2020년 1월 2일
댓글: Gaska 2020년 1월 10일
I have a Raman spectrum looking like the one below and would like to remove the outliers from it. I tried to remove it using e.g. a function "rmoutliers" but it does not seem to work. How to do it?
Thanks a lot for the answer.
RamanSpectrum_MatlabFQ.png
  댓글 수: 1
Gaska
Gaska 2020년 1월 2일
For example, by using the function: rmoutliers I get this (blue: my spectrum; red: spectrum after rmoutliers function)
The code is:
X=lambda;
Y=intensity;
[B,TF] = rmoutliers(Y,'movmedian',X(200),'SamplePoints',X);
figure;
plot(X,Y,'b-',lambda(~TF),B,'r-');
legend('Input Data','Output Data');
RamanSpectrum_MatlabFQ_1.png

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

채택된 답변

Divya Gaddipati
Divya Gaddipati 2020년 1월 8일
You can achieve this using the different methods.
1) Using Basic fitting:
  • Fit a curve using 'polyfit'.
  • Identify outliers that lie outside the tolerance values.
  • Replace the outliers with fitted values.
2) Curve Fitting Toolbox can also be used to remove outliers from your data,
3) You can also use the following MATLAB Central File Exchange submission,
Hope this helps!
  댓글 수: 1
Gaska
Gaska 2020년 1월 10일
Thans a lot for your help!
Best,
Paulina

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by