Reputation: 11
I need to identify the prek frequency contineously. I've tried FFT
and JTransform
But i didn't get correct frequency and it has lots of noise. I don't know how to rectify that.I've searched on google, unfortunately i didn't find proper one.
So if you have any other working example determining peak frequency.
Please share with us,
Thank you.
Upvotes: 1
Views: 820
Reputation: 949
I'm still not sure what your input signal is, or how you know that you're getting the wrong peak frequencies from your Fourier analysis and/or from your peak detector.
In general, to test your FFT you'll want a synthetic pure tone, such as this 32 Hz cosine tone.
When you process this pure tone with your FFT you should get a single peak at 32 Hz like this:
To test your peak detection code, you'll want to attenuate your 32 Hz tone to say half power, and add another full power pure tone at say 64 Hz, like this:
When you process these two harmonics with the FFT you should get two peaks at 32 and 64 Hz, and the 32 Hz peak should be at half power relative to the 64 Hz peak.
After your code is working fine with the above synthetic signals, you should try a real known signal such as this single E2 note being plucked on an acoustic guitar:
The FFT spectrum of this E2 note signal looks like this:
With this real signal, your peak power detector should find the 161 Hz peak, which for this signal happens to be the first harmonic of the E2 note. The lower-power peak at 80 Hz is the true fundamental frequency of the E2 note.
Synthetic signals and real signals can be generated with the Sooeet FFT calculator
Upvotes: 1