Rough 'n Ready Audio Frequency extraction with a PIC


Results 1 to 34 of 34

Threaded View

  1. #29
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Hi Paul,

    I was aware that the PIC simply threw the decimal portion away, but I'm no mathmetician & just wanted to clarify that I wasn't approaching this incorrectly!

    Thank you for your suggestion...but my goal here is simply to detect the frequency remaining the same for a set length of time (ie the guitar player is 'holding' a note for more than x seconds)....so I don't actually even need to convert to hertz - for simplicity, I can just work in counts.

    It might be handy one day to detect the actual 'Note Played'. when I think my approach would be along the lines of a monster lookup table (with a 'window' either side of the centre frequency for each note)...

    Code:
                      Hertz     Clock Count
    
    	 (from ) 	78	6410  
    Open	E	82.41	6067
    	 (to) 	84.85	5893  
    			
    	 	84.86	5892
    Fret 1	F	87.31	5727
    	 	89.90	5562
    			
    	 	89.91	5561
    Fret 2	F#	92.50	5405
    		95.24	5250
    			
    	 	95.25	5249
    Fret 3	G	98.00	5102
    		100.91	4955
    			
    	 	100.92	4954
    Fret 4	G#	103.83	4816
    		106.91	4677
    			
    	 	106.92	4676
    Fret 5	A	110.00	4545
    	 	113.26	4415
    			
    	 	113.27	4414
    Fret 6	A#	116.54	4290
    	 	120.00	4167
    & so on (I guess Hertz could be derived to decimal points using an even bigger lookup table?!)


    PS Once you get to the highest note on the fretboard (E on the 24th fret - 1318.5Hz) , the compartor clock count between interrupts comes down to something around 379....so it might be worth messing with the prescaler to give a bit more granularity)
    Last edited by HankMcSpank; - 28th August 2010 at 11:26.

Similar Threads

  1. Measuring change of frequency with PIC
    By Aussie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th July 2007, 01:47
  2. PIC Audio
    By toofastdave in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 27th June 2007, 13:49
  3. Pic driven digital audio delay
    By skimask in forum Off Topic
    Replies: 12
    Last Post: - 19th April 2007, 20:42
  4. Audio Encoding and playback in a PIC
    By Rob in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 24th March 2005, 08:56
  5. Frequency Counter using PIC and PicBasic
    By PICtron in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 28th January 2005, 06:20

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts