필터 지우기
필터 지우기

Aligning peaks from multiple shifted data sets

조회 수: 21 (최근 30일)
Thomas
Thomas 2012년 10월 16일
편집: Sotiris Katsikis 2018년 1월 9일
New to Matlab here, but impressed at the speed with which I've been able to accomplish some fairly complex tasks already. Here's one that's got me scratching my head:
I have a lot of data sets (I call them spectra) that each contain two or more noisy peaks. I've included two such spectra in the figure below (I've differentiated between the spectra here by assigning them different colors). The two peaks visible in each spectrum are shifted along the x-axis with respect to the other spectrum due to instrumental drift. I need to:
  • correct for the shift along x so that both of the peaks in all of the spectra are aligned. The shift must be discrete (i.e. no interpolation along x);
  • match the spectra variables for length, sum them, and plot them;
  • automate the procedure for lots and lots of spectra. It also needs to accommodate the fairly noisy peaks (see figure).
Right now, I'm struggling to come up with the most effective way of telling Matlab how to do this. Taking the derivative of the spectra to locate the peak max is not very robust because many of my spectra don't have very nice, well defined maxima. Fitting them with Gaussians is also challenging because each peak is actually the sum of 3 - 4 separate Gaussian distributions, begging the question of which one to use for the alignment. Yet, the algorithm of my brain (comparing their shapes) has no trouble aligning them, so there must be a suitable routine in Matlab for it.

답변 (2개)

Doug Hull
Doug Hull 2012년 10월 16일
I would start with something like this:
I think this is the most challenging part of the problem, the rest can you do if you knew the peaks?

Star Strider
Star Strider 2012년 10월 16일
편집: Star Strider 2012년 10월 16일
I suggest you investigate detrend, and if you have the Signal Processing Toolbox, findpeaks. The nice thing about findpeaks is that you can use the options it has to make it reasonably robust with respect to noise and other problems. If you don't have findpeaks, using max (with two outputs) after using detrend may work for you.
  댓글 수: 1
Sotiris Katsikis
Sotiris Katsikis 2018년 1월 9일
편집: Sotiris Katsikis 2018년 1월 9일
Although 5 years + passed since the question, there are some specialised algorithms/toolkits/routines already published for this purpose. For example icoshift.

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

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by