PIC pitch detector

Thread Starter

prescott2006

Joined Nov 8, 2008
72
can i use PIC to detect the pitch? i do not need to correct the pitch, just to detect the frequency and display it on LCD. How should i start with?
 

beenthere

Joined Apr 20, 2004
15,819
No parameters given or type of PIC to use.

Convert the frequency to a logic level pulse train. Use a pin as an input and use the pulses to count up a value. If you can control the counting period accurately, then the accumulated count scales to frequency.
 

Thread Starter

prescott2006

Joined Nov 8, 2008
72
basically, there are no constraint on PIC used. but preferable is PIC16F84, or PIC16F877. So after i googling, i found that some algorithm such as autocorreration, Cepstrum analysis can detect the pitch. does that mean that i need to use them?

sgtwookie:
i thought frequency counter is to display the frequency of the device input, but what i wish to do is input voice signal into microphone and after process by PIC somehow then display it on LCD.
 

mik3

Joined Feb 4, 2008
4,843
A bandpass filter will be needed after the microphone to pass only the required pitch. Then a copmarator will monitor when the output signal of the filter passes through its bias point and produce pulses. As mentioned in the previous answers, you can count the pulses per a unit of time and calculate the signals frequency. If you know how to implement the filtering and comparison digitally, you can use a DSP PIC and reduce the components of the circuit.
 

Markd77

Joined Sep 7, 2009
2,806
Audio pitch detection on a small pic is going to be unlikely. There are so many harmonics which makes most methods very tricky. Heavy filtering will work for a narrow range (less than an octave). This is really a PC application although it is possible a DSPic might manage it. The programming will be hard though. I believe a fast fourier transform may be a possible option.
 
Top