+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 20 of 50

Thread: CORDIC for dummies

  1. #1

    Default CORDIC for dummies

    Hey guys (and gals), way back in the SX days I got interested in CORDIC. And since Chip said the Propeller 2 would have a CORDIC engine, I thought I would create a tutorial explaining how CORDIC works.

    When I started I had NO idea how the stuff worked, and it took quite a bit of experimenting until I was satisfied that I understood it. In the process I kept some notes. These notes have been expanded into this tutorial. It is still a work in progress, but I didn't want to get too far along if it doesn't make sense so far.

    If you are interested in CORDIC and have a couple of minutes would you please read though this and give me your comments and suggestions.

    Hopefully I'll have something worthwhile by the time the P2 comes out.



    [Edit] I have fixed the math for the example at the end. It makes sense now.
    I have updated the PDF.
    I have updated the PDF again Nov 22, 2010
    I have updated the PDF again Nov 23, 2010
    Attached Files Attached Files
    Last edited by Bean; 11-23-2010 at 05:09 PM. Reason: Updated PDF

  2. #2

    Default Re: CORDIC for dummies

    Bean that was some very nice explanation you wrote there, and the best of it was that it was machine/implementation agnostic. I'd complement it with some nice code, add the "bring to range" part and ship it.

    Miss-spelling "Since we want to find degrees, instead of simply adding and subtraction a value"

    Should be "Since we want to find degrees, instead of simply adding and subtracting a value"

    great work !

  3. #3

    Default Re: CORDIC for dummies


    First off, before reading this, I wasn't familiar with CORDIC at all. I think I understand it now after reading this doc, so thanks. Below are my thoughts while reading the document.

    The first page is describing a binary search. In fact, the whole thing is just binary searching in different "spaces".

    The last two pages use << (shift up), but shouldn't it be >> (shift down) instead? Since you are multiplying by 0.5, 0.25, 0.125, etc.. that is actually divide by 2, 4, 8, etc. Which means you want shift down, not shift up. Maybe I missed something?

    Also, on the last page you say:
    X = 262 (223.607 is the real radius, so we scale by 0.85346 for any points)
    Is that scaling factor really valid for any input values of X,Y? Or is it just close enough to be "good enough"?
    Last edited by Roy Eltham; 11-18-2010 at 01:52 PM.

  4. #4

    Default Re: CORDIC for dummies

    @Roy, Yeah, you're right that should be >> instead of <<. And yes, that scale is for ANY point as long as you do the same number of loops.

    One thing I thought when X=2*Y that was a 30 degree angle, but ATAN(0.5) gives 26.565 ???

    Or is a 30 degree angle when the hyp is 2*X ???

    Anyway I will go through all the math before I finalize it and make sure it is all correct.

    I also want to make some graphs and maybe even a propeller TV demo showing the process.

    Last edited by Bean; 11-18-2010 at 01:58 PM.

  5. #5

    Default Re: CORDIC for dummies

    Excellent explanation of Cordic. I was aware of the technique, but not the name. I thought of it as a form of binary search. It is applicable to solving a wide range of calculations/problems.

  6. #6

    Default Re: CORDIC for dummies

    I have found that I have a wrong sign in the math for the final forumla and example.
    I will fix them and re-post.


  7. #7

    Default Re: CORDIC for dummies

    Okay, I fixed the math and reposted it.

    Thanks for the comments so far.


  8. #8

    Default Re: CORDIC for dummies

    Great post Bean

  9. #9

    Default Re: CORDIC for dummies

    I first encountered Cordic in Beau Schwabe's HM55B object and never did understand it even after reading several papers I found on the web. Mostly because my math education was 40 years ago. I was however able to lift it from that object and and use it in the navigation code of a robot I created even if I didn't understand it. After reading this - I get it!! -- Your paper here is clear consice and completely understandable well done!!

    I humbly offer here my Trig object with thanks to both you and Beau
    Attached Files Attached Files

  10. #10

    Default Re: CORDIC for dummies


    That's great, thank you.

    Do you think you could do a work like that on the Fast Fourier Transform? The workings of which have avoided lodging in my brain for decades now

  11. #11

    Default Re: CORDIC for dummies

    Nice explanation. If also me, with my bad English, have get it that mean you have done an excellent job.
    Propeller Object Exchange (last Publications / Updates) --- Oldbitcollector's guest map

  12. #12

    Default Re: CORDIC for dummies


    That makes it just too easy!

    All I knew about CORDIC was that it's a way of doing math with a microcontroller.

    Is anyone out there writing a PASM book? If there isn't one in the works, you should take it up. Your CORDIC tutorial was very easy to understand. I feel like I'm starting to understand PASM myself but I sure wish I had a nice tutorial to follow.

    I'd be very interested in any other tutorials you create.

    Thank you,

    Duane Degn

  13. #13

    Default Re: CORDIC for dummies


    Read the new version, and I noticed that you fixed the <<'s to be >>'s on page 6, but on page 5 it's still got them ad <<'s. Other then that, it looks great.

  14. #14

    Default Re: CORDIC for dummies

    Wow, Bean, very cool! Once the laity sees this, the high priests will be out of a job!


  15. #15

    Default Re: CORDIC for dummies

    Roy, Thanks for catching that.

    I just fixed it and added a bit of a explaination and graph on the first page. Reposted just now.


  16. #16

    Default Re: CORDIC for dummies

    Hi, great. Maybe you could add in the first "guessing", that this is called successive approximation and just the way a SAR-ADC is working. That would give another link. The method is also known from math to determine the zero crossing of a functions graph.

  17. #17
    prof_braino's Avatar
    Between the pit of man's fears and the summit of his knowledge
    Blog Entries

    Default Re: CORDIC for dummies

    This is excellent work. Even I could understand it.

    My only comment will be to re-consider the unfortunate title.

    "CORDIC for Beginners" or similar would have much less negative connotation than "dummies".

    The "for dummies" series has a negative connotation from, of course, the words dummies, and from its use in media by character that demonstrate stupidity after glancing at one on the books. In real life, the "Brain Surgery for Dummies" book proved to be a total rip-off, the subject did not show any measurable improvement before expiring.

    Otherwise it great.

    Do you do educational stuff professionally?

  18. #18

    Default Re: CORDIC for dummies


    Some years ago I may have had the same objection to the use of "dummies" in the title. But the "bla bla for Dummies" thing is part of the culture now and one knows what to expect when one sees it. In most part due to the series of books I guess.

    Also in this case I think it fits better than other alternatives. such as "Introduction to...." or "...for beginners."

    Why is that?

    Well if you are a beginner there are already pages for you on wikipedia and other places.

    They for beginners and are quite fine but boom, you are immediately hit in the face with matrix notation and other such things that get in the way for dummies, err I mean, the mathematically uninitiated.

    This document demonstrates my long held belief that there are many brilliant but ultimately simple concepts in mathematics that almost anyone could understand if they could be presented in such a way as to avoid the blindness and confusion brought on by the symbols of mathematics itself.

    For example, the way it is possible in calculus to divide zero by zero and get a meaningful result, the slope of a line.
    Last edited by Heater.; 11-19-2010 at 01:37 PM.

  19. #19

    Default Re: CORDIC for dummies


    awesome stuff! and I hate math ;-)

    on page 6:
    Continuing on, the angle would be for 0.25, turns out to be 14.03624347

    I assume something like:
    Continuing on, we calculate what the angle would be for 0.25, which turns out to be 14.blahblah

  20. #20

    Default Re: CORDIC for dummies

    I second that. I'm taking communications theory course that should be renamed 'Fourier, Fourier, and more Fourier', yet even the the textbook doesn't try to explain FFT. No matter how many times I read up on it, I just don't get it.

    Quote Originally Posted by Heater. View Post
    Do you think you could do a work like that on the Fast Fourier Transform? The workings of which have avoided lodging in my brain for decades now
    Jay Kickliter

    www.chasingtrons.com (projects and tutorials)

+ Reply to Thread

Similar Threads

  1. CORDIC vs BKM
    By Mark Swann in forum Propeller 1 Multicore Microcontroller
    Replies: 13
    Last Post: 04-21-2015, 04:31 PM
  2. CORDIC Math
    By Mike Huselton in forum Propeller 1 Multicore Microcontroller
    Replies: 0
    Last Post: 08-26-2008, 11:18 AM
  3. Some CORDIC documentation
    By Graham Stabler in forum Propeller 1 Multicore Microcontroller
    Replies: 128
    Last Post: 04-23-2007, 04:20 PM
  4. cordic algorithmen
    By Peter Verkaik in forum Javelin Stamp
    Replies: 0
    Last Post: 12-26-2005, 09:25 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts