# Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

```On Fri, Feb 22, 2019 at 9:08 AM robert bristow-johnson <
r...@audioimagination.com> wrote:```
```
> i just got in touch with Olli, and this "triangle wave to sine wave"
> shaper polynomial is discussed at this Stack Exchange:
>
>
>
> https://dsp.stackexchange.com/questions/46629/finding-polynomial-approximations-of-a-sine-wave/46761#46761
>
I'll just summarize the results here. The polynomials f(x) approximate
sin(pi/2*x) for x=-1..1 and are solutions with minimum peak harmonic
distortion compared to the fundamental frequency. Both solutions with
continuous and discontinuous derivative are given. In summary:

Shared polynomial approximation properties and constraints:
x = -1..1, f(-1) = -1, f(0) = 0, f(1) = 1, and f(-x) = -f(x).

If continuous derivative:
f'(-1) = 0 and f'(1) = 0 for the anti-periodic extension f(x + 2) = -f(x).

5th order, continuous derivative, -78.99 dB peak harmonic distortion:
f(x) = 1.569778813*x - 0.6395576276*x^3 + 0.06977881382*x^5

5th order, discontinuous derivative, -91.52 dB peak harmonic distortion:
f(x) = 1.570034357*x - 0.6425216143*x^3 + 0.07248725712*x^5

7th order, continuous derivative, -123.8368 dB peak harmonic distortion:
f(x) = 1.570781972*x - 0.6458482979*x^3 + 0.07935067784*x^5
- 0.004284352588*x^7

7th order, discontinuous derivative, -133.627 dB peak harmonic distortion:
f(x) = 1.5707953785726114835*x -
0.64590724797262922190*x^3 + 0.079473610232926783079*x^5
- 0.0043617408329090447344*x^7

Also the exact coefficients that are rational functions of pi are given in
the answer, in case anyone needs more precision.

-olli
```
```_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp```