Align an NMR spectra to a reference spectrum (cross-correlation)

alignSegment(seg, idx_ref = 1, clim = 0.7, med = TRUE, norm = FALSE)

Arguments

seg

matrix or data frame, NMR submatrix containing segments (spectra in rows)

idx_ref

int, rown index of reference spectrum

clim

num, upper cross-correlation threshold (see Details)

med

logical, use median spectrum as reference?

norm

logical, minmax normalisation for each spectrum prior to alignment? Useful for viz.

Value

Matrix of aligned spectral segments

Details

Spectral alignment is obtained by x-positional shifting a spectral segment. The extend of the shift is determined by maximising the cross-correlation with a refrence segment. The refernce can either be a spectrum in seg or the segment median spectrum (parameter idx_ref is ignored then). Non-matching spectral segments, defined by clim (cross-corrleation upper limit, similarity score) are not aligned.

NA

See also

Author

torben.kimhofer@murdoch.edu.au