Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

As a follow up to this question: How to sample audio at Nyquist frequency with MSP430F5438?

What type of circuit would I use to generate something that a microcontroller could use to determine the max frequency of an input? I was thinking it would preferably provide a voltage that is lineally related to the frequency.

The information provided by the frequency detector could then be used by the microcontroller to know what frequency it needed to be sampled at.

Is there any ICs that do this? or any circuit that will do this?

share|improve this question
1  
It is hard to understand what you mean by "the frequency" of an input. Only a pure sine wave input is of a single frequency. Any other signals are composed of several frequencies. – markrages Dec 26 '10 at 22:07
@markrages Sorry, I mean max frequency. It was implied from the other posting, but should have be included in my question. – Kellenjb Dec 26 '10 at 22:13

2 Answers

up vote 1 down vote accepted

I had two fleeting thoughts:

  1. One could use a crossover, which is an implementation of several bandpass filters, followed by power measurement in order to obtain a rough power spectral density. The highest frequency pass-band achieving a threshold would indicate maximum significant input frequency. If each crossover channel were input to trigger/comparator interrupt pins, some good debounce code may be able to take care of the rest. The crossover could be as simple as an array of diode detectors with RC filtering. Circuit complexity would be dependent on the bandwidth and resolution of the crossover. I'm sure we've all ooo'd & aaw'd at quality audio crossovers; diode detectors are very simple; RF range adds complications, but can use diode detectors as well.

  2. One could mix down the input frequency, followed by a LPF. Using a continous LO frequency, start at some minimum (~kHz) and increasing to a maximum expected frequency (20 kHz for audio), one could setup a trigger based on a threshold DC or low frequency output, or just record and compare over the entire range. I've never looked for a low frequency mixer, but it would be simple to make a crude one (diode bridge; Gilbert cell); RF mixer ICs are available.

Both of these methods are inferior to oversampling, but much more fun. There are frequency-to-voltage conversion ICs (DigiKey: PMIC - V/F and F/V Converters, 1MHz max).

share|improve this answer
My first thought for the guys problem was to over-sample, but in an embedded environment I can see why a different method could be preferred. – Kellenjb Dec 26 '10 at 22:15
1  
I think over-sampling and resampling in software is probably the best plan. Otherwise, the sampling filter will need to be a "brick wall" of variable frequency, which is a tricky design in itself. – markrages Dec 26 '10 at 22:19

Feed the signal into a counter/timer, after conditioning it with a Schmitt trigger or a BJT and diode circuit.

You should know the maximum frequency, however. Base your sampling frequency on that.

share|improve this answer
Another way of measuring the frequency of a signal is to condition it then feed it into a PLL. The PLL will attempt to keep the VCO (voltage-controlled oscillator) running at the same frequency as the input. Therefore (with a linear VCO) the control voltage on the VCO is linearly related to the frequency. This is how most FM radio demodulators work. – markrages Dec 26 '10 at 22:11
Another, poorer method of FM demodulation is to make a filter with a wide slope in the stopband, so that the signal rides the slope. The closer the signal gets to the passband, the greater its amplitude. Follow with an amplitude detector. This method won't reject noise like the PLL will. – markrages Dec 26 '10 at 22:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.