If you're only trying to distinguish between those two frequencies then a plain old IIR bandpass filter would probably be appropriate.
If you're only trying to distinguish between those two frequencies then a plain old IIR bandpass filter would probably be appropriate.
-- Tim Wescott Wescott Design Services http://www.wescottdesign.com
It depends on what you're doing.
If the signal has no noise and well-defined zero crossings, just measuring the period will tell you whether you've got 499.9Hz or 500Hz in a single cycle. (Or half-cycle if you guarantee a square wave).
If other frequencies are present and/or noise etc., but you still have to measure the amplitudes at a small number of frequencies (your example named two, other applications like DTMF might have 8), then IIR bandpass filters work nicely and you don't have to do Fourier at all.
Fourier is nice and all that if you really need to know amplitude and phase for each and every bin, but most applications simply don't need anything like that and are easily satisfied with a miniscule amount of computational horsepower.
Tim.
Wavelet?
-- Best Regards, Mike
There was this alternative to the FFT being mentioned a few months ago. It was to be continous in time and not blockwise. As I remember, it was said to be advantageous in cases where 499.9Hz and 500Hz are to be resolved. I lost the reference to it, a name would be sufficient.
Rene
-- Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net
The Goertzel algorithm perhaps?
-- Rich Webb Norfolk, VA
wavelets.
-- Many thanks, Don Lancaster Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552 voice: (928)428-4073 email: don@tinaja.com Please visit my GURU's LAIR web site at http://www.tinaja.com
Yes, the Goertzel algoorthim. Can be used for DTMF decoding, if thats what the OP had in mind. An issue of Embedded Systems had a great article on it.
Cheers
The Maximum Entropy method? Lomb periodogram? (Just wild guesses).
Regards, Mikko
I don't remember the thread, but depending on what you are doing, you might be able to just use a PLL. Jumps in the error voltage would correspond to jumps in the signal frequency. If the jumps happen often enough, and if the signal is guaranteed to spend equal time at the two different frequencies, then you could compare the error voltage with a smoothed copy of itself and get a digital output telling you which frequency the signal was at.
If you have a stable local reference, you wouldn't even need the whole PLL. You could just use the phase/frequency comparator, or whatever it is called.
If this is a data transmission scheme, the equal time trait can be met by using 8-bit to 10-bit encoding. This could also allow you to handle framing with specific out of band 10-bit codes.
I'm making a lot of guesses and assumptions here, so if I am way off base, just ignore me. ;-)
--Mac
The chirp-z transform can resolve between arbitrary frequency points. This function is available in Matlab, otherwise code to do is posted on the net.
Tom
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.