Standard Guitar Tuning
Frequency values of the strings:
1º string (E): 329.64 Hz
2º string (B): 246.94 Hz
3º string (G): 196.00 Hz
4º string (D): 146.83 Hz
5º string (A): 110.00 Hz
6º string (E): 82.41 Hz
We read a file with the sound of an open string, compute its DCT, and plot the frequencies.
import matplotlib.pyplot as plt #paquete para graficar
import numpy as np #paquete de operaciones matemáticas
from scipy.io import wavfile #paquete para cargar archivos wav
from scipy.fftpack import dct, idct #paquete para dct y idct
# leemos el archivo wav
frec, x = wavfile.read('guitar1.wav')
# calculamos la DCT
Xantes = X
L = len(X)
T=np.linspace(1,1/frec,L)
f= frec/2*np.linspace(0,1,L)
# graficamos las frecuencias
fig1 = plt.subplots()
f=f[1:40000]
X=X[1:40000]
plt.title('tono puro: 246.94 Hz')
plt.plot(f,X,'-r')
plt.show()
We observe that there is a dominant frequency and harmonics that help form the note.
Here is a video comparing the frequencies of different instruments.