fft of a dat file?

Soumen banerjee soumen08 at gmail.com
Wed Mar 25 03:59:00 EDT 2009


Hello
I have not tried the code because in no part of the code is the array
"out" being created. As such, it is bound to return an error that out
isnt created. The point here is how i can get sampled values from the
dat file which has lines like this:-

<sampling Time>    <sampled Value>   \r\n

i need to isolate the sampled values and put them into an array.
Regards
Soumen


On Wed, Mar 25, 2009 at 12:15 PM, Steven D'Aprano
<steven at remove.this.cybersource.com.au> wrote:
> On Wed, 25 Mar 2009 11:26:00 +0530, Soumen banerjee wrote:
>
>> Hello,
>> I'm kind of new to python and i wanted to do a little project, make a
>> frequency plot of some wav audio. I have been following this webpage
>> http://www.acronymchile.com/sigproc.html and have got to the making of a
>> dat file containing the samples and time of sampling. The question here
>> is how do i use FFT.fft to actually take an fft of this dat file since
>> the first two lines are useless and also we have a \r\n after every
>> sample. Also i would like some explanation on what FFT.fft expects as
>> input. Does it expect the sampling times also or only the sampling
>> values?
>
>
> Did you follow the instructions in the webpage? I quote:
>
> "Analysing the Signal
> This is really quite easy, assuming you have Numerical Python and the FFT
> modules installed. Continuing from our last code snippet, where "out"
> contains a list of the samples from our sound file, the following gives
> us an FFT:
>
> import Numeric
> import FFT
> out_array=Numeric.array(out)
> out_fft=FFT.fft(out)
>
> It is as easy as that!"
>
>
> Have you done this? Did it work? If not, what error did you get? If it
> did work, then what's the problem?
>
>
> --
> Steven
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list