DSP + MatLab + Bass Guitar Tunner + TI C6713

Posted on 2006-04-04
Last Modified: 2016-02-10
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?
Question by:carlospzx
    LVL 27

    Expert Comment

    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.
    LVL 26

    Expert Comment

    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.

    LVL 22

    Expert Comment

    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.
    LVL 37

    Accepted Solution

    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:

    A pseudocode for finding Correlation is given here:

    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... :)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Complex Numbers are funny things.  Many people have a basic understanding of them, some a more advanced.  The confusion usually arises when that pesky i (or j for Electrical Engineers) appears and understanding the meaning of a square root of a nega…
    Lithium-ion batteries area cornerstone of today's portable electronic devices, and even though they are relied upon heavily, their chemistry and origin are not of common knowledge. This article is about a device on which every smartphone, laptop, an…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now