[SciPy-User] Convert a time-frequency array to sound file

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Feb 15 08:52:31 EST 2010


On Mon, Feb 15, 2010 at 8:35 AM, Yannick Copin <y.copin at ipnl.in2p3.fr> wrote:
> Hi,
>
>> You could just take the inverse fourier transform of each spectra and then
>> just patch them end to end, but I suspect this will end up sounding pretty
>> awful as you'd get lots of phase discontinuities at the end of each
>> segment. A better strategy might be to generate a continuous sin wave for
>> each frequency (with a good number of samples per segment), multiply each
>> of these sin waves by the corresponding, interpolated, spectral amplitude,
>> and then sum over the different frequencies.
>>
>> This should be easy enough to do with the standard numpy functions.
>
> Thanks for the tips. Alas, I guess I have to conclude that such a conversion
> procedure does not already exist...

Wav sound files (scipy.io.wavfile)
write (filename, rate, data) Write a numpy array as a WAV file

I don't know what this does, I'm just browsing the docs.
Disclaimer: I don't know anything about sound processing

Josef

>
> Cheers,
> --
>    .~.   Yannick COPIN  (o:>*  Doctus cum libro
>    /V\   Institut de physique nucléaire de Lyon
>   // \\  Université de Lyon - CNRS-IN2P3
>  /(   )\ AIM: YnCopin ICQ: 236931013
>   ^`~'^  http://snovae.in2p3.fr/ycopin/
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list