Stepped sine wave

Drat. I had visions of a bin for each value, 100 ohms to 100k, at

0.1% increments; 4 x 4 inch bins, up from the floor to about five feet, spread out 154 feet, in the back of every Radio Shack.
Reply to
whit3rd
Loading thread data ...

I

at

new

=3DR7=3D15.3k,

so

I was going to suggest using Walsh functions. They make great sinewaves (or ANY repetitive waveshape, although there is a problem with the "peak" on triangles). The difference between Walsh function generation and typical D-A converters is that Walsh functions distribute the switching over the period and don't need a resistive ladder where some elements need high accuracy.

Read the pdf. and it should explain how to reproduce any waveform. You just need to get the transform of the waveform that lists coefficient of each Walsh function. The beauty of this method is the often many of them are zero and hence do not need to be implemented. Typically the spectrum is very low in the lower harmonics rising much higher in high harmonics where the "stairsteps" start to produce spectrum. Obviously the more steps you use the further out is that rise.

I didn't see the original thread so I don't know what your application is.

Reply to
Benj

My intuition suggested changing only one digital output at a time -- which is why I gravitated towards Gray coding. Searching on that led me to Walsh, which seemed right on the money. But I still haven't had time to read about them. I did just receive my beautiful copy of Harmuth's "Sequency Theory" book, though. And glad to have it. And it does go directly into Gray code ordering of Walsh functions, so I'm happy now.

On the short PDF, I clearly got this message. (odd and even functions, etc.)

Got it.

It's not my application, but George's. He's using a 4017 (decade decoder thing) right now (or was) and ties in resistors on each of the 10 pins to a summing point of an opamp in order to make a stepped sine wave. But he didn't like the spectrum he got, especially the 2nd harmonic.

I hadn't done this, but my gut told me that the 4017 was changing two resistors nearly at once (but perhaps not exactly so) and with ripple carry and all I wasn't comfortable and wanted to suggest thinking in terms of a gray coded approach. Which is what led me to Walsh, which I'd not heard of before but wish I had.

Jon

Reply to
Jon Kirwan

You mean 154 feet of empty bins?

--
You can't have a sense of humor, if you have no sense.
Reply to
Michael A. Terrell

ek. I

il

ve at

ch new

R3=3DR7=3D15.3k,

s so

The 4017 is a twisted ring shift-register-based Johnson counter - whence no ripple carry within the counter, though it does have a ripple carry output.

formatting link

The second harmonic content was almost certainly due to the tolerances on his resistors - P-channel on-resistance is higher than N-channel in most CMOS logic, but in modern parts the channel resistance is too low to have explained the second harmonic content he saw.

-- Bill Sloman, Nijmegen

Reply to
Bill Sloman

new

Thanks, Bill, for the correction on that point.

I was explaining my early reasoning for commenting at all, which as you point out isn't the explanation. I've learned that much as I've been reading here. So that's been good for me. However, I remain very happy to have learned a few things about gray code ordered Walsh functions, too.

Anyway, thanks for the summary and correction. It helps.

Jon

Reply to
Jon Kirwan

week. I

Phil

wave at

p.

each new

, R3=3DR7=3D15.3k,

.

it s so

h

Hi Bill, did you read the rest of the thread? I measrured an output impedance of ~180 omhs (at 15V) for the 1MC4017 I was using. That's about 2% of the smallest resistor (10k ohm). Bigger than the 1% resistor tolerance, and certianly the major cause of the 2nd harmonic distortion in my first circuit.

George H. (I hope you can forgive the slight correction, I didn't want the thread to end with a mis-statement)

Reply to
George Herold

e:

t week. I

d Phil

e wave at

h

amp.

ne

t each new

9k, R3=3DR7=3D15.3k,

er.

y it s so

1th

ou

t

of

gh

y

on

So here's a late Friday night question, (after a few Genny's). If I used a bipolar output (switching the sign at zero with an opamp, and picking new resistors), would the distortion caused by the output impedance move from the 2nd harmonic to the third? Squishing both sides equally rather than just pushing the top down.

I find it hard moving from distortion in the time demain to the frequency domain.

George H.

Reply to
George Herold

On March 30, 2006, Tim Shoppa started a thread in this newsgroup that has some relevance to this. It should be easy to find at Google.

Reply to
The Phantom

e:

t week. I

d Phil

e wave at

h

amp.

ne

t each new

9k, R3=3DR7=3D15.3k,

er.

y it s so

1th

ou

t

of

gh

y

on

Forgive it? I'm grateful for it. I knew I should have checked before I posted that comment, but succumbed to the temptation to wing it.

I am a bit surprised that you had an MC4017 to play with. I know that they are still commercially available, but it's difficult to imagine any good reason for using them, unless you are hopelessly addicted to

+/-15V power rails.

When I put together a similar circuit in the late 1970's (to make pseudo-random noise to confuse echo-locating bats) I got worried enough about the CD/MC output impedances to use 4066's to do the switching, but I still had to redo the resistors after I found out about Gibb's oscillation the hard way and had to aply a Hamming raised- cosine window to almost every one of 32 carefully trimmed resistances.

-- Bill Sloman, Nijmegen

Reply to
Bill Sloman

new

If the resulting waveform has inversion symmetry, i.e. if for all t

f(t) + f(t+T/2) = 0,

then it can't have any even harmonics.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

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.