Filter optimization for spectral smoothing

6 views (last 30 days)
Nellikin
Nellikin on 26 Mar 2013
I am smoothing FTIR spectra and using a Savitzky-Golay filter. My issue is with the optimization of the filter. I don't know how to pick the ideal windowsize and polynomial degree. I wish to detect and quantify peaks in the spectra, but the peak-widths differ, implying different optimal smoothing windows. How can I optimize these parameters?

Answers (1)

Image Analyst
Image Analyst on 26 Mar 2013
Bigger windows give more smoothing. Lower orders give more smoothing. Why do you want to smooth your spectra? If there is noise, then why don't you just try a few window widths at orders of 2 - 4 and see what looks good? There is no right answer. If you think it looks good, then go ahead and use it. You can use findpeaks() either before or after sgolay() to find the peaks.
  2 Comments
Nellikin
Nellikin on 27 Mar 2013
I realise I can trial and error this, but would prefer not to. I have numerous spectra of soils and wish to optimise this for all spectra to then perform a correlation of various individual peaks to OC content (not PLSR - I wish to analyse individual peaks). Some peaks have windowsizes around 70 datapoints, other can be up to 400 datapoints wide. I would feel happier with an optimal number of points to smooth / polynomial to use based on some objective criteria, not just 'oh well, that looks best'.
Image Analyst
Image Analyst on 27 Mar 2013
All right, then just use a window size of 9 and an order of 3 and go with that.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!