开发者

How to read a musical file using python and identify the various frequency levels of the notes? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago. 开发者_StackOverflow

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜