Created
February 1, 2018 09:39
-
-
Save nlhans/5a7a8f5c49c3be13ab28055aac078fc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Constants where | |
import CLaSH.Prelude | |
type MyValue = SFixed 5 13 | |
type MyValues = Vec 2 MyValue | |
coefficients :: [MyValue] | |
coefficients = [0.5, 0.25] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Filter where | |
import CLaSH.Prelude | |
import Constants | |
fir :: MyValues -> MyValues -> MyValue | |
fir coeffs xs = dotp coeffs xs | |
where | |
dotp as bs = sum (zipWith (*) as bs) | |
topEntity xs = fir hs xs | |
where | |
hs = $(listToVecTH coefficients) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment