[Haskell-cafe] ANNOUNCE: feldspar-language
tomahawkins at gmail.com
Fri Nov 6 13:35:30 EST 2009
On Fri, Nov 6, 2009 at 6:28 AM, Emil Axelsson <emax at chalmers.se> wrote:
>> I'm trying to get realtime signal processing with Haskell for long. I make
>> progress, but slowly. Has Ericsson ever thought about using Haskell itself
>> for signal processing? (But I think they already have Erlang?)
> No, using Haskell directly is not an option (at least with current compiler
> technology). Their performance requirements are very high, and the signal
> processors have quite limited memory, so putting a Haskell RTS on them
> wouldn't work.
Atom may be another option. Though it is not intended for high
performance DSP, we do use it for basic signal processing. Here is an
IIR filter that is used is some fault detection logic on our
-- | IIR filter implemented using direct form 2.
iirFilter :: Name -> Float -> [(Float, Float)] -> E Float -> Atom (E Float)
iirFilter name b0 coeffs x = do
-- Create the filter taps.
vs <- mapM (\ i -> float (name ++ show i) 0) [1 .. length coeffs]
-- Cascade the filter taps together.
mapM_ (\ (vA, vB) -> vA <== value vB) $ zip (tail vs) vs
-- Calculate the input to the chain of taps.
let w0 = sum ( x : [ (value v) * Const (-a) | (v, (a, _)) <- zip vs coeffs ])
bs = b0 : (snd $ unzip coeffs)
ws = w0 : map value vs
us = [ w * Const b | (w, b) <- zip ws bs ]
head vs <== w0
-- Return the output.
return $ sum us
More information about the Haskell-Cafe