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

David Baddeley david_baddeley@yahoo.com...
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.

David

 
 

----- Original Message ----
From: Yannick Copin <y.copin@ipnl.in2p3.fr>
To: scipy-user@scipy.org
Sent: Sat, 13 February, 2010 3:59:34 AM
Subject: [SciPy-User] Convert a time-frequency array to sound file

Hi,

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: 
http://newscenter.lbl.gov/feature-stories/2010/01/25/music-of-the-universe/

Any hints or links on how to do that in a simple way?

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@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user



      


More information about the SciPy-User mailing list