[Audacity-nyquist] 1st derivative

 [Audacity-nyquist] 1st derivative From: paul beach - 2010-05-20 21:48:53 ```Help wanted: There should be a subroutine for (bernstein-list p0 .... pn, dp) ; dp means number of data points. http://mathworld.wolfram.com/BernsteinPolynomial.html which would be used for (pwlv-list bernstein) This is trivial for 4 points, which was mentioned by Steve. There is a little problem with that version. The Bezier curve is a parametric equation. x = B(t,x) y = B(t,y) Just use Berntstein(t,x): Otherwise, the piece-wise function could have 3 or 4 values for one value of time. WHY Roger explains: "If the first derivative is continuous, the signal falls off at 18dB per octave, and each additional continuous derivative gives another 6dB of rolloff. Since we are sensitive to higher frequencies, it's better not to introduce discontinuities." This is contrary to the envelope tools in Nyquist, which introduce triangular notches. Sub bernstein() bt = 0# t = 0 p1 = 1#: p2 = 3#: p3 = 0#: p4 = 1# For i = 1 To 11 bt = (1 - t) ^ 3 * p1 + 3 * (1 - t) ^ 2 * t * p2 + 3 * (1 - t) * t ^ 2 * p3 + t ^ 3 * p4 Cells(i, 1) = t Cells(i, 2) = bt t = t + 0.1 Next i End Sub -- paul beach sniffyraven@... ```