Stepped sine wave

Oct 13, 2011 90 Replies

ote:

with

use

chips. ;-)

ng,

h
o

Well I stuck a switch cap filter on the output. (LTC1063, I know only

50kHz, which doesn=92t =91meet my spec', but I had one lying around.)

I clocked it at 16 times the stepped sine wave so the 3dB point was

1.6 times the fundamental. Here=92s the spectrum before the SC.

formatting link

And after it.

formatting link

The second harmonic goes up more than 10dB! And there is all this other =91fluff=92 at low frequency. Some new peak stands up at 2.5 kHz. I moved the 3dB point up to 3.2kHz and the 2nd harmonic was a few dB better... the weird signal at 2.5kHz moved out to 5 kHz? Not sure I like switched cap filters. We used the same SC on a different project and it also added =91out of band=92 curd... at similar levels.

I=92ll try an analog multi pole Butterworth. Maybe a Sallen-Key.

George H.

te:

e:

rote:

. =A0I measured

nd

h a DMM. =A0The

~70dB! =A0I

put in a few

from the

-images/7/vco2.png/

o the cost

lses, one

e of those

t having

ch peak

rs it

owed

pillar

ems

new

It's

example,

homemade

s, then

4x as many

Phil's

y are

of

ram

1

to

ps. ;-)

I had the crazy idea of using a serial flash, too bad the 45lf010 isn't available anymore it had a read command 0xff, so you could just tie din high and clock it and it would spit out bits forever. you could use a config flash for an fpga but they are a bit expensive

program the flash with Don Lancasters magic sine waves, or run a sinewave through a delta-sigma modulator

-Lasse

;-)

They do that, especially when the input consists of one or a few pure tones--there's all sorts of intermodulation junk. If you put an RC lowpass in front of it, you'd reduce the input slew rate, which would help the IMD. A nice four-pole Chebyshev would do a good job of it, I should think.

Cheers

Phil Hobbs

Twenty cents each? If they stock values from 100 to 100k ohms, that means they have to have about 7000 standard values? Cool!

One zero-ohm resistor, and two (maybe four) of the smallest resistors, can be 1% values, without undue error. So, there's room to squeeze the $2 figure down a little.

s with

ld use

ee chips. ;-)

sing,

)

ach

so

an

I
.

I've got two articles in the hard drive vault that use a squarewave into a switched cap filter, overclocked >100:1, to generate a sinewave. The first architecture is fixed 1kHz: TLC555 =3D=3D> 19kHz RC-lowpass =3D=3D> MF6CN100 (Nat'l Semi), claims harmonics are 60dB down.

The 2nd generates squarewaves with a uC. That drives a 64x overclocked MAX292 (8th-order Bessel directly). "Clean" sinewave is all they say. They run the MAX292 bipolar off +5v, using a 10k-10k divider for a virtual rail. Funky.

I could e-mail you the articles if interested, but they _really_ don't say much more than what I already wrote.

1) Simple circuit generates clean sine waves, EDN, June 19, 1997, pg. 99 2) Microcontroller-based Sine Wave Generator Has Crystal Accuracy, Electronic Design, Dec. 14, 1998, pg. 74

-- Cheers, James Arthur

Most probably they will only stock the E96 grid, which is 3x96 values,

188 rather than 7,000.

There is an E192 grid, but I don't know anybody who stocks anything like a full range on that grid

-- Bill Sloman, Nijmegen

h
o

Not bad--that's pretty simple.

I poked around the available shift registers @ Digikey. Alas, bi- directionals are 4 bits only.

So, my best low chip stepped addition(s) are these: 74HC154 .------. | 0|---[R0]--. | 1|---[R1]--+ | 2|---[R2]--+ | 3|---[R3]--+ | 4|---[R4]--+ .------. | 5|---[R5]--+ | X | | 6|---[R6]--+-->|+/- 1 |--> to filter | 7|---[R7]--+ | | | 8|---[R8]--+ '------' | 9|---[R9]--+ ^ | 10|--[R10]--+ | | 11|--[R11]--+ | | 12|--[R12]--+ | | 13|--[R13]--+ | | 14|--[R14]--+ | | 15|--[R15]--' | | | | | ABCD | | '------' | |||| | .----. | |XOR | | 6-bit Counter | | '---------'

You could go to 32 steps by dropping the +/-1 stage and save a chip, naturally.

Or you can extend an 8-step DAC to get a 32-step sine, as suggested before...

'HC4051 .-----. v7-----|0 | v6-----|1 | .-------. v5-----|2 | | X | v4-----|3 Y|----| +/- 1 |--- v3-----|4 | | | v2-----|5 | '-------' v1-----|6 | ^ v0-----|7 | | | ABC | | '-----' | ||| | .---. | |XOR| | 5-bit Counter | | '-------'

The neat thing about these sine-weighted DACs over straight linear DACs is that, theoretically, the steps can be exact. 0.1% resistors puts you competitive with 10-bit linear DACs, with a lot less hassle.

-- Cheers, James Arthur

Ahh, they only have the 'standard' 1% values. Here's 10k ones in 0805 package.

formatting link

1241041

To get the exact values to 0.1% I'll have to mix some 0.1% resistors with smaller 1%ers.

If you can use one thousand of 'em then they're only ~$0.1 each. Pretty amamzing really, you can make amps with a gain of

10.00(something)

George H.

s with

ld use

ee chips. ;-)

sing,

)

ach

so

an

I
.

Ideas: I'd suggest you aren't clocking the LIC1063 fast enough, and need a small anti-aliasing pre-filter. (Doesn't it need 100x anyhow?)

Choosing the filter clock frequency as some integer multiple of the DAC clock rate will kill most of the intermodulation products.

-- Cheers, James Arthur

That's good idea, really. That's the ultimate self-clocking shift- register.

-- Cheers, James Arthur

If you can deal with 25ppm/C, DigiKey has them by the reel for under $.04 each.

eps with

ould use

hree chips. ;-)

rising,

;-)

=A0Each

f

em so

s an

=A0I

Hz.

t

ims

Gee thanks, but please don't bother. I'm now looking for a VCO to drive the whole chain. I was going to try the VCO in one of the 4046 PLL chips.. they are cheap enough. But I also found this 'synchronous' V-F converter. AD7741 it comes in an DIP which is nice.

George H.

kHz.

I

ect

laims

Don't worry about all the chit-chat--none of it obligates you, we're just playing. You're already on a pretty good path.

-- Cheers, James Arthur

Agreed about the little RC DACs--they're cute. There's an old arbitrary waveform generator, the Exact 202, that has an array of 10-turn panel pots, one for each point in the waveform I wonder if they used this trick or had a bunch of analogue switches?

There's the 74HC299, which is an 8-bit universal shift register, and among its other talents it can shift both directions. That plus an HC74 dual D flipflop will make it do the back and forth one-shuttling trick. One half of the HC74 is an RS flipflop that switches the shifting direction--set on Q8 of the right-hand end (an auxiliary FF--see below), reset on Q0 of the left-hand end.

Getting rid of spurious sequences is always the trick with this sort of gizmo. Clocking the 1 off one the end of the register into the other half of the HC74 makes this easy--connect its Q output to the appropriate serial input, AC couple its Qbar output into the Rbar (master reset) inputs of the shift registers, and use a mickey-mouse logic one-shot on its S' input, so that it sets itself asynchronously if it doesn't see a one-state every so often. (Diode from Q to Sbar, RC from Sbar to ground.)

If RC-coupling logic is too gross, we could use an HC123 dual one-shot package. (It's also possible to use gates to form the reset and do the RC-coupling thing on the gate package to make a missing pulse detector.

So assuming I haven't missed anything too horrible, using symmetry, you can make a 16N+1 step sine wave with N shift registers, one D flipflop package, and a bit of M2L or a one-shot. If an even-order approximation is important, we could take the DFF's input one stage early and get 16N instead.

Cheers

Phil Hobbs

(Who has wasted too much time on this exercise, but enjoyed it.)

ly

.)

s

.5 kHz.

B

e I

oject

.

claims

s
t

Big Grin! No it's my great pleasure! Some one sent me "two tramps in mud time" yesterday.

formatting link

The last few lines keep tripping through my head. (My 'excuse' for doing electronics.)

George H.

steps with

could use

three chips. ;-)

e rising,

=A0;-)

=A0Each

of

'em so

es

as an

a

=A0I

kHz.

I

ect

)

I thought the LTC1063 needs a 100x clock (f_cutoff =3D f_clk/100)? So, for a 1KHz output, the 4017 should be clocked at 10Khz, and the filter at 1MHz. No, wait, 100kHz--my mistake.

That's only 10x the DAC clock rate. Hmmm. Kind of tight.

Good. (I think.)

All this chopping and sampling produces mixing products. So, for example, the 9th and 11th harmonics get mixed, producing 2nd and 20th harmonics. The combinations are infinite.

You could spread them out with spread spectrum techniques (modulate the filter clock), but I'm not sure that helps...depends who's generating how much of what.

Should cut down on lots of high-order mixing products. It's cheap-- worth doing.

-- Cheers, James Arthur

only

nd.)

as

.

his

2.5 kHz.

dB

ure I

project

ey.

), claims

is

0k

n't

g.

46
n

Whose poem this is I think I know, he's nowhere near to see me though; he will not see me reading here his dusty works by monitor's glow...

Very appropriate. Lumberjacking has been heavy on my mind, with an eye to a neighbor's ancient mighty oak, felled by tropical storm Lee. A heavy, heavy timber atop the carport it crushed, in need of cutting, hauling, and splitting. Firewood and warmth for years. I've been jammed up, soon to be free, and alas, someone beat me to it yesterday, probably for pay. Shucks.

-- Cheers, James Arthur

e:

w only

ound.)

was

SC.

this

at 2.5 kHz.

ew dB

sure I

t project

-Key.

ve

mi), claims

ve is

-10k

don't

pg.

,
o
4046

is

in

Ahh, well that was exactly why it was sent to me. Unlike Robert F. I do all my wood splitting in the autumn. I've got a lot of dead and dying Ash in my woods, which splits with a 'snap'. (hydraulically*) And then some big ole dead Elm, which is just about the stringiest, nastiest wood I know. Once they are mostly split with the machine, I still sometimes have to get out the axe to finish the job. I should finish my pile this weekend, then I just have to stack it. The 'problem' with wood is you have to move it three (or more) times before it ends up in the stove.

George H.

*Once you use hydraulics you're ruined for life.

And thanks for the poem.

with

could use

chips. ;-)

rising,

Each

so

an

I

kHz.

=46or something like this i might try to use inverse Chebychev and drop = the out of band notches on top of the harmonics. Probably cannot hit the second harmonic though.

?-)

OTOH, it warms you more than once.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required