Streaming Computations in Feldspar

We present a library for expressing digital signal processing algorithms using a deeply embedded language in Haskell. It is an extension Feldspar's stream library, which provides a data type for infinite sequences of values. Until now, streams have been confined to a set of explicit functions for expressing recurrence equations, delays and sampling. The extension we present removes the need for such functions, reducing the gap between streaming algorithms and their mathematical description; efficiency is maintained by optimising the network structures. We demonstrate the usefulness of our library by giving example implementations of common filters and control structures found in digital signal processing. Our library is built on top of Feldspar, a domain specific language for programming digital signal processing algorithms, and, like our extensions, is implemented as a deeply embedded language in Haskell. The Feldspar language itself offers high-level and functional style for describing digital signal processing algorithms, where the final aim of a Feldspar program is to generate high-performance low level code. Feldspar is based around a low-level functional core language, which is semantically similar to machineoriented languages, such as C, and operates at around the same level of abstraction. A number of libraries built on top of the core language are offered, enabling programming in a higher-order manner, one of which is Feldspar's stream library. Feldspar stream library contains a modified version of co-iterative streams, a central concept for reasoning about and optimising stream systems. In the co-iterative approach, each stream consists of a transition function and an initial state, where the transition function takes a state and produces a new state and an output value. The interesting property of co-iterative streams is that they allow one to handle infinite streams in a strict and efficient manner, instead of having to deal with them lazily. As the co-iterative approach provides a good foundation for reasoning about streams, the contributions of this project are based around such streams with added support various temporal operations.

[1]  Thomas P. Krauss,et al.  Signal processing toolbox for use with MATLAB : ユーザーズガイド , 1994 .

[2]  John Thompson,et al.  Digital Signal Processing: Concepts and Applications , 1999 .

[3]  John T. O'Donnell,et al.  Generating Netlists from Executable Circuit Specifications , 1992, Functional Programming.

[4]  Zoltán Horváth,et al.  Feldspar: A domain specific language for digital signal processing algorithms , 2010, Eighth ACM/IEEE International Conference on Formal Methods and Models for Codesign (MEMOCODE 2010).

[5]  Andy Gill,et al.  Type-safe observable sharing in Haskell , 2009, Haskell.

[6]  Sebastian Erdweg,et al.  Layout-sensitive language extensibility with SugarHaskell , 2012, Haskell '12.

[7]  Erik Perrins,et al.  Introducing Kansas Lava , 2009, IFL.

[8]  Henrik Nilsson,et al.  Switched-On Yampa , 2008, PADL.

[9]  Marc Pouzet,et al.  A Co-iterative Characterization of Synchronous Stream Functions , 1998, CMCS.

[10]  Morten Rhiger,et al.  A foundation for embedded languages , 2002, TOPL.

[11]  Paul Hudak,et al.  Real-time FRP , 2001, ICFP '01.

[12]  Nicolas Halbwachs,et al.  Synchronous Programming of Reactive Systems , 1992, CAV.

[13]  Gérard Berry,et al.  The Esterel Synchronous Programming Language: Design, Semantics, Implementation , 1992, Sci. Comput. Program..

[14]  Samuel N. Kamin Standard ML as a Meta-Programming Language , 1996 .

[15]  Henning Thielemann Audio Processing using Haskell , 2004 .

[16]  P. Hudak,et al.  Causal commutative arrows , 2011, Journal of Functional Programming.

[17]  Mary Sheeran,et al.  Lava: hardware design in Haskell , 1998, ICFP '98.

[18]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[19]  Paul Hudak,et al.  Arrows, Robots, and Functional Reactive Programming , 2002, Advanced Functional Programming.

[20]  Antony Courtney,et al.  Genuinely Functional User Interfaces , 2001 .

[21]  Edward A. Lee,et al.  Static Scheduling of Synchronous Data Flow Programs for Digital Signal Processing , 1989, IEEE Transactions on Computers.

[22]  A. M. Peterson Applications of digital signal processing , 1979 .

[23]  George H. Mealy,et al.  A method for synthesizing sequential circuits , 1955 .

[24]  Albert Benveniste,et al.  Signal-A data flow-oriented language for signal processing , 1986, IEEE Trans. Acoust. Speech Signal Process..

[25]  Henrik Nilsson,et al.  Functional reactive programming, continued , 2002, Haskell '02.

[26]  E.A. Lee,et al.  Synchronous data flow , 1987, Proceedings of the IEEE.

[27]  Anders Persson Towards a Functional Programming Language for Baseband Signal Processing , 2014 .

[28]  Marc Pouzet,et al.  Towards a higher-order synchronous data-flow language , 2004, EMSOFT '04.

[29]  John Hughes,et al.  Generalising monads to arrows , 2000, Sci. Comput. Program..

[30]  Abdoulaye Gamatié Designing Embedded Systems with the SIGNAL Programming Language - Synchronous, Reactive Specification , 2010 .

[31]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[32]  Marc Pouzet,et al.  Clocks as First Class Abstract Types , 2003, EMSOFT.

[33]  Oege de Moor,et al.  Compiling embedded languages , 2003, J. Funct. Program..

[34]  Adam Megacz,et al.  Multi-Level Languages are Generalized Arrows , 2010, ArXiv.

[35]  Nicolas Halbwachs,et al.  LUSTRE: a declarative language for real-time programming , 1987, POPL '87.

[36]  Tiago Boldt Sousa Dataflow Programming Concept , Languages and Applications , 2012 .

[37]  Koen Claessen Embedded Languages for Describing and Verifying Hardware , 2001 .

[38]  Nicolas Halbwachs,et al.  Programming and Verifying Real-Time Systems by Means of the Synchronous Data-Flow Language LUSTRE , 1992, IEEE Trans. Software Eng..

[39]  Mary Sheeran,et al.  The Design and Implementation of Feldspar - An Embedded Language for Digital Signal Processing , 2010, IFL.

[40]  Paul Hudak Functional Reactive Programming (Abstract) , 1999, ESOP.

[41]  Paul Hudak,et al.  Functional reactive programming from first principles , 2000, PLDI '00.

[42]  Paul Hudak,et al.  Functional reactive animation , 1997, ICFP '97.

[43]  Robert Atkey,et al.  What is a Categorical Model of Arrows? , 2011, MSFP@ICALP.

[44]  Henrik Nilsson,et al.  The Yampa arcade , 2003, Haskell '03.

[45]  Emil Axelsson,et al.  Generic Monadic Constructs for Embedded Languages , 2011, IFL.