Shop OBEX P1 Docs P2 Docs Learn Events
I'm looking for a ChebyChev Tutorial — Parallax Forums

I'm looking for a ChebyChev Tutorial

BeanBean Posts: 8,129
edited 2009-08-07 10:27 in General Discussion
Yesterday I was reading through the ZX81 ROM Disassembly (okay I admit it....I'm a nerd) and I was interested in how it calculated functions like SIN, COS, etc. And it turns out that it uses Chebychev and there is some documentation about how it works but I still cannot get my head around it's function. It uses only addition, subtraction and multiplication to calculate these trig functions.

Does anyone know of a good tutorial for chebychev. I've looked at a couple hits from google, but alot of them are for some kind of chebychev filter.

If you know of one please post a link in this thread.

Thanks,
Bean.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Does that byte of memory hold "A", 65, $41 or %01000001 ?
Yes it does...




Post Edited (Bean (Hitt Consulting)) : 8/6/2009 12:12:25 PM GMT

Comments

  • LeonLeon Posts: 7,620
    edited 2009-08-06 14:00
    Try Chebyshev polynomials.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-06 15:53
    Here's a pretty good intro: en.wikipedia.org/wiki/Chebyshev_polynomials.

    -Phil
  • LeonLeon Posts: 7,620
    edited 2009-08-06 16:43
    Ordinary Taylor series work very well. ADI uses them for their fixed-point DSPs.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-06 23:08
    Some Taylor series converge very slowly. Depending on the function, you will get more bang per MIPS using a Chebyshev approximation.

    -Phil
  • $WMc%$WMc% Posts: 1,884
    edited 2009-08-07 02:36
    Cool

    I took a look at the "wiki" page. It looked like Greek to me until I scrolled down to the simple stuff "ADD,SUB,DIV"etc. It looked some what familiar But I couldn't place it. I later went back and read the article a little more and studied the graphs of sine waves.And then it hit me. I had seen this same NOMIALY or POLYNOMIALLY (I not sure witch) while working on a PARABOLIC REFLECTION project.

    This Chebyshev math is a major sort cut compared to what I've come up with in the past to deal with complex math.

    Thanks for the info.


    No I'm not a Nerd or a Mathematician and I don't laugh funny ether. Well I'm definitely not a Mathematician!!!


    ______________________$WMc$__________________

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
  • LeonLeon Posts: 7,620
    edited 2009-08-07 03:36
    Phil Pilgrim (PhiPi) said...
    Some Taylor series converge very slowly. Depending on the function, you will get more bang per MIPS using a Chebyshev approximation.

    -Phil

    This is what ADI uses for a sine approximation:

    sin(x) = 3.140625x + 0.02026367x^2 – 5.325196x^3 + 0.5446778x^4 + 1.800293x^5

    It only takes 25 clock cycles on the old ADSP-21xx DSPs.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-07 04:18
    Leon,

    I don't know where that formula came from, but it's definitely not a truncated Taylor series. The Taylor series expansion for sin(x) has no non-zero coefficents for the even powers of x:

    ····sin(x) = x - x3/3! + x5/5! - x7/7! + ...

    If it's a correct formula, it's probably a Chebyshev, or related, polynomial approximation.

    -Phil

    Addendum: Here is a reference (PDF) for Leon's formula: phobos.iet.unipi.it/~pieri/EdT2/2181_Manual/Chapter_14.pdf. It doesn't explain the origin of the approximation, though.

    Post Edited (Phil Pilgrim (PhiPi)) : 8/7/2009 5:30:42 AM GMT
  • LeonLeon Posts: 7,620
    edited 2009-08-07 10:27
    ADI mentioned Taylor and MacLaurin series and then used something different, probably from Burrington, R.S. 1973. Handbook of Mathematical Tables and Formulas, as they give it as a reference. They used regression techniques to optimise the coefficients.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 8/7/2009 10:32:24 AM GMT
Sign In or Register to comment.