I was doing some basic work recently using an FFT to process real valued data that consists of two tones. The tones always have the same spacing and are never present in the signal together. We can assume the following parameters
- Tone A: 300 Hz
- Tone B: 1300 Hz
- Sample Rate: 44100
My tone spacing is 1000 Hz. I want my FFT to identify the presence of either tone. If I understand correctly the bins of the FFT have a width of 44100/N
where N is the length of the FFT. So if I just set N=128
I have a bin width of 344.5 Hz
. This is reliable enough to identify each tone, since the two tones are at least 5 bins apart.
But this requires each tone to present for at least N*2
, to even have a chance of identifying it uniquely it would seem. I cannot guarantee my sample of my FFT are input "in sync" with whatever is generating the tones. Realistically the number seems to be something more like N*4
for reliable identification.
The obvious solution is to make N smaller, but then the bins with two tones eventually merge. So my thought was why not just analyze the harmonics of the signal? Before doing the frequency-domain analysis, I can just apply a time domain filter to generate the harmonics of the incoming signal. The tone spacing should double at each harmonic.
Before each sample is sent to the FFT, I just multiplied each sample with itself. This generates the second harmonic of the input signals. This has the effect of making the signal DC. This is easy enough to ignore by just removing the top and bottom bins of the FFT from my analysis (I don't think they are useful anyways). Now my tone spacing is doubled, so I can halve N
in my FFT to get the same result. The signal sample rate is still the same.
Obvious drawbacks
- Signal is 100% DC after generating 2nd harmonic
- Signal bandwidth is now
S/4
instead ofS/2
Neither of these seem to be serious drawbacks. Is there some other drawback of pitfall to this approach for analyzing a signal? Am I not actually gaining useful resolution in this process & it just looks like it does?