Offline
Newbie
Karma: 0
Posts: 17
|
 |
« on: January 11, 2013, 03:30:03 pm » |
Hie,
I am novice to arduino and even little knowledge of programming in general, I am doing guitar project where I have to implement/ write code for frequency calculation, means my task is to write a code which is visualize the real frequency of the 6 strings of the acoustic guitar on a LCD. Is there any that can help me for the coding? or any suggestion I will appreciate that help
thanks
|
|
|
|
|
Logged
|
|
|
|
|
Montreal
Offline
Edison Member
Karma: 17
Posts: 2207
Per aspera ad astra.
|
 |
« Reply #1 on: January 11, 2013, 03:59:30 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #2 on: January 11, 2013, 05:44:53 pm » |
thanks Magician
wen I compile the on that link, I got compile error, I think my arduino does'nt use cpp library
it does'nt recognize this line: FreqCounter::f_comp=10; and I downloaded this file #include <FreqCounter.h>
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 73
Posts: 6631
Arduino rocks
|
 |
« Reply #3 on: January 11, 2013, 05:53:40 pm » |
thanks Magician
wen I compile the on that link, I got compile error, I think my arduino does'nt use cpp library
it does'nt recognize this line: FreqCounter::f_comp=10; and I downloaded this file #include <FreqCounter.h>
Did you download the whole library from that page and install it in .../sketchbook/libraries/ ?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 1
|
 |
« Reply #5 on: January 13, 2013, 06:58:40 am » |
I'm afraid frequency counter library won't work. It detects the frequency of a single frequency signal, and the guitar has several harmonic frequencies superimposed to the major tone, for a single guitar string. If you play all the 6 strings, probabily you get a real mess. The best approach to solve the problem would be to apply FFT (more on http://arduino.cc/forum/index.php/topic,38153.0.html), but it won't be easy. The reason is that the resulting signal is composed by the 6 string tones added to at least 3 harmonic for each tone. I believe it won't be simple to separate and to identify all these frequencies. Besides, to correctly detect the tone, the FFT shall have a resolution of at least 5 Hz (to distinguish between E2 and F2), and this means that the FFT window should be very large, depending on the sampling frequency. This makes real time frequency detection far from feasible. I've been working on a similar problem, but I want detect a single guitar string frequency. It is still a hard problem, and I realized that FFT wouldn't run in real-time, due to the required large window (above 1024 points for 40 kHz sampling). Up to now I have an algorithm running on Matlab that gives the right frequency in real time to almost 70% of the tones (I think that I can improve it). It doesn't use FFT - it is based on zero-crossing times. If I manage to put it in the Arduino, then I will post it here.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #6 on: January 15, 2013, 03:34:50 am » |
Thanks Valcarrara for reply. sorry, It was my fault by asking wrong/weird question, because what I want to get solution is : calculation/programming frequency of the guitar strings individually, using arduino code: question says: when you tone f.eks. biggest string E nr.6, we have to see the frequency of E(82 Hz) on the LCD, but just only E, and if we tune again the smallest string (e) nr.1 , we have to see 329 Hz on LCD and so on, individually at a time. we have to use zero crossing algorithm, PWM or ADC convertion using timers, but my programming knowledge is minimal , guys can you please help me how code that. Thanks
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #7 on: January 16, 2013, 07:46:46 pm » |
Hi I am still waiting some help/hints about programming_ my guitar project- specifically calculating frequency of a guitar strings and displaying it on LCD. the solution I have been required is like the picture of this link. http://www.pjrc.com/teensy/td_libs_FreqCount.html#compareis there any one of you guys can help me on that, I am using seeeduino board , I tried to use frequency library on the above link, but I get error thanks
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #8 on: January 17, 2013, 03:07:57 am » |
Hi guys, I need some help/hints about programming_ my guitar project- specifically calculating frequency of a guitar strings and displaying it on LCD. the solution I have been required is like the picture of this link. http://www.pjrc.com/teensy/td_libs_FreqCount.html#comparequestion is like: 1- write a progrogram that measuring/calculating frequency of a acoustic guitars string individually 2- when you tune one string it should be seen the frequency on lcd, one string at one time, use a zero-crossing filter/formula is there any one of you guys can help me on that, I am using seeeduino board , I tried to use frequency library on the above link, but I get error thanks
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 316
Posts: 35566
Seattle, WA USA
|
 |
« Reply #9 on: January 17, 2013, 05:24:40 am » |
question is like: 1- write a progrogram that measuring/calculating frequency of a acoustic guitars string individually This reads more like "Homework assignment is...". What hardware are you using to measure anything? Specifically, how are you measuring the string vibrations individually? The code needs to be written to deal with that hardware. 2- when you tune one string it should be seen the frequency on lcd, one string at one time, use a zero-crossing filter/formula How does "it" know when you are tuning one string vs. another? is there any one of you guys can help me on that, I am using seeeduino board , I tried to use frequency library on the above link, but I get error Oh, well, that's easy. Delete line 87. That will fix the error.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #10 on: January 17, 2013, 08:02:16 am » |
I thought these two posts looked very similar, so I merged them.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2311
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #11 on: January 17, 2013, 10:14:55 am » |
Back in my childhood (14 - 15 years old) l tuned a couple of piano's, upright's with a Strobicon. We had some little felt tools that were used to mute the strings that weren't being tuned (3 strings/note) and tuning was simple. I even worked with another guy that was a pipe organ tuner and even though there were several pipes necessary for some voicing we still tuned one note at a time.. Lot of pipes in a 4 manual 17 rank pipe organ. In my dotage I designed an FSK decoder, several as a matter of fact and it had to process the audio from an AM radio. This places several severe restrictions on what I could do due to noise, co-channel and skip reception. This was compounded by the processor speed of 400 KHz for very low power operation (the whole board with the radio drew 3.2 mA) what I finally did was to accept any 3 crossings in any bit frame that were the right perioid as a valid bit one or zero. I also repeated the message 3 times as I had no ack returned from the receiver. Perhaps some food for thought?
Bob {Edit RKJ)
|
|
|
|
« Last Edit: January 17, 2013, 10:32:29 am by Docedison »
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Pittsburgh, PA, USA
Offline
Faraday Member
Karma: 31
Posts: 2947
I only know some basic electricity....
|
 |
« Reply #12 on: January 17, 2013, 10:39:48 am » |
Could you put a pickup on the guitar and pick 1 string at a time? https://www.youtube.com/watch?v=aOJuCYgmPPEBut you'd have to do more to get it safely into Arduino to output to LCD for visualization.
|
|
|
|
|
Logged
|
Examples can be found at Learning in the Main Site and at the Playground
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2311
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #13 on: January 17, 2013, 10:54:43 am » |
The issue with a pickup is that unless the rest of the strings are muted they will resonate too the absolute difference between any consecutive two notes is the 12th root of 2 or 1.059463... (20 more places).
Bob
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
|
 |
« Reply #14 on: January 17, 2013, 11:23:56 am » |
Thanks PaulS and AWOL for the help,
indeed it is part of our project. the hardware I am using,is microcontroller seeeduino ADK Mega2560 and LMD386 amplifier - when the string is tuned the signal from the guitars string should be amplified and it passed to arduino pin0 , the signal should be again filtered and finally it should be shown the frequency on LCD. the input and the output of the amplifier are connected two coils-with electro-magatics , one input couil and the other is output coil(one coil is as microphone the other coil is making vabrating the string) , the tuning is happen outomatically when the guitars string come very close to the magnatics, one string at a time. the idea is like this link:http://www.youtube.com/watch?v=cz2E9Ijz9_I I attached here the picture of the system. I still need help about coding, thanks
obs: is that line 87 of the frequency library - ? but it is behaving like my compiler does'nt recognize c++ code I am using arduino IDE-
|
|
|
|
|
Logged
|
|
|
|
|
|