Haskell, arrows and signal processing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Haskell, arrows and signal processing

Rafael Gustavo da Cunha Pereira Pinto-2

Hi folks from the cafe!!

Last weekend, I was wondering on how hard it would be to use Haskell for mixed-signal processing.

Here is an example of an digital integrator:
 

summation=zipWith (+)

delay xs=(fromIntegral 0):xs

integrator xs=let ws=summation (integrator xs) xs in delay ws



The input and output are  infinite streams. I have a few questions:

1) Is it possible to change it to use arrows? How would it look like?
2) How would one implement an continuous time version?

For 2) I would like to implement something like that digital integrator, so I could create filters based on integrator loops like this one:

x(t) ----(+)----> Integrator --|---> y(t)
          ^                    |
          |--------------------|


Note that x(t) would be a function, and I would expect to create a function y, based on this flow!

Rafael Gustavo da Cunha Pereira Pinto




--
Rafael Gustavo da Cunha Pereira Pinto


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell, arrows and signal processing

Wolfgang Jeltsch-2
Am Mittwoch, den 08.09.2010, 11:47 -0300 schrieb Rafael Gustavo da Cunha
Pereira Pinto:
> The input and output are  infinite streams. I have a few questions:
>
> 1) Is it possible to change it to use arrows? How would it look like?
> 2) How would one implement an continuous time version?

Have you had a look at Yampa?

Best wishes,
Wolfgang


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell, arrows and signal processing

Rafael Gustavo da Cunha Pereira Pinto-2
Just found it! It is pretty much what I was looking for,

On Thu, Sep 9, 2010 at 10:08, Wolfgang Jeltsch <[hidden email]> wrote:
Am Mittwoch, den 08.09.2010, 11:47 -0300 schrieb Rafael Gustavo da Cunha
Pereira Pinto:
> The input and output are  infinite streams. I have a few questions:
>
> 1) Is it possible to change it to use arrows? How would it look like?
> 2) How would one implement an continuous time version?

Have you had a look at Yampa?

Best wishes,
Wolfgang


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



--
Rafael Gustavo da Cunha Pereira Pinto


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell, arrows and signal processing

Henning Thielemann-4
In reply to this post by Rafael Gustavo da Cunha Pereira Pinto-2
Rafael Gustavo da Cunha Pereira Pinto schrieb:

> The input and output are  infinite streams. I have a few questions:
>
> 1) Is it possible to change it to use arrows? How would it look like?
> 2) How would one implement an continuous time version?
>
> For 2) I would like to implement something like that digital integrator,
> so I could create filters based on integrator loops like this one:
>
> x(t) ----(+)----> Integrator --|---> y(t)
>           ^                    |
>           |--------------------|
>
>
> Note that x(t) would be a function, and I would expect to create a
> function y, based on this flow!

If you look for Arrows, Signal processing _and_ real-time efficiency,
then you might be interested in my experiments with LLVM:
http://www.youtube.com/watch?v=GNiAqBTVa6U

http://arxiv.org/abs/1004.4796

http://code.haskell.org/synthesizer/llvm/
(you need some more repositories like
http://code.haskell.org/~thielema/llvm-2.6/,
http://code.haskell.org/synthesizer/alsa/ ...
no fun of installation currently because I could not achieve to get some
patches to llvm to hackage.)

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe