[SciPy-User] Convert a time-frequency array to sound file
Fri Feb 12 14:48:18 CST 2010
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.
----- Original Message ----
From: Yannick Copin <email@example.com>
Sent: Sat, 13 February, 2010 3:59:34 AM
Subject: [SciPy-User] Convert a time-frequency array to sound file
for some illustration (!) purposes, I would like to convert a time-frequency
array (originating from a time series of spectra f(wavelegnth)) into an
audible sound clip, e.g. a WAV file. I quickly looked at what's available
under numpy/python (http://wiki.python.org/moin/Audio/, or Audiolab), but I
couldn't find a single procedure to do this conversion.
Disclaimer: I don't know anything about sound processing, and this is just for
fun, similar to what has been done there:
Any hints or links on how to do that in a simple way?
.~. Yannick COPIN (o:>* Doctus cum libro
/V\ Institut de physique nucléaire de Lyon
// \\ Université de Lyon - CNRS-IN2P3
/( )\ AIM: YnCopin ICQ: 236931013
SciPy-User mailing list
More information about the SciPy-User