firFilter

  1. auto firFilter(Sg sg, const E[] taps)
  2. auto firFilter(Sg sg, const E[] tap, E[] buf)
    firFilter
    (
    alias reduceFn = "a+b*c"
    Sg
    E
    )
    (
    Sg sg
    ,
    const E[] tap
    ,
    E[] buf
    )
    if (
    is(E == Unqual!E)
    )
    in { assert (tap.length == buf.length); }

Examples

1 scope(failure) {writefln("Unittest failure :%s(%s)", __FILE__, __LINE__); stdout.flush();}
2 scope(success) {writefln("Unittest success :%s(%s)", __FILE__, __LINE__); stdout.flush();}
3 
4 auto arr = [0, 1, 2, 3].repeatStream,
5      flt1 = arr.firFilter([0, 1]);
6 
7 assert(flt1.read(new int[8]) == [0, 0, 0*1+1*0, 1, 2, 3, 0, 1]);
8 
9 auto flt2 = arr.firFilter([1, 2]);
10 assert(flt2.read(new int[6]) == [0, 0, 0*2+1*1, 1*2+2*1, 2*2+3*1, 3*2+0*1]);

Meta