Spencer Russell on 13 Apr 2012 04:50:26 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

How to choose a "fast array" library in Haskell


I'm playing around with the idea of writing a library/framework for
audio analysis / information retrieval research, and I'm deciding
between doing it in Python (for userbase, ease, familiarity, etc.) or
Haskell (mostly because I want to do something nontrivial in haskell,
and I think that a compositional, functional approach could lend
itself well to this application).

To get a feel I'm implementing some basic pieces in both languages.
I'm hitting a bit of a wall with Haskell though, just figuring out
what my basic internal representation should be. In Python it's easy
because there's such a strong consensus around NumPy, but Haskell
seems to have a multitude of different data structures for this kind
of thing.

I'm using hSndFile to load in audio files, which has an interface both
to generate Data.StorableVector as well as Data.Vector. There's also
StorableVector-StreamFusion and Data.Vector.Storable. The HaskellDSP
project uses "Array a (Complex b)" for Integral a and RealFloat b.

Is there any consensus on what direction things are going? Right now I
just want to load in an audio file, chop it up into frames, take an
FFT of each frame, and display a spectrogram. I'd like to do this
without converting to a different representation at every step.

Any ideas?

Thanks,
Spencer