A guitar Tuner project made by: Guarino Yuri Pota Giuseppe Sito Leonardo It is made up of a circuit for signal amplification(using LM386 OP-AMP), and a circuit of many LEDs that display if the guitar is tuned or not. For digital signal processing we used mbed-dsp library.

Dependencies:   mbed mbed-dsp

Files at this revision

API Documentation at this revision

Comitter:
gpota
Date:
Sun Dec 09 16:04:49 2018 +0000
Parent:
0:2529b7b37e9a
Commit message:
A guitar Tuner project made by: Guarino Yuri Pota Giuseppe Sito Leonardo It is made up of a circuit of signal amplification(using LM386 OP-AMP), and a circuit of many LEDs that display if the guitar is tuned or not.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 2529b7b37e9a -r 45d485b8966f main.cpp
--- a/main.cpp	Sun Dec 09 15:58:55 2018 +0000
+++ b/main.cpp	Sun Dec 09 16:04:49 2018 +0000
@@ -157,7 +157,7 @@
     while(1) {
         button.rise(&selectNote);
         for (int k = 0; k < 1024; k++) {
-            Ing[k] = (short) (analog_value.read_u16() - 0x8000);  // read unsigned 16-bit and convert to signed 16-bit (subtract 32768)    
+            Ing[k] = (short) (analog_value.read_u16() - 0x8000);      
             wait_us(1e6/SAMP_FREQ);
             }
             //Riempiamo il vettore per la FFT
@@ -168,7 +168,7 @@
                 samples[i+1]    = 0;
             }
                arm_cfft_f32(S, samples, 0, 1);
-    // Calculate magnitude of complex numbers output by the FFT.
+    // Calcola la FFT
     arm_cmplx_mag_f32(samples, magnitudes, FFT_LEN);
     
                    if(c==1){
@@ -182,7 +182,7 @@
                        }while(j<1024/2);
                        
                         float maxx=(float)max*1000/1024;
-                       //pc.printf("Il massimo in ampiezza è alla frequenza %f Hertz \n",(float)max*1000/1024);
+                    
                        if(maxx<82){
                        Led_Down=1;
                        Led_Up=0;
@@ -235,7 +235,7 @@
                    int j=2;
                    do{
                         
-                        if (magnitudes[j]>magnitudes[max]&&(j*1000/1024<160)&&(j*1000/1024>130))//restringo la banda a [90Hz, 130Hz]
+                        if (magnitudes[j]>magnitudes[max]&&(j*1000/1024<160)&&(j*1000/1024>130))//restringo la banda a [130Hz, 160Hz]
                         max=j;
                         j++;
                     
@@ -265,7 +265,7 @@
                    int j=2;
                    do{
                         
-                        if (magnitudes[j]>magnitudes[max]&&(j*1000/1024<210)&&(j*1000/1024>170))//restringo la banda a [90Hz, 130Hz]
+                        if (magnitudes[j]>magnitudes[max]&&(j*1000/1024<210)&&(j*1000/1024>170))//restringo la banda a [170Hz, 210Hz]
                         max=j;
                         j++;
                     
@@ -295,7 +295,7 @@
                    int j=2;
                    do{
                         
-                        if (magnitudes[j]>magnitudes[max]&&(j*1000/1024<260)&&(j*1000/1024>230))//restringo la banda a [90Hz, 130Hz]
+                        if (magnitudes[j]>magnitudes[max]&&(j*1000/1024<260)&&(j*1000/1024>230))//restringo la banda a [230Hz, 260Hz]
                         max=j;
                         j++;
                     
@@ -325,7 +325,7 @@
                    int j=2;
                    do{
                         
-                        if (magnitudes[j]>magnitudes[max]&&(j*1000/1024<340)&&(j*1000/1024>310))//restringo la banda a [90Hz, 130Hz]
+                        if (magnitudes[j]>magnitudes[max]&&(j*1000/1024<340)&&(j*1000/1024>310))//restringo la banda a [340Hz, 310Hz]
                         max=j;
                         j++;