How to read a musical file using python and identify the various frequency levels of the notes? [closed]
please help me with the python...this is my project topic...
Fourier transforms. Learn some basics about music and signals before even considering code.
Basic Outline:
Audio Import
See http://wiki.python.org/moin/Audio/ and find one that will import your (unspecified) file.
Analysis
Get numpy
.
>>> from numpy.fft import fft
>>> a = abs(fft([1,2,3,2]*4))
>>> a
array([ 32., 0., 0., 0., 8., 0., 0., 0.,
0., 0., 0., 0., 8., 0., 0., 0.])
We can clearly see the DC component at 0, then the major AC component at fs/4
and 3*fs/4
due to this being a real signal, as all frequency components are mirrored over the X-axis.
精彩评论