Skip to content

Commit

Permalink
More efficient si.interpolate implementation, cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Dec 5, 2020
1 parent 75a9f9e commit 27ad2f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions basics.lib
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ sec2samp(d) = d*ma.SR;
//
// * `l`: loudness in dB
//-----------------------------
db2linear(l) = pow(10, l/20.0);
db2linear(l) = pow(10.0, l/20.0);


//-------`(ba.)linear2db`----------
Expand Down Expand Up @@ -554,7 +554,7 @@ pulse_countdown(trig) = - ~ _ * trig;
//
// Where:
//
// * `n`: the highest number of the countup (included) before reset to 0.
// * `n`: the highest number of the countup (included) before reset to 0
// * `trig`: the trigger signal (1: start at next pulse; 0: reset to 0)
//------------------------------------------------------------------------------
//TODO: author "Vince"
Expand Down Expand Up @@ -596,7 +596,7 @@ resetCtr(n,m) = _ <: (_,pulse_countup_loop(n-1,1)) : (_,(_==m)) : *;
//
// Where:
//
// * `n`: the highest number of the countup (included) before reset to 0.
// * `n`: the highest number of the countup (included) before reset to 0
// * `trig`: the trigger signal (1: start at next pulse; 0: reset to 0)
//------------------------------------------------------------------------------
//TODO: author "Vince:
Expand Down Expand Up @@ -976,7 +976,7 @@ with {
// ```
//
// In any case the `x_{i}` must be in increasing order (for all `i`, `x_{i} < x_{i+1}`).
// For example the following definition :
// For example the following definition:
//
// ```
// f = bpf.start(x0,y0) : ... : bpf.point(xi,yi) : ... : bpf.end(xn,yn);
Expand Down Expand Up @@ -1629,7 +1629,7 @@ slidingRMSp(n,maxn) = pow(2) : slidingMeanp(n,maxn) : sqrt;
// where:
//
// * `n`: the number of parallel inputs
// * `op`: the operator. needs to be a commutative one.
// * `op`: the operator which needs to be a commutative
//
//------------------------------------------------------------------------------

Expand All @@ -1638,7 +1638,7 @@ parallelOp(op,2) = op;
parallelOp(op,n) = op(parallelOp(op,n-1));

//---------------------------`(ba.)parallelMax`---------------------------------
// The maximum of n parallel inputs
// The maximum of n parallel inputs.
//
// #### Usage
//
Expand All @@ -1653,7 +1653,7 @@ parallelOp(op,n) = op(parallelOp(op,n-1));
parallelMax(n) = parallelOp(max,n);

//---------------------------`(ba.)parallelMin`---------------------------------
// The minimum of n parallel inputs
// The minimum of n parallel inputs.
//
// #### Usage
//
Expand All @@ -1668,7 +1668,7 @@ parallelMax(n) = parallelOp(max,n);
parallelMin(n) = parallelOp(min,n);

//---------------------------`(ba.)parallelMean`---------------------------------
// The mean of n parallel inputs
// The mean of n parallel inputs.
//
// #### Usage
//
Expand All @@ -1683,7 +1683,7 @@ parallelMin(n) = parallelOp(min,n);
parallelMean(n) = si.bus(n):>_/n;

//---------------------------`(ba.)parallelRMS`---------------------------------
// The RMS of n parallel inputs
// The RMS of n parallel inputs.
//
// #### Usage
//
Expand All @@ -1695,7 +1695,7 @@ parallelMean(n) = si.bus(n):>_/n;
//
// * `n`: the number of parallel inputs
//------------------------------------------------------------------------------
parallelRMS(n) = par(i, n, pow(2)):parallelMean(n) : sqrt;
parallelRMS(n) = par(i, n, pow(2)) : parallelMean(n) : sqrt;


//////////////////////////////////Deprecated Functions////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion signals.lib
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ block(n) = par(i, n, !);
//
// * `i`: interpolation control between 0 and 1 (0: first input; 1: second input)
//-----------------------------------------------------------------------------
interpolate(i) = *(1.0-i),*(i) : +;
interpolate(i,x,y) = x + i*(y-x);

//------------------------`(si.)smoo`---------------------------------------
// Smoothing function based on `smooth` ideal to smooth UI signals
Expand Down

0 comments on commit 27ad2f6

Please sign in to comment.