icoshift - An ultra rapid and versatile tool for the alignment of spectral datasets


The icoshift tool for Matlab presented here is an open source and highly efficient program specifically designed for solving signal alignment problems in metabonomic NMR data analysis, but it can also properly deal with other spectra-like datasets (e.g. data from other spectroscopic methods or chromatographic data). The icoshift algorithm is based on COrrelation SHIFTing of spectral Intervals and employs an FFT engine that aligns all spectra simultaneously. The algorithm is demonstrated to be faster than similar methods found in the literature making full-resolution alignment of large datasets feasible and thus avoiding down-sampling steps such as binning. The algorithm can use missing values (NaN) as a filling alternative in order to avoid spectral artifacts at the segment boundaries. An exhaustive help is provided along with the algorithm as well as a demo working on a real NMR dataset.

  • icoshift (ver 0.9 - stable, with demo)
  • icoshift (ver 1.1.1 - stable, with improved demo)
  • icoshift (ver 1.2.3 - stable, with new 'average2' target, for Matlab releases below 2013b)
  • icoshift (ver 1.3.2 - stable, compatible with Matlab 2014b)

V1.2 introduces 'average2' as a new automatic target for the alignment process. Often the mean spectrum/chromatogram is not nicely shaped for a good alignment but can slightly improve it in a way that a subsequent mean target, obtained from the roughly aligned matrix, can be a more efficient reference for aligning the raw data matrix. Furthermore the user is asked a value to be used as a multiplier for enhancing the calculated target for a better visual inspection of its shape. 
It is also made independent from the Statistical Toolbox

V1.3 makes icoshift compatible with the new graphics handling introduced with Matlab 2014b (V. 8.4.0) 


If you use the icoshift tool for MATLAB we would appreciate a reference to the following papers:

F. Savorani, G. Tomasi, S.B. Engelsen, icoshift: A versatile tool for the rapid alignment of 1D NMR spectra, J. Magn. Reson. (2010) 202: 190-202, doi:10.1016/j.jmr.2009.11.012


G. Tomasi, F. Savorani, S.B. Engelsen, icoshift: An effective tool for the alignment of chromatographic data, J. Chromatogr. A (2011) 1218(43):7832-7840, doi: 10.1016/j.chroma.2011.08.086


F. Savorani, G. Tomasi, S.B. Engelsen, Alignment of 1D NMR Data using the iCoshift Tool: A TutorialIn Magnetic Resonance in Food Science: Food for Thought, (2013), pp 14-24doi:10.1039/9781849737531-00014




icoshift works under Matlab ® version 7.x and following



If you have any questions, suggestions or comments please feel free to contact us at frsa.at.food.ku.dk or se.at.food.ku.dk 


Version history:
V 0.1 - 17 May 2008: First working code based on co-shift (traditional cross-correlation engine)
V 0.2 - 11 November 2008: Automatic Splitting into regular intervals implemented
V 0.5 - 14 November 2008: FFT alignment engine implemented
V 0.6 - 24 November 2008: Automatic search for the best or the fastest allowed shift (n) for each interval
V 0.7 - 26 November 2008: Plot features improved
V 0.8 - 05 March 2009: Implementation of missing values (NaN) for interpolation
V 0.9 - 06 June 2009: Original published algorithm
V 1.0 - 15 December 2009: Implementation of user’s intervals defined in ppm + improved demo and help
V 1.1 - 15 November 2010: Option 'Max' works now also for alignment towards a reference signal
V 1.1.1 - 31 March 2011: Bugfix for the 'whole' case when mP<101
V 1.2 - 03 July 2012: 
Introducing the 'average2' xT (target) for a better automatic target definition.
V 1.3 - 09 October 2014: Compatibility with Matlab 2014b new graphics handling system. Independent from Statistical Toolbox
V 1.3.2 and 1.2.3 are just minor bug fixes of the previous two versions, one working with Matlab 2014 and above and the other with 2013 and below