packages feed

hsignal 0.1.2.2 → 0.1.2.3

raw patch · 4 files changed

+24/−12 lines, 4 filesdep +binarydep −ghc-binarydep ~hmatrix-gsl-statsdep ~hstatistics

Dependencies added: binary

Dependencies removed: ghc-binary

Dependency ranges changed: hmatrix-gsl-stats, hstatistics

Files

CHANGES view
@@ -40,3 +40,5 @@ 		fixed scale in pwelch 		reflected changes in hmatrix exports +0.1.2.3:+		changes to reflect new hmatrix interface		
LICENSE view
@@ -1,2 +1,10 @@-Copyright A.V.H. McPhail 2010-GPL license+Copyright (c) 2010, A.V.H. McPhail+All rights reserved.++Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:++    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.+    * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hsignal.cabal view
@@ -1,6 +1,6 @@ Name:               hsignal-Version:            0.1.2.2-License:            GPL+Version:            0.1.2.3+License:            BSD3 License-file:       LICENSE Author:             Vivian McPhail Maintainer:         haskell.vivian.mcphail <at> gmail <dot> com@@ -14,6 +14,8 @@      .      When hmatrix is installed with -fvector, the vector type is Data.Vector.Storable      from the vector package.+     .+     Feature requests, suggestions, and bug fixes welcome. Category:           Math tested-with:        GHC ==6.12.1 @@ -29,10 +31,10 @@     Build-Depends:      base >= 3 && < 5,                         mtl,                          array,-                        bytestring, storable-complex, ghc-binary,+                        bytestring, storable-complex, binary,                         hmatrix >= 0.10.0,-                        hmatrix-gsl-stats >= 0.1.2.1,-                        hstatistics >= 0.2.0.8+                        hmatrix-gsl-stats >= 0.1.2.4,+                        hstatistics >= 0.2.2.3      Extensions:         ForeignFunctionInterface 
lib/Numeric/Signal/Internal.hs view
@@ -54,7 +54,7 @@ -----------------------------------------------------------------------------  instance Convolvable (Vector Double) where-    convolve x y = fst $ fromComplex $ F.ifft $ (F.fft (complex x) * F.fft (complex y))+    convolve x y = fst $ fromComplex $ F.ifft $ (F.fft (comp x) * F.fft (comp y)) --    convolve = convolve_vector_double  convolve_vector_double c a = unsafePerformIO $ do@@ -96,7 +96,7 @@ -- | Hilbert transform with original vector as real value, transformed as imaginary hilbert :: Vector Double -> Vector (Complex Double) hilbert v = unsafePerformIO $ do-            let r = complex v+            let r = comp v             -- could use (comp v) to make a complex vector in haskell rather than C             app1 signal_hilbert vec r "hilbert"             return r@@ -111,7 +111,7 @@        -> Vector Double  -- ^ power density   pwelch w v = unsafePerformIO $ do              let r = constant 0.0 ((w `div` 2) + 1)-             app2 (signal_pwelch $ fromIntegral w) vec (complex v) vec r "pwelch"+             app2 (signal_pwelch $ fromIntegral w) vec (comp v) vec r "pwelch"              return r  foreign import ccall "signal-aux.h pwelch" signal_pwelch :: CInt -> CInt -> PC -> CInt -> PD -> IO CInt@@ -138,8 +138,8 @@       -> Vector Double     -- ^ points (between 0 and 2*pi)       -> Vector Double     -- ^ response freqz b a w = let k = max (dim b) (dim a)-                  hb = polyEval (postpad b k) (exp (scale (0 :+ 1) ((complex w) :: Vector (Complex Double))))-                  ha = polyEval (postpad a k) (exp (scale (0 :+ 1) ((complex w) :: Vector (Complex Double))))+                  hb = polyEval (postpad b k) (exp (scale (0 :+ 1) ((comp w) :: Vector (Complex Double))))+                  ha = polyEval (postpad a k) (exp (scale (0 :+ 1) ((comp w) :: Vector (Complex Double))))               in complex_power (hb / ha)  postpad v n = let d = dim v