J
Joerg
Guest
upsidedown@downunder.com wrote:
the cheaper MSP430's have it. I know one guy who had the uC calculate
most of what would normally in the LUT, on the fly, all the time.
Because memory space is the typical constraint.
So far it looks like I'll do it in an analog fashion, at least initially.
--
Regards, Joerg
http://www.analogconsultants.com/
Noise is what we really can't have in the output.On Tue, 06 Aug 2013 17:11:26 -0700, Joerg <invalid@invalid.invalid
wrote:
1/4 cycle of 10kHz into a 1MHz DAC is only 25 samples. what size of
LUT do you need?
Since we need to do very fine phase shifts at resolutions of 16bit or so
there would have to be lots of LUT sets or 25 each. Haven't calculated
it but it'll probably be in the thousands. Phase has to be adjusted to
milli-degrees.
While you need a big phase accumulator, say 32 bits for that
resolution, however only a few of the top bits of the phase
accumulator is used to address the LUT and is used to drive the DAC.
Please remember to look at the produced sine wave _after_ the
reconstruction (low pass) filter, the truncated phase and amplitude
values will show up as increased noise levels of the output, put the
phase/frequency resolution is determined by the size of the phase
accumulator.
A HW multiplier wouldn't be a big deal anymore, these days even some ofIf you need a smaller LUT, use the highest phase accumulator bits X to
address the element in the LUT and extract some fractional bits x. In
each LUT element in addition to the sin(X) value, there is also stored
one (or more) multipliers a (and b) to be multiplied with the
fractional bits. thus
sin(X.x) is approximated with sin(X) + a*x ( + b*x˛)
This of course assumes hardware single cycle multiply (at least 8x8
bits). This will reduce the LUT table required and hence store the
full cycle, avoiding the quadrant selection.
Without good hardware multiplier, the element specific multiplier a
could be replaced with a shift count, telling how many bits the
fractional bits x should be shifted to right before adding to sin(X).
These are approximate methods, but to get exact values the
trigonometric relationship
sin(X.x) = sin(X)cos(x) + cos(X)sin(x)
Requiring four LUTs, two multiplys and one addition.
Note that for small values of x, sin(x) is quite close to x when
expressed in radians and cos(x) for small values for x is quite close
to 1, some simplifications can be done.
the cheaper MSP430's have it. I know one guy who had the uC calculate
most of what would normally in the LUT, on the fly, all the time.
Because memory space is the typical constraint.
So far it looks like I'll do it in an analog fashion, at least initially.
--
Regards, Joerg
http://www.analogconsultants.com/