# DSP + MatLab + Bass Guitar Tunner + TI C6713

I've been assigned a project to make a bass guitar tunner using matlab simulink and a TI 6713 DSK. Can anyone help me at all.
I've tried several things like pre-recording the input of each string, then compare them with the input in real time, and if they are the same then is tuned. But it didnt work.

Any other suggestion?
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Founder, Software Engineer, Data ScientistCommented:
I am not an expert in these things but I know music. Each string/note has a tone and overtones based on the instrument. I guess if you take the lowest tone and find if it is within range then you can tell if it's tuned.
0
Commented:
I am assuming that you will be using Matlab/Simulink as a development platform.
You will generate a program for the 6713 DSK.
You wind up with a stand alone system with your program and the Starter Kit Board.

There is always a pretty steep learning curve for new hardware and software tools,
but the project seems fairly reasonable.

You probably want to set the DSP up to record one second from the guitar string.

Then you FFT the data and fugure out what string it's supposed to be, and if it's too high,
too low or within limits.  The you could adjust the tension and try again.

You would probably want to set it up with six two color LED's:
RED ==> Too High     ORN ==> Too Low (Both LED's On)   GRN ==> Just Right.

When you have the guitar properly tuned, you would hit each string, and see six green lights
come on in sequence.

0
Commented:
I think the algorithm would go like this:

1.  Roughly find the fundamental frequency, using FFT or a user-entered setting.  (look for the lowest & largest peak in the FFT)

2.  Using the fundamental frequency, figure out which string this is supposed to be, and look up the exact nominal frequency for that string.

3.  Use a high-order digital filter based on the nominal frequency, to reject harmonics and noise.

4.  Count the number of samples it takes to make N cycles (N = 20?), and use the sample frequency to calculate the string's frequency.
0
EngineerCommented:
Hi, you need to use CORRELATION in this case..

1) First of all, find the frequency response of the pre-recorded data. (You can use FFT as suggested by others, or any other transform)
2) Then find the frequency response of the input signal.
3) Correlate both the frequency responses. The coefficient of correlation will be somewhere in the range -1 to +1
4) Depending upon how perfectly you need to tune, set a range, say 0.05 or 0.1
5) If |r| < 0.1 then the guitar is tuned. Otherwise, it is not..

Correlation is explained here:
http://en.wikipedia.org/wiki/Correlation#The_sample_correlation

A pseudocode for finding Correlation is given here:
http://en.wikipedia.org/wiki/Correlation#Computing_correlation_accurately_in_a_single_pass

You can use the fft function in MATLAB to find the FFT...

freq_resp_orig = fft(prerecorded_signal, no_of_points);
freq_resp_data = fft(input_signal, no_of_points);
corr_matrix = corrcoeff(freq_resp_orig, freq_resp_data);
corr_coeff = det(corr_matrix);

Now, check the corr_coeff and decide whether the guitar is tuned... :)

---
Harish
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Math / Science

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.