Detecting a frequency pattern in the frequency domain
Try

xcorr(trainingfft,datafft,'option') 


to specified a normalization for the cross-correlation. See the file page for more details of the option.