comfort-fftw 0.0 → 0.0.0.1
raw patch · 4 files changed
+31/−5 lines, 4 filesdep ~deepseqPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: deepseq
API changes (from Hackage documentation)
Files
- comfort-fftw.cabal +24/−2
- src/Numeric/FFTW/RankN.hs +1/−1
- test/Test/Numeric/FFTW/Common.hs +5/−1
- test/Test/Numeric/FFTW/RankN.hs +1/−1
comfort-fftw.cabal view
@@ -1,6 +1,6 @@ Cabal-Version: 2.2 Name: comfort-fftw-Version: 0.0+Version: 0.0.0.1 License: BSD-3-Clause License-File: LICENSE Author: Henning Thielemann <haskell@henning-thielemann.de>@@ -13,6 +13,28 @@ This is a high-level interface to @libfftw@. We re-use the type classes from @netlib-ffi@. .+ Features:+ .+ * Support of one (audio), two (image), three (video) dimensional data,+ as well as n-dimensional one.+ .+ * Support for batched transformations e.g. for block-wise Fourier transform.+ .+ * No normalization like in plain @fftw@.+ This is because I see no universally best place to apply normalization.+ .+ The use of @comfort-array@ enables to use array shapes tailored+ to Fourier transforms:+ .+ [@Shape.Cyclic@]: for data where the @n-1@-th element+ can also be accessed via index @-1@.+ [@Shape.Half@]: for complex data of a real-to-complex Fourier transform.+ It saves you from case distinction between even and odd data length+ and according mistakes.+ [@Shape.Symmetric@]: for real-to-real Sine and Cosine transforms.+ They assert that you will always use+ the appropriate kind for back transformation.+ . For rather simple examples see the packages @align-audio@ and @morbus-meniere@. .@@ -23,7 +45,7 @@ Makefile Source-Repository this- Tag: 0.0+ Tag: 0.0.0.1 Type: darcs Location: https://hub.darcs.net/thielema/comfort-fftw/
src/Numeric/FFTW/RankN.hs view
@@ -54,7 +54,7 @@ {- | >>> complexFloatList $ TrafoM.fourier TrafoM.Forward $ Array.fromList (Shape.Cyclic (5::Int), Shape.Cyclic (5::Int)) [0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0]-[1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),0.31:+0.95,1.00:+(-0.00),0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59]+[1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59] prop> QC.forAll genCyclicArray1 $ \xs sign -> approxComplex floatTol (array1 $ Trafo1.fourier sign xs) (TrafoM.fourier sign $ array1 xs) prop> QC.forAll genCyclicArray1 $ \xs sign -> approxComplex doubleTol (array1 $ Trafo1.fourier sign xs) (TrafoM.fourier sign $ array1 xs)
test/Test/Numeric/FFTW/Common.hs view
@@ -151,7 +151,11 @@ instance Show FixedComplexFloat where show (FixedComplexFloat (r:+i)) = let str :: Float -> String- str x = if x>=0 then printf "%.2f" x else printf "(%.2f)" x+ str x =+ if abs x < 0.005+ then "0.00" --avoid "-0.00"+ else+ if x>=0 then printf "%.2f" x else printf "(%.2f)" x in printf "%s:+%s" (str r) (str i) complexFloatList ::
test/Test/Numeric/FFTW/RankN.hs view
@@ -69,7 +69,7 @@ DocTest.example {-# LINE 56 "src/Numeric/FFTW/RankN.hs" #-} (complexFloatList $ TrafoM.fourier TrafoM.Forward $ Array.fromList (Shape.Cyclic (5::Int), Shape.Cyclic (5::Int)) [0,0,0,0,0, 0,1,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0])- [ExpectedLine [LineChunk "[1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),0.31:+0.95,1.00:+(-0.00),0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59]"]]+ [ExpectedLine [LineChunk "[1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,(-0.81):+(-0.59),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+0.59,0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),0.31:+0.95,1.00:+0.00,0.31:+(-0.95),(-0.81):+(-0.59),(-0.81):+0.59]"]] DocTest.printPrefix "Numeric.FFTW.RankN:80: " {-# LINE 80 "src/Numeric/FFTW/RankN.hs" #-} DocTest.property