On 07/14, Till Bovermann wrote:
> Dear list,
>
> I am confused about this.
> I have the following function taking a list of arguments (note the inner 
> brackets;
>
> ((( input args as list:
> reason being that this function will later be encapsulated into a recursion 
> operator that applies the function multiple times; the recursion operator 
> should not depend on number of inputs/outputs as long as they have the same 
> dimensionality
> )))
>
>
> here's the function:
>
> ```
> dsm1_fbck((permanentIn, s0_prev, s1_prev, out_prev)) = permanentIn, s0, s1, 
> out with {
>     s0 = permanentIn - s1_prev + s0_prev;
>     s1 = (s0 >=0) : select2(_, -1, 1); // bi-modal (for computation)
>     out = s1 > 0; // make uni-modal
> };
> ```
>
> to my understanding, the function should have the same input and output 
> dimensionality, however, this:
>
> ```
> process = dsm1_fbck((_, _, _, _));
> ```
>
> shows me a block diagram with 10(!) ins and 4 outs.

Let me provide a simple example. Suppose you have

        twice(x) = x + x;

Now,

        process = twice;

will work as expected, but

        process = twice(_);

will have 2 inputs because this expands to

        process = _ + _;

> How can I prevent this?

You can do

        process(permanentIn, s0_prev, s1_prev, out_prev) = 
dsm1_fbck((permanentIn, s0_prev, s1_prev, out_prev));

or

        process = \(permanentIn, s0_prev, s1_prev, 
out_prev).(dsm1_fbck((permanentIn, s0_prev, s1_prev, out_prev)));

or you can simply remove the extra parentheses:

        dsm1_fbck(permanentIn, s0_prev, s1_prev, out_prev) = ...;

        process = dsm1_fbck;

Oleg.



_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to