Data Sonification via IFFT

8 views (last 30 days)
Jimbo
Jimbo on 22 Sep 2011
Hi, I'm trying to sonify a non audio histogram data (financial data), for an arts project. I am using sound=ifft(histogram) but the sounds I get all start very loud then drop exponentially, and then at the end rise sharply again, sounding very much like a "ding-woop". I understand the sound symmetry being expected as DFT being conjugate symmetric, and also the fact that IFFT just converts from the frequency domain to time domain. What I don't understand is what are the general properties of the histogram that give such sounds, and how I can condition/change the histogram so it will give me more uniform sounds. I've tried sound=ifft(exp(histogram)) but didn't improve much. Many thanks for your help...

Accepted Answer

Walter Roberson
Walter Roberson on 22 Sep 2011
What you describe reminds me of something I encountered a few days ago: if you start with a linear slope and fft() it, and look at the real component (or, alternate, at the magnitude) of that, then it has a very sharp exponential at one end, becomes "nearly flat", and then at the end goes in to a sharp exponential again. For a simple slope, one of the exponentials will be negative and the other will be positive (the positions would flip around if you reversed the slope.)
My experiences thus suggests that if your histogram had something that approximated straight lines, then the ifft() would end up with the kind of exponentials you heard.
You can always plot the values to see. Keep in mind that the ifft() of arbitrary real data tends to end up as complex, so you will want to look at real() and imag() and abs() of the ifft.
  4 Comments
Jimbo
Jimbo on 27 Sep 2011
I've experimented with your suggestion so I convolved the histogram/spectrum with [-1 1] to remove any straight lines.
It returned a no straight line histogram with a negative components too. That did have an effect, the envelope of the the sounds was inverted, so they had a lenticular shape.
Unfortunately they sounded much more boring as a lot of information was lost. So removing things from the histogram is not preferable.
I only have the histogram data so I'm not sure what I should be using for the imaginary part so I'm just using it as the real part.
And yes it does return a real and an imaginary component that sound very similar, so I'm just using the real for the sound and discard the imaginary part. I'not sure if I should and how to combine them both into a single sound.
It is tricky as these they are not originally from sounds so there are no expectations of how they should sound like.
Alternatively, I should give up any modifications on the frequency domain and just try to re envelope the sounds, but it would be good to understand what is going on.
I have also discovered that I need to pad the histogram with zeros of the same length, otherwise it returns a sound that is made from the original histogram with itself added to it in reverse order, it turns the histogram symmetric where it shouldn't be .
Nothing exotic about the data, It's easy to construct a similar histogram to try it out, it is just like a staircase with a number of solid steps.
Walter Roberson
Walter Roberson on 27 Sep 2011
A staircase with a number of steps is a straight line when viewed from further away.
I suspect you want to be working with the transform of fftshift() of the data.
The transform of a rectangular pulse (such as the bar from a histogram) is a sinc pulse; since is sin(Pi*x)/(Pi*x); see http://en.wikipedia.org/wiki/Sinc_function . The transform of the sum of several rectangular pulses is thus the multiplication of several sinc pulses. If all of the rectangular pulses are positive then all of the sinc pulses will peak on the positive side, so multiplying those sinc together will tend to produce something that approximates a larger sinc function -- i.e., that tends to approximate what you saw. fftshift() your output to see the sinc pulse.
Thus, if you are working with data that is more or less a series of rectangular pulses, or more or less a straight line, you will end up with the output shape you have already observed -- probably not of particular interest.

Sign in to comment.

More Answers (1)

Jimbo
Jimbo on 5 Oct 2011
Thank you, that makes it a lot clearer! I tried using a phase ramp but the sincs did not distribute any more evenly. I also removed the rectangular pulses with convolution, filtering, and the first derivative, with similar results. at least now I understand a bit more, thanks again for the tips.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!