MATLAB: Spectral or peak alignment

cross correlationpeak alignmentSignal Processing Toolboxspectral alignment

Hello: I have two spectra, Spectrum A and Spectrum B. Spectrum A is the reference spectrum and spectrum B is one I just collected. I'm trying to match spectrum B with the reference spectrum A. However, I realized that the peaks in B are a bit shifted.
My question is how do I correctly align B to the reference A using matlab?
How do I correct for the peak shifts in my spectrum so that they align correctly to the reference spectrum using matlab or any other program or algorithm?
Thank you.

Best Answer

Maybe this will work: https://www.mathworks.com/matlabcentral/fileexchange/15392-shifts-set-of-spectra-to-a-new-maximum-position?s_tid=prof_contriblnk
Related Question