Sine Lookup Table with Linear Interpolation

formatting link

One of many reasons i hate Adobe Reader 7.0: along near the top is a number of cons, one is the so-called hand tool and it defaults as "selected" - BUT you see the "hand" only while moving the cursor and when you stop that changes to the "select tool" so that it is IMPOSSIBLE to move the page around. When moving the hand, the mouse will highlight text if push left button; CANNOT grab!!!!!!!!!!!!!!! That always works in 4.0 .. Newer versions are worse.

Reply to
Robert Baer
Loading thread data ...

formatting link

The basic approach given there is very good; use of puny 4 or 5 digit tables is a major weakness: sqrt(2)/2 as 0.7071 is junk; CRC in the squares, cubes and roots section gives sqrt(2) as 1.414214 (6 digits) and sqrt(50) as 7.07168 (also 6 digits). And if one needs more, use the Taylor series (for reasonably small angles) as it converges fast (Nth odd power and Nth odd factorial). --or, use the FPU in the computer to get SIN and COS at the same time!

Reduction from 360 degrees helps: "Split" 180 degrees: sin(-x)=-sin(x) "Split" 90 degrees: sin(180-x)=sin(x) "Split" 45 degrees: sin(90-x)=cos(x) "Split" 22.5 degrees: (sqrt(0.5)*(cos(x)-sin(x)) Small angles requires less iterations for a given accuracy.

Reply to
Robert Baer

formatting link

But, but, but, but,.... we work in radians!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Except maybe a carpenter!

Jamie

Reply to
Jamie

If you just type "CORDIC FPGA" in Google it's the third link that comes up.

Eric Jacobsen Anchor Hill Communications

formatting link

Reply to
Eric Jacobsen

(snip)

For a long time (years) I was using 5.0 because it had some features that later ones didn't. I had 8.0 for the cases where that failed, but you can't run both at once. If you run another one, it just passes the file to the first one.

Some time ago, I wrote a program to generate LZW compressed PDF from scanned bitmaps as PDF 1.0 files. (Among other things, only the usual 7 bit ASCII is allowed.)

Later, I wrote on for JBIG2 compression, which I believe is 1.2 (That is, Acrobat 3.0.)

But yes, many files require newer versions.

-- glen

Reply to
glen herrmannsfeldt

But not so bad for 43 years ago!

That was close to the beginning of MOS mask ROMs. It requires a 12V power supply, though the outputs are still TTL compatible, using both -12V and +5V power supplies.

-- glen

Reply to
glen herrmannsfeldt

On 3/19/13 12:05 AM, glen herrmannsfeldt wrote: ...

my goodness we're old, glen.

--

r b-j                  rbj@audioimagination.com 

"Imagination is more important than knowledge."
Reply to
robert bristow-johnson

I'm glad it's just you guys. ;)

Eric Jacobsen Anchor Hill Communications

formatting link

Reply to
Eric Jacobsen

what was that EPROM? a 2716 or 2708 or something like that?

--

r b-j                  rbj@audioimagination.com 

"Imagination is more important than knowledge."
Reply to
robert bristow-johnson

yeah, you're right, I looked at the code on the wikipedia page and it was full of multiplies, but looking closer reveals they are all shifts and sign changes.

--
?? 100% natural 

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Reply to
Jasen Betts

(snip, I wrote)

As I remember it, the 2708 requires +12, +5, and -5V. Also, the programmer has to put pulses of just the right current/voltage and timing into the data pins when writing.

The Intel 2716 is 5V only, and for writing the data pins are at TTL levels. Only one pin needs to have an appropriate timed pulse.

But the TI 2716 is more like the 2708.

-- glen

Reply to
glen herrmannsfeldt

I have always felt that in terms of the UI, Acrobat was one of the

*worst* commercial software packages I have ever seen and every new version just gets worse. On top of that, they seem to produce much more buggy code than most. I used it in one job as part of our "ISO" process for document sign off. This part of the tool was so bad that it actually impacted out productivity and not in a positive way. Yet, big companies continue to buy the tool because it is the one with the most professional image. Its not like companies actually test this stuff...
--

Rick
Reply to
rickman

formatting link

So?? Convert already - or are you one of those heathens or worse, infidels?

Reply to
Robert Baer

The other question is why bother with linear interpolation when you can have quadratic accuracy with only a little more effort?

It is obvious from the shape of the sine curve!

Classic sin(A+B) = sin(A)cos(B)+cos(A)sin(B)

If A is the actual nearest lookup and B

Reply to
Martin Brown

Without reading any other replies, i would suggest either the CORDIC algorithm of simpson's rule interpolation. From the rule for integration to find any intermediate value you evaluate the curve value within the segment covered by rule. 4 intervals on the step size you have will be limited by the 18 bits of input. Do 20 bits of input and round to 18 or not. About 1 PPM.

?-)

Reply to
josephkk

I can't say I follow what you mean about Simpson's rule interpolation. Interpolation is used to derive Simpson's Rule, but I don't see a way to use an integral for obtaining an interpolation. Isn't Simpson's Rule about approximating integrals? What am I missing?

--

Rick
Reply to
rickman

degrees

the

the

maximum

but

2^(n+1)

segment,

equal

Hmm. I would like to take a crack at simpson's rule interpolation for this to measure error budget. I may not be timely but this is interesting. joseph underscore barrett at sbcglobal daht cahm

?-)

Reply to
josephkk

to

is

me

of

segment

One

for

makes a

is

sized

a

the

exact

done

this,

(approx).

get

the

formatting link

No multipliers(?); ouch. My Simpson's rule method may fit but it will need a trapezoidal strip out of a full Wallace tree multiplier. Preferably three (speed issue, that may not be that big for you). How do you do the linear interpolation without a multiplier?

?-)

Reply to
josephkk

about

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Thranx a bunch. But then you are a goto kind of guy.

?-)

Reply to
josephkk

the

ho-hum

("bounce"

I agree. 45 degree sine and cosine table will do the job as will a 90 degree sine or cosine table.

?-)

Reply to
josephkk

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.