guitar tuner algorithm

Discussion in 'Embedded Systems and Microcontrollers' started by prescott2006, Feb 28, 2010.

  1. prescott2006

    Thread Starter Active Member

    Nov 8, 2008
    72
    1
    i wish to design a guitar tuner using pic16f84, got 3 led to indicate the frequency whether they are too high, low or ok. but i got some question about how to write the code. let say a=100hz, b=200hz, but if input frequency is 150hz, so should i light on the high led or low led? because if he is plucking A string, then should light on high led, but if he is plucking B string, then light on low led.so how should i determine?
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    You would either need a switch to tell the PIC what string it is or assume that the guitar is not too far out of tune and anything closer to a than b is string a. At the exact midpoint (fairly unlikely) it would be a cointoss.
     
  3. prescott2006

    Thread Starter Active Member

    Nov 8, 2008
    72
    1
    thanks for your reply. i know can count the frequency of the signal by using tmr0 of pic16f84, but i don't know how to start. can you guide me? or show me some code to begin with..thanks in advance.
     
  4. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,647
    759
  5. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
Loading...