diff --git a/interpolators.lib b/interpolators.lib index 084f5de3..5cee296d 100644 --- a/interpolators.lib +++ b/interpolators.lib @@ -137,6 +137,7 @@ declare version "0.3"; ba = library("basics.lib"); ro = library("routes.lib"); ma = library("maths.lib"); +si = library("signals.lib"); reset(trig) = (trig-trig') <= 0; @@ -490,9 +491,7 @@ declare lagrangeN author "Dario Sanfilippo"; declare lagrangeN copyright "Copyright (C) 2021 Dario Sanfilippo "; declare lagrangeN license "LGPL v3.0 license"; -lagrangeN(N, idx) = - lagrange_h(N, idx) , - si.bus(N + 1) : ro.interleave(N + 1, 2) : par(i, N + 1, *) :> _; +lagrangeN(N, idx) = si.dot(N + 1, lagrange_h(N, idx)); // ----------------------------------------------------------------------------- // ---------- `(it.)frdtable(N, S)` -------------------------------------------- diff --git a/oscillators.lib b/oscillators.lib index 8bd08409..a3c256c9 100644 --- a/oscillators.lib +++ b/oscillators.lib @@ -65,7 +65,8 @@ pl = library("platform.lib"); // // * `tablesize`: the table size //------------------------------------------------------------ -sinwaveform(tablesize) = float(ba.time)*(2.0*ma.PI)/float(tablesize) : sin; +sinwaveform(tablesize) = + sin(float(ba.period(tablesize)) * (2.0 * ma.PI) / float(tablesize)); //-----------------------`(os.)coswaveform`------------------------ // Cosine waveform ready to use with a `rdtable`. @@ -80,7 +81,8 @@ sinwaveform(tablesize) = float(ba.time)*(2.0*ma.PI)/float(tablesize) : sin; // // * `tablesize`: the table size //------------------------------------------------------------ -coswaveform(tablesize) = float(ba.time)*(2.0*ma.PI)/float(tablesize) : cos; +coswaveform(tablesize) = + cos(float(ba.period(tablesize)) * (2.0 * ma.PI) / float(tablesize)); //-----------------------`(os.)phasor`------------------------ // A simple phasor to be used with a `rdtable`.