Sine Lookup Table with Linear Interpolation

The

The calculation can be done (most spice versions will do this, even excel can be used), but that doesn't mean that bench testing will give the same results. The calculation must be done on the final value series.

?-)

Reply to
josephkk
Loading thread data ...

as

for

improve

not a

How do you get that? All harmonics would be within the 90 degree table. Harmonic phase shifts is a different matter though, that would take careful characterization of production quantities of the final product, $$$$$.

?-)

Reply to
josephkk

(snip, someone wrote)

The LUT is indexed by the high (4) bits of the input and the low bits to interpolate with. So it is, pretty much, 16 different interpolation tables which, in other words, is multiply by table lookup.

-- glen

Reply to
glen herrmannsfeldt

THD. The

segments and

degree

I am

within ±1

an

passes

But

to be

the

answer

distortion!

ARBs. The

good Ls and

nowhere near

Which is how most old school distortion analyzers work. Pop'tronics did a four part series on one that used auto-tuned parallel-t filters with over

80 db fundamental notch rejection in the late 60s or early 70s. Realy a slick design in a lot of ways, especially for a hobby mag.

?-)

Reply to
josephkk

The

distortion!

The

and

near

That's how the HP339A works, with photoresistors used to fine tune the notches. There was an equivalent Heathkit.

It gets challenging at higher frequencies (MHz) and really low distortion levels.

--

John Larkin                  Highland Technology Inc 
www.highlandtechnology.com   jlarkin at highlandtechnology dot com    

Precision electronic instrumentation 
Picosecond-resolution Digital Delay and Pulse generators 
Custom timing and laser controllers 
Photonics and fiberoptic TTL data links 
VME  analog, thermocouple, LVDT, synchro, tachometer 
Multichannel arbitrary waveform generators
Reply to
John Larkin

Second?

Of course you'd have to null each harmonic for gain and phase, preferably on each production unit, but it wouldn't be difficult or expensive *if* you had a distortion analyzer with the required PPM performance. We regularly do automated calibrations, polynomial curve fits and such, more complex than this.

--

John Larkin         Highland Technology, Inc 

jlarkin at highlandtechnology dot com 
http://www.highlandtechnology.com 

Precision electronic instrumentation 
Picosecond-resolution Digital Delay and Pulse generators 
Custom laser drivers and controllers 
Photonics and fiberoptic TTL data links 
VME thermocouple, LVDT, synchro   acquisition and simulation
Reply to
John Larkin

formatting link

I can do multiplies without a multiplier block. It gets to be problematic to do a *lot* of multiplies. The interp will be done in a shift/add type multiplier as well as the 8 bit amplitude multiplier for the scale factor (which is already in an existing product). The CODEC I am using has 128 clock cycle per sample so there is time to use a serial Booth's multiplier or two.

--

Rick
Reply to
rickman

Oh, I thought you were talking about using Simpsom's rule as part of the interpolation. You are talking about using it to estimate the integral of the error. Great idea! I'll shoot you an email.

--

Rick
Reply to
rickman

That is the poor man's LUT approach where the resources are precious. It requires a "coarse" table using the high and mid bits of the input and a second table indexed by the high and low bits of the input for a correction. I have a 512x18 LUT available and in fact, it is dual ported for simultaneous access if needed. This by itself gives pretty good results. The linear approximation would be done with a serial/parallel Booth's two technique using n clock cycles where n is the number of bits in the multiplier. I've got some time for each sample and expect to share the hardware between two channels.

--

Rick
Reply to
rickman

...

that's sorta the case for even the middle-class man's LUT and interpolation. you're always splitting a continuous-time parameter (however many bits are used to express it) into an integer part (that selects the set of samples used in the interpolation) and a fractional part (that defines how this set of samples are to be combined to be the interpolated value).

--

r b-j                  rbj@audioimagination.com 

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

Actually this would not work for anything except odd harmonics. The way the table is folded they have to be symmetrical about the 90 degree point as well as the X axis at 0 and 90 degrees. Odd harmonics would do this if they are phased correctly. I don't think it would be too useful that way.

Might as well use a separate table for the nulling, it would be much simpler.

--

Rick
Reply to
rickman

to

ure

way

do

ful

t,

(32

p

q.

r
g

the

well the DDS chips work just like you describe, an accumulator but instead of generating a triangle and shaping it, the MSBs index a sinewave table going to a DAC

you can do with one quadrant of sine table, with MSB-1 you can chose 2nd,4rd quadrant, invert the bits indexing the sinewave (makes the index count "in reverse")

MSB choose 1st,2nd or 3rd,4th quadrant, for 3rd and 4th negate the sinewave output

-Lasse

Reply to
langwadt

What ever happen to the good old days of generating sine waves via digital instead of using these DDS chips that no one seems to know exactly how they do it? Well, that seems to be the picture I am getting.

---- You need an incremintor (32 bit) for example, a phase accumulator (32 bits) and lets say a 12 bit DAC.

All this does is generate a +/- triangle reference via the phase accumulator. The 31th bit would be the sign which indicates when to start generating decal instead of acel, in the triangle output.

Using integers as your phase acc register, this will naturally wrap around. THe idea is to keep summing with the incriminator, which has been initially calculated verses the update time (sample) and desired freq.

Now since the DAC is only 12 bits, you use the MSB's as the ref for the DAC and the LSB (20 bits) for the fixed point integer math to get the needed precision.

Now that we have a nice triangle wave that can be past to a hybrid log amp, the rest is trivial.

Actually, today I was looking at one of our circuits that seem to be generating trapezoid on the (-) peak instead of sine and that was a log amp. Seems the transistor in the feed back failed some how and it most likely has been like that for a long time, no one never noticed it before...

And on top of that, years ago I've made sinewave oscillators from the RC point of a 555 timer that drove a log amp designed to give rather clean sinewaves.

Jamie

Reply to
Jamie

(snip, I wrote)

You could instead index one ROM with eight bits, giving the interpolation size (delta y) and then index another ROM with that, and the low for data bits. That would allow closer matching of the interpolation slope to the actual data.

Seems to me that someone started selling MOS ROMs and then designed some ready to sell.

One would have to go through the numbers to see how much difference it makes. This was before the EPROM. They final mask layer was generated from the data file from the user (in large enough quantities to make it worthwhile) or for the special case ROMs in the data book.

-- glen

Reply to
glen herrmannsfeldt

Just looking at a sine at F and one at 2F, it's obvious that the 90 degree folded table can't make the 2F component. The 2nd harmonic has to change sign between 0-90 degrees and 90-180 but can't if the same

90 degree table is used.

It's really about the same, but I guess if the main table is heavily interpolated, it would make sense to have a little distortion table off to the side, maybe even with its own DAC.

--

John Larkin         Highland Technology, Inc 

jlarkin at highlandtechnology dot com 
http://www.highlandtechnology.com 

Precision electronic instrumentation 
Picosecond-resolution Digital Delay and Pulse generators 
Custom laser drivers and controllers 
Photonics and fiberoptic TTL data links 
VME thermocouple, LVDT, synchro   acquisition and simulation
Reply to
John Larkin

We know how to do it. We do DDS ourselves, with an FPGA and a DAC. It's really pretty simple.

--

John Larkin         Highland Technology, Inc 

jlarkin at highlandtechnology dot com 
http://www.highlandtechnology.com 

Precision electronic instrumentation 
Picosecond-resolution Digital Delay and Pulse generators 
Custom laser drivers and controllers 
Photonics and fiberoptic TTL data links 
VME thermocouple, LVDT, synchro   acquisition and simulation
Reply to
John Larkin

Well I kind of figure that was the operation taking place since I've made circuits like that via RS485 but I used a log amp instead. Using a single quadrant is all you need and you can get very detailed with the linear to sin translations.

Many of these DDS FG's seem to show that anything other than a sine wave, forces them to reduce output BW. I can only assume this due to a bottle neck from the uC to the chip to update pattern configuration via SPI or C2I.. I guess a parallel version would make a vast improvement.

Jamie

Reply to
Jamie
.

Compare the bandwidth of a sine wave of frequency f vs. a sawtooth of the same frequency.

Best regards, Spehro Pefhany

--
"it's the network..."                          "The Journey is the reward" 
speff@interlog.com             Info for manufacturers: http://www.trexon.com 
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

component

null

filter,

table

Is it really "pure" second harmonic distortion or a tiny mismatch in the gain bandwidth product of the power amplifier that could be tweaked out by a small change in the digital amplitude of the negative cycle?

--
Regards, 
Martin Brown
Reply to
Martin Brown

The hp35 used CORDIC to compute trig functions. Its basic math operations were BDC, using decimal arithmetic. Most CORDIC implementations skip "irrelevant" rotations, so the scale of the result isn't constant for all inputs. To get sine, the hp35 computed both sine and cosine (little extra cost for getting both) which had the same scale, then divided to get the cotangent-- the scale factors cancel.

1/sqrt(cot(x)^2 + 1) = sin(x). Since the arithmetic functions were all in place, it was the fastest way to the result.

So what does "simple" really mean?

Jerry

--
Engineering is the art of making what you want from things you can get. 
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply to
Jerry Avins

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.