Timeline for Finding polynomial approximations of a sine wave
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 28, 2018 at 14:56 | comment | added | Olli Niemitalo | @Guest nah, I use symbolic math software. | |
Jan 28, 2018 at 14:07 | comment | added | Guest | @OlliNiemitalo, don't tell me you pulled all those giant numbers out of your head? ;) | |
Jan 26, 2018 at 22:14 | comment | added | robert bristow-johnson | so i dunno about you, but the parametric function, in my case had to be of a form that the computer or DSP device could efficiently evaluate. adding and multiplying numbers is something they do natively. so a low-order polynomial is a natural form to use. then the parameters are simply the coefficients. you have 2 equations (from the two constraints) and 3 unknowns, then the "optimal" criteria i used was to minimize the amplitude of the loudest harmonic that is not the fundamental. that can be done with "hunting". | |
Jan 26, 2018 at 21:49 | comment | added | Guest | @robertbristow-johnson the main thing I got from your answer that I hadn't considered before was that I should find a parametric function that meets the three requirements listed; then it's just a matter of finding the parameter(s) giving the best fit. Seems obvious in retrospect. The simplest parametric function I've found so far is $2x^p-x^{2p}$, with p being about 10/9. | |
Jan 25, 2018 at 20:35 | comment | added | robert bristow-johnson | i am traveling and just can't take the half hour to scrabble together a MATLAB script. but use the polynomial to generate, say, the middle 128-point segment of a 256-point FFT. and use the symmetry of the $\sin()$ to copy the other two 64-point segments. then you have one "perfect" 256-point cycle of the sine. then FFT and all of the energy should be in bins 1 and 255 (or, using MATLAB's stupid 1-origin indexing, in elements 2 and 256 of the MATLAB array). but the 3rd harmonic and the 5th harmonic won't be zero because it isn't a perfect sine. | |
Jan 25, 2018 at 4:11 | vote | accept | Guest | ||
Jan 25, 2018 at 4:11 | comment | added | Guest | This really is a brilliant solution, just took a while to sink in. I hope marking it correct won't stop someone else from coming along and writing the code. | |
Jan 24, 2018 at 15:15 | comment | added | robert bristow-johnson | 5th order will still be a better fit than 3rd order. | |
Jan 24, 2018 at 1:12 | comment | added | Guest | Must have been half asleep when I posted that "sketch," I meant to do something like this, but corrected to run through ±1 and have zero slope (can just take the derivative, fiddle around with it, integrate it again). Not sure if there's any advantage over fifth-order, just something I hadn't considered yet. | |
Jan 23, 2018 at 16:44 | comment | added | Speedy | This is a beautiful approach. I wonder if instead of taking the FFT and solving iteratively you could form the third- and fifth-order Chebyshev polynomials from your $f(x)$, then equate the two and solve for $a_1$? | |
Jan 23, 2018 at 16:39 | comment | added | Guest | Great answer, still digesting it. Actually starting to wonder if it needs to be a 3-coefficient, 5th-order, odd-symmetrical polynomial ... Could your f'(x) actually be f(x) and be a piecewise deal around 0? Rough sketch here. Maybe this is what Ced has in mind? Still catching up to you guys. | |
Jan 23, 2018 at 16:07 | comment | added | robert bristow-johnson | i will definitely not have time to do the MATLABing to hunt for the optimal $a_1$ so that the 3rd harmonic is equal to the 5th harmonic, about 70 dB below the fundamental (1st harmonic). someone else needs to do that. sorry. | |
Jan 23, 2018 at 16:00 | history | edited | robert bristow-johnson | CC BY-SA 3.0 |
added 31 characters in body
|
Jan 23, 2018 at 14:20 | history | edited | robert bristow-johnson | CC BY-SA 3.0 |
added 2 characters in body
|
Jan 23, 2018 at 14:14 | history | edited | robert bristow-johnson | CC BY-SA 3.0 |
added 280 characters in body
|
Jan 23, 2018 at 13:37 | history | answered | robert bristow-johnson | CC BY-SA 3.0 |