[Haskell-cafe] trying to go from FFT type to Vector.Storable

briand at aracnet.com briand at aracnet.com
Tue May 12 03:50:26 UTC 2015


Hi,

I'm using the FFT package (the FFTW bindings), and for a complex FFT I get back :

(FFTWReal r, Ix i, Shapable i) => CArray i (Complex r) -> CArray i (Complex r) 

at first I thought I could use elems to get to a list and then do Vector.Storable.fromList to get back to a Vector.Storable.

Unfortunately r is FFTWReal so i need to map over the returned list and get a haskell Double back from that.

FFTWReal maps to RealFloat which i found, but i haven't found anything that will take a RealFloat and give me a Double.

Was hoping someone might know how to do that, or maybe have a little cleaner way to get from the FFT data type over to Vector.

Thanks.


Brian


More information about the Haskell-Cafe mailing list