I am looking to detect a combination of frequencies in the frequency domain. For example, here is my spectrum:


And I'm trying to detect the pilot tone. I have the FFT of the pilot tone:


which zoomed in looks like this:


I tried doing a cross-correlation in matlab:

trainingfft = fft(trainingfreq);
datafft = fft(idat);
Hxcorr = dsp.Crosscorrelator;
CorrResult = step(Hxcorr,datafft,trainingfft);

But ended up with this:


I really am looking to detect the presence of the three peaks anywhere in the spectrum. I think the cross correlation isn't working because of the presence of the noise floor, so I was thinking about using some kind of threshold checker to clean up the noise but really am looking for an elegant solution.

Is there an elegant way of doing this?

  • $\begingroup$ Did you try normalized cross correlation, normxcorr2 ? $\endgroup$ Jan 7, 2014 at 9:23
  • $\begingroup$ I'm looking at it now, it seems to be 2D cross-correlation for images? $\endgroup$
    – user1529
    Jan 7, 2014 at 9:25
  • $\begingroup$ Did you make sure that the signals trainingfft and datafft have the same frequency resolution? $\endgroup$
    – Deve
    Jan 7, 2014 at 9:42
  • $\begingroup$ @Deve: It's possible they're not the same resolution, I'm going to put together a test case to check. $\endgroup$
    – user1529
    Jan 7, 2014 at 14:45
  • $\begingroup$ You're visualizing your data in a sort of bizarre way; it makes no sense to plot a logarithmic plot of the amplitudes in the frequency domain when a correlative search is inherently looking at things in a linear (with regard to amplitude) manner. Also, your first plot looks like it has virtually no noise in it at all; the two main peaks are a full 55 dB higher than the noise floor, meaning that when plotted normally, the noise should be virtually invisible. As Deve said, it's crucial that the pilot tone and the spectrum have the same frequency axes, not just the same number of datapoints. $\endgroup$ Jan 17, 2014 at 3:46

1 Answer 1




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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy