forsyde-shallow 3.4.0.1 → 3.5.0.0
raw patch · 3 files changed
+15/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- forsyde-shallow.cabal +1/−1
- src/ForSyDe/Shallow/Utility/FIR.hs +7/−2
- test/Unit.hs +7/−1
forsyde-shallow.cabal view
@@ -1,5 +1,5 @@ name: forsyde-shallow-version: 3.4.0.1+version: 3.5.0.0 cabal-version: >= 1.10 build-type: Simple license: BSD3
src/ForSyDe/Shallow/Utility/FIR.hs view
@@ -25,9 +25,14 @@ firSY h = innerProdSY h . sipoSY k 0.0 where k = lengthV h +-- sipoSY :: Int -> b -> Signal b -> Vector (Signal b) +-- sipoSY n s0 = unzipxSY . scanlSY shiftrV initState+-- where initState = copyV n s0++-- | Create the tapped, or delayed signals for later consumption. sipoSY :: Int -> b -> Signal b -> Vector (Signal b) -sipoSY n s0 = unzipxSY . scanldSY shiftrV initState- where initState = copyV n s0+sipoSY n s0 = iterateV n tap + where tap = delaySY s0 innerProdSY :: (Num a) => Vector a -> Vector (Signal a) -> Signal a innerProdSY coeffs = zipWithxSY (ipV coeffs)
test/Unit.hs view
@@ -1,4 +1,5 @@ import ForSyDe.Shallow+import ForSyDe.Shallow.Utility.FIR import Test.Hspec -- | Taken from <https://github.com/forsyde/forsyde-shallow-examples>@@ -107,7 +108,10 @@ [(1, 0, \[a] -> [])])) s2_test = signal $ [10..110] - +-- Test of FIR-filter+test_firSY :: Signal Double+test_firSY = firSY (vector [1.0, 0.75, 0.5, 0.25]) $ signal [1.0, 0.0, 0.0, 0.0, 0.0]+ main :: IO () main = hspec $ do describe "ForSyDe.Shallow : " $ lab2tests where@@ -124,3 +128,5 @@ `shouldBe`(read "{1,1,1,2,2,4,4,8,8,16}" :: Signal Integer) it "SADF Anti Wind-up System" $ takeS 10 (test_antiWindUpSADF s2_test) `shouldBe`(read "{10,21,33,46,60,75,91,108,108,108}" :: Signal Integer)+ it "SY FIR Filter" $ test_firSY+ `shouldBe`(read "{1.0,0.75,0.5,0.25,0.0}" :: Signal Double)