tags:

views:

103

answers:

1

please help me with the python...this is my project topic...

+1  A: 

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.

Nick T
No, FFT is not needed here.
duffymo
i know it is to be done by applying FFT...just got a vague idea about the conversion also...but i need code urgently...
ria
No, you don't need FFT for pure tones. See my answer. And don't ask for code - that's your job.
duffymo
@duffymo - How do you know if FFT is needed or not, when the file format has not been specified?
mbeckish
I don't know, because the file format has not been specified. But then neither do you. We've both staked out our positions: mine is pure tone, yours is continuous time series of amplitudes.
duffymo
well its not a pure tone...n of course FFT is needed...
ria
thank you duffymo...but if it was a pure tone...how wud it have been done?could you please tell me dat?
ria
Not until you provide more details, reema. Go do your own homework.
duffymo
ok just tell me what all details u need....i have tried a lot myself...nothing worked...if you could help me with it...
ria
@reema Updated answer. 1) import audio, 2) run FFT
Nick T
@Nick T...could u give me a solution for this, without using audiolab?
ria