Sine Table Interpolation

NoMoreZealots picture NoMoreZealots · Jul 22, 2009 · Viewed 8.4k times · Source

I want to put together a SDR system that tunes initially AM, later FM etc. The system I am planning to use to do this will have a sine lookup table for Direct Digital Synthesis (DDS). In order to tune properly I expect to need to be able to precisely control the frequency of the sine wave fed to the Mixer (multiplier in this case). I expect that linear interpolation will be close, but think a non-linear method will provide better results.

What is a good and fast interpolation method to use for sine tables. Multiplication and addition are cheap on the target system; division is costly.

Edit: I am planning on implementing constants with multiply/shift functions to normalize the constants to scaled integers. Intermediate values will use wide adds, and multiplies will use 18 or 17 bits. Floating point "pre-computation" can be used, but not on the target platform. When I say "division is costly" I mean that it has to implemented using the multipliers and a lot of code. It's not unthinkable, but should be avoided. However, true floating point IEEE methods would take a significant amount of resources on this platform, as well as a custom implementation.

Any SDR experiences would be helpful.

Answer

Nick Dandoulakis picture Nick Dandoulakis · Jul 22, 2009

If you don't get very good results with linear interpolation you can try the trigonometric relations.

Sum and Difference Formulas

sin(A+B)=sinA*cosB + cosA*sinB
sin(A-B)=sinA*cosB - cosA*sinB
cos(A+B)=cosA*cosB - sinA*sinB
cos(A-B)=cosA*cosB + sinA*sinB

and you can have precalculated sin and cos values for A, B ranges, ie

A range: 0, 10, 20, ... 90
B range: 0.01 ... 0.99