Electronics-Related.com
Forums

Stepped sine wave

Started by George Herold October 13, 2011
This is a continuation of the 50kHz VCO thread I started last week.  I
tried the stepped sine wave idea as suggested by James A, and Phil
H.
The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
frequency (F).  The ten outputs from the 4017 are sent through
appropriate resistors and into the summing junction of an opamp.
Here=92s a =91scope shot of the stepped output overlaid with a sine
wave.

http://imageshack.us/photo/my-images/560/tek0024.png/

The resistor values were chosen to intersect the sine wave at each new
phase.  (R(n) =3D 1/sin^2(n*18degrees))

Approximate values, R0=3Dopen, R1=3DR9=3D105k, R2=3DR8=3D28.9k, R3=3DR7=3D1=
5.3k,
R4=3DR6=3D11k, R5=3D10k.  all 1% resistors.


Here=92s the spectrum as recorded by an SRS770 spectrum analyzer.

http://imageshack.us/photo/my-images/839/stepsin.png/

The 2nd harmonic is only down by 50dB.  I don=92t understand why it=92s so
big.  Is there some way to do better than this?  The 9th and 11th
harmonics are big and then the 19th and 21st.

Thanks George H.

On Thu, 13 Oct 2011 09:39:21 -0700 (PDT), George Herold
<gherold@teachspin.com> wrote:

>This is a continuation of the 50kHz VCO thread I started last week. I >tried the stepped sine wave idea as suggested by James A, and Phil >H. >The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at >frequency (F). The ten outputs from the 4017 are sent through >appropriate resistors and into the summing junction of an opamp. >Here&#4294967295;s a &#4294967295;scope shot of the stepped output overlaid with a sine >wave. > >http://imageshack.us/photo/my-images/560/tek0024.png/ > >The resistor values were chosen to intersect the sine wave at each new >phase. (R(n) = 1/sin^2(n*18degrees)) > >Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k, >R4=R6=11k, R5=10k. all 1% resistors. > > >Here&#4294967295;s the spectrum as recorded by an SRS770 spectrum analyzer. > >http://imageshack.us/photo/my-images/839/stepsin.png/ > >The 2nd harmonic is only down by 50dB. I don&#4294967295;t understand why it&#4294967295;s so >big. Is there some way to do better than this? The 9th and 11th >harmonics are big and then the 19th and 21st. > >Thanks George H.
George, I don't remember the discussion. Probably didn't read it. But if you are using a 4017 (decade counter), then I'm guessing that you are enabling one resistor at a time while disabling others (they tie to the summing junction from each, moving output pin.) This worries me a little, mostly because of delay and the fact that you are turning off one while turning on another, but don't control that very well. I also don't know what you are doing to filter the steps. Anyway, I'd have wanted to consider, instead, a Gray-coded (actually, the real inventor is Boudot, I think, but Bell Labs was patenting everything in a flurry in the mid 1900's and who could remember Boudot so long ago?) design where you only change one of the outputs at a time. Not two. Anyway, I'll let the big hitters who probably did read the earlier thread tell you what is more likely. Just something that crossed my mind, is all. Jon
On Oct 13, 12:59=A0pm, Jon Kirwan <j...@infinitefactors.org> wrote:
> On Thu, 13 Oct 2011 09:39:21 -0700 (PDT), George Herold > > > > > > <gher...@teachspin.com> wrote: > >This is a continuation of the 50kHz VCO thread I started last week. =A0I > >tried the stepped sine wave idea as suggested by James A, and Phil > >H. > >The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at > >frequency (F). =A0The ten outputs from the 4017 are sent through > >appropriate resistors and into the summing junction of an opamp. > >Here=92s a =91scope shot of the stepped output overlaid with a sine > >wave. > > >http://imageshack.us/photo/my-images/560/tek0024.png/ > > >The resistor values were chosen to intersect the sine wave at each new > >phase. =A0(R(n) =3D 1/sin^2(n*18degrees)) > > >Approximate values, R0=3Dopen, R1=3DR9=3D105k, R2=3DR8=3D28.9k, R3=3DR7=
=3D15.3k,
> >R4=3DR6=3D11k, R5=3D10k. =A0all 1% resistors. > > >Here=92s the spectrum as recorded by an SRS770 spectrum analyzer. > > >http://imageshack.us/photo/my-images/839/stepsin.png/ > > >The 2nd harmonic is only down by 50dB. =A0I don=92t understand why it=92=
s so
> >big. =A0Is there some way to do better than this? =A0The 9th and 11th > >harmonics are big and then the 19th and 21st. > > >Thanks George H. > > George, I don't remember the discussion. =A0Probably didn't > read it. =A0But if you are using a 4017 (decade counter), then > I'm guessing that you are enabling one resistor at a time > while disabling others (they tie to the summing junction from > each, moving output pin.) =A0This worries me a little, mostly > because of delay and the fact that you are turning off one > while turning on another, but don't control that very well. I > also don't know what you are doing to filter the steps. > > Anyway, I'd have wanted to consider, instead, a Gray-coded > (actually, the real inventor is Boudot, I think, but Bell > Labs was patenting everything in a flurry in the mid 1900's > and who could remember Boudot so long ago?) design where you > only change one of the outputs at a time. =A0Not two. > > Anyway, I'll let the big hitters who probably did read the > earlier thread tell you what is more likely. =A0Just something > that crossed my mind, is all. > > Jon- Hide quoted text - > > - Show quoted text -
Hi Jon, Thanks for that. The 4017 is just too simple! I'm hoping all the swithing transients can just be filtered away. I put a little tweaker pot on the smallest R5 resistor and was able to get everything down below 60dB, so I'm thinking this is just a resistor tolerance/ selection issue. I was just twisting different resistors together to get the approximate values, and didn't measure any of them. I'll try really nailing the values I want. Oh I'll add some multi-pole low pass on the back end of this.. but that will do nothing for the lower order harmonics. George H.
On Thu, 13 Oct 2011 10:13:20 -0700 (PDT), George Herold
<gherold@teachspin.com> wrote:

>On Oct 13, 12:59&#4294967295;pm, Jon Kirwan <j...@infinitefactors.org> wrote: >> On Thu, 13 Oct 2011 09:39:21 -0700 (PDT), George Herold >> >> >> >> >> >> <gher...@teachspin.com> wrote: >> >This is a continuation of the 50kHz VCO thread I started last week. &#4294967295;I >> >tried the stepped sine wave idea as suggested by James A, and Phil >> >H. >> >The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at >> >frequency (F). &#4294967295;The ten outputs from the 4017 are sent through >> >appropriate resistors and into the summing junction of an opamp. >> >Here&#4294967295;s a &#4294967295;scope shot of the stepped output overlaid with a sine >> >wave. >> >> >http://imageshack.us/photo/my-images/560/tek0024.png/ >> >> >The resistor values were chosen to intersect the sine wave at each new >> >phase. &#4294967295;(R(n) = 1/sin^2(n*18degrees)) >> >> >Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k, >> >R4=R6=11k, R5=10k. &#4294967295;all 1% resistors. >> >> >Here&#4294967295;s the spectrum as recorded by an SRS770 spectrum analyzer. >> >> >http://imageshack.us/photo/my-images/839/stepsin.png/ >> >> >The 2nd harmonic is only down by 50dB. &#4294967295;I don&#4294967295;t understand why it&#4294967295;s so >> >big. &#4294967295;Is there some way to do better than this? &#4294967295;The 9th and 11th >> >harmonics are big and then the 19th and 21st. >> >> >Thanks George H. >> >> George, I don't remember the discussion. &#4294967295;Probably didn't >> read it. &#4294967295;But if you are using a 4017 (decade counter), then >> I'm guessing that you are enabling one resistor at a time >> while disabling others (they tie to the summing junction from >> each, moving output pin.) &#4294967295;This worries me a little, mostly >> because of delay and the fact that you are turning off one >> while turning on another, but don't control that very well. I >> also don't know what you are doing to filter the steps. >> >> Anyway, I'd have wanted to consider, instead, a Gray-coded >> (actually, the real inventor is Boudot, I think, but Bell >> Labs was patenting everything in a flurry in the mid 1900's >> and who could remember Boudot so long ago?) design where you >> only change one of the outputs at a time. &#4294967295;Not two. >> >> Anyway, I'll let the big hitters who probably did read the >> earlier thread tell you what is more likely. &#4294967295;Just something >> that crossed my mind, is all. >> >> Jon- Hide quoted text - >> >> - Show quoted text - > >Hi Jon, Thanks for that.
No problem. In the interim, I did a quick search for summing junctions and Gray codes and came up with this link: http://www.wiseguysynth.com/larry/schematics/walsh/walsh.pdf I have NOT read it. But it looks about right to me as a zero order approximation to what I was thinking about. I have never considered doing what you are doing, but your writing sprung two things immediately to mind. One is doing Fourier analysis (which you should have already done, I imagine) and the other is that you are possibly changing two outputs at once and with that plus ripple carry stuff I get kind of worried. All this would make me want to go to theory to calculate my expectations and make sure they matched experience in your testing. If I can't match them up, that means I don't know enough and need to read more.
>The 4017 is just too simple!
Yeah. And you know what that means. Things should be as simple as needed but no more so.
>I'm hoping all >the swithing transients can just be filtered away. I put a little >tweaker pot on the smallest R5 resistor and was able to get everything >down below 60dB, so I'm thinking this is just a resistor tolerance/ >selection issue. >I was just twisting different resistors together to get the >approximate values, and didn't measure any of them. I'll try really >nailing the values I want. > >Oh I'll add some multi-pole low pass on the back end of this.. but >that will do nothing for the lower order harmonics.
I completely understand the problem in trying to filter out 2nd harmonics from the 1st. So yeah, that's not really a good answer. Which is why I didn't really suggest it, but instead went to Gray codes and the like. Check out the link and see if it triggers anything. I will read it a little later on, it's interesting to me regardless. But it might apply from a cursory glance at it. Jon
On Thu, 13 Oct 2011 10:24:17 -0700, I wrote:

>... and need to read more.
Better would be to have said, "and need to imagine, think, and possibly read more." It does more for the soul. Jon
On Thu, 13 Oct 2011 09:39:21 -0700, George Herold wrote:

> This is a continuation of the 50kHz VCO thread I started last week. I > tried the stepped sine wave idea as suggested by James A, and Phil H. > The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at > frequency (F). The ten outputs from the 4017 are sent through > appropriate resistors and into the summing junction of an opamp. Here&rsquo;s > a &lsquo;scope shot of the stepped output overlaid with a sine wave. > > http://imageshack.us/photo/my-images/560/tek0024.png/ > > The resistor values were chosen to intersect the sine wave at each new > phase. (R(n) = 1/sin^2(n*18degrees)) > > Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k, > R4=R6=11k, R5=10k. all 1% resistors. > > > Here&rsquo;s the spectrum as recorded by an SRS770 spectrum analyzer. > > http://imageshack.us/photo/my-images/839/stepsin.png/ > > The 2nd harmonic is only down by 50dB. I don&rsquo;t understand why it&rsquo;s so > big. Is there some way to do better than this? The 9th and 11th > harmonics are big and then the 19th and 21st.
If you used 1% resistors, then getting 50dB was better than expectations (1% error is about 40dB down, and if everything adds the wrong way you'll get at least twice that). 0.1% resistors will, in theory, get you around 60dB down. The rule of thumb for this sort of thing is that you can really only expect a "by the book" nulling circuit (which is what you have) to stomp things down by about 40dB, and if you really pull out the stops and hand- tweak things then you can maybe get 60dB -- until someone breaths. Instrument makers _can_ do better than this, but its only "routine" inasmuch as the methods they use (shielding, tweaking, gold plating, 1000% overbuilt circuits, "Only Bob can do that" procedures, etc.) are routine. -- www.wescottdesign.com
On Thu, 13 Oct 2011 13:46:38 -0500, Tim Wescott <tim@seemywebsite.com>
wrote:

>On Thu, 13 Oct 2011 09:39:21 -0700, George Herold wrote: > >> This is a continuation of the 50kHz VCO thread I started last week. I >> tried the stepped sine wave idea as suggested by James A, and Phil H. >> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at >> frequency (F). The ten outputs from the 4017 are sent through >> appropriate resistors and into the summing junction of an opamp. Here&#4294967295;s >> a &#4294967295;scope shot of the stepped output overlaid with a sine wave. >> >> http://imageshack.us/photo/my-images/560/tek0024.png/ >> >> The resistor values were chosen to intersect the sine wave at each new >> phase. (R(n) = 1/sin^2(n*18degrees)) >> >> Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k, >> R4=R6=11k, R5=10k. all 1% resistors. >> >> >> Here&#4294967295;s the spectrum as recorded by an SRS770 spectrum analyzer. >> >> http://imageshack.us/photo/my-images/839/stepsin.png/ >> >> The 2nd harmonic is only down by 50dB. I don&#4294967295;t understand why it&#4294967295;s so >> big. Is there some way to do better than this? The 9th and 11th >> harmonics are big and then the 19th and 21st. > >If you used 1% resistors, then getting 50dB was better than expectations >(1% error is about 40dB down, and if everything adds the wrong way you'll >get at least twice that). > >0.1% resistors will, in theory, get you around 60dB down. > >The rule of thumb for this sort of thing is that you can really only >expect a "by the book" nulling circuit (which is what you have) to stomp >things down by about 40dB, and if you really pull out the stops and hand- >tweak things then you can maybe get 60dB -- until someone breaths. > >Instrument makers _can_ do better than this, but its only "routine" >inasmuch as the methods they use (shielding, tweaking, gold plating, >1000% overbuilt circuits, "Only Bob can do that" procedures, etc.) are >routine.
We get over 60 dB in our arbs, but it's hard. We start with a 16 bit differential current output DAC. The tough part is the downstream amplifiers, especially past a couple of MHz. There are major-brand RF signal generators with -20 dB harmonics. John
On Oct 13, 2:46=A0pm, Tim Wescott <t...@seemywebsite.com> wrote:
> On Thu, 13 Oct 2011 09:39:21 -0700, George Herold wrote: > > This is a continuation of the 50kHz VCO thread I started last week. =A0=
I
> > tried the stepped sine wave idea as suggested by James A, and Phil H. > > The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at > > frequency (F). =A0The ten outputs from the 4017 are sent through > > appropriate resistors and into the summing junction of an opamp. Here=
=92s
> > a =91scope shot of the stepped output overlaid with a sine wave. > > >http://imageshack.us/photo/my-images/560/tek0024.png/ > > > The resistor values were chosen to intersect the sine wave at each new > > phase. =A0(R(n) =3D 1/sin^2(n*18degrees)) > > > Approximate values, R0=3Dopen, R1=3DR9=3D105k, R2=3DR8=3D28.9k, R3=3DR7=
=3D15.3k,
> > R4=3DR6=3D11k, R5=3D10k. =A0all 1% resistors. > > > Here=92s the spectrum as recorded by an SRS770 spectrum analyzer. > > >http://imageshack.us/photo/my-images/839/stepsin.png/ > > > The 2nd harmonic is only down by 50dB. =A0I don=92t understand why it=
=92s so
> > big. =A0Is there some way to do better than this? =A0The 9th and 11th > > harmonics are big and then the 19th and 21st. > > If you used 1% resistors, then getting 50dB was better than expectations > (1% error is about 40dB down, and if everything adds the wrong way you'll > get at least twice that). > > 0.1% resistors will, in theory, get you around 60dB down. > > The rule of thumb for this sort of thing is that you can really only > expect a "by the book" nulling circuit (which is what you have) to stomp > things down by about 40dB, and if you really pull out the stops and hand- > tweak things then you can maybe get 60dB -- until someone breaths. > > Instrument makers _can_ do better than this, but its only "routine" > inasmuch as the methods they use (shielding, tweaking, gold plating, > 1000% overbuilt circuits, "Only Bob can do that" procedures, etc.) are > routine. > > --www.wescottdesign.com- Hide quoted text - > > - Show quoted text -
Thanks Tim, I kinda figured that out on my own. George H.
On Oct 13, 4:25=A0pm, John Larkin
<jjlar...@highNOTlandTHIStechnologyPART.com> wrote:
> On Thu, 13 Oct 2011 13:46:38 -0500, Tim Wescott <t...@seemywebsite.com> > wrote: > > > > > > >On Thu, 13 Oct 2011 09:39:21 -0700, George Herold wrote: > > >> This is a continuation of the 50kHz VCO thread I started last week. =
=A0I
> >> tried the stepped sine wave idea as suggested by James A, and Phil H. > >> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at > >> frequency (F). =A0The ten outputs from the 4017 are sent through > >> appropriate resistors and into the summing junction of an opamp. Here=
=92s
> >> a =91scope shot of the stepped output overlaid with a sine wave. > > >>http://imageshack.us/photo/my-images/560/tek0024.png/ > > >> The resistor values were chosen to intersect the sine wave at each new > >> phase. =A0(R(n) =3D 1/sin^2(n*18degrees)) > > >> Approximate values, R0=3Dopen, R1=3DR9=3D105k, R2=3DR8=3D28.9k, R3=3DR=
7=3D15.3k,
> >> R4=3DR6=3D11k, R5=3D10k. =A0all 1% resistors. > > >> Here=92s the spectrum as recorded by an SRS770 spectrum analyzer. > > >>http://imageshack.us/photo/my-images/839/stepsin.png/ > > >> The 2nd harmonic is only down by 50dB. =A0I don=92t understand why it=
=92s so
> >> big. =A0Is there some way to do better than this? =A0The 9th and 11th > >> harmonics are big and then the 19th and 21st. > > >If you used 1% resistors, then getting 50dB was better than expectations > >(1% error is about 40dB down, and if everything adds the wrong way you'l=
l
> >get at least twice that). > > >0.1% resistors will, in theory, get you around 60dB down. > > >The rule of thumb for this sort of thing is that you can really only > >expect a "by the book" nulling circuit (which is what you have) to stomp > >things down by about 40dB, and if you really pull out the stops and hand=
-
> >tweak things then you can maybe get 60dB -- until someone breaths. > > >Instrument makers _can_ do better than this, but its only "routine" > >inasmuch as the methods they use (shielding, tweaking, gold plating, > >1000% overbuilt circuits, "Only Bob can do that" procedures, etc.) are > >routine. > > We get over 60 dB in our arbs, but it's hard. We start with a 16 bit > differential current output DAC. The tough part is the downstream > amplifiers, especially past a couple of MHz. >
> There are major-brand RF signal generators with -20 dB harmonics.
That's a feature not a bug, you get a higher frequency generator 'cause of the big 3rd harmonic. :^) We've got this el-cheapo RF generator that even has the 3rd harmonic frequencies listed on the dial. George H.
> > John- Hide quoted text - > > - Show quoted text -
On 10/13/2011 12:39 PM, George Herold wrote:
> This is a continuation of the 50kHz VCO thread I started last week. I > tried the stepped sine wave idea as suggested by James A, and Phil > H. > The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at > frequency (F). The ten outputs from the 4017 are sent through > appropriate resistors and into the summing junction of an opamp. > Here&#4294967295;s a &#4294967295;scope shot of the stepped output overlaid with a sine > wave. > > http://imageshack.us/photo/my-images/560/tek0024.png/ > > The resistor values were chosen to intersect the sine wave at each new > phase. (R(n) = 1/sin^2(n*18degrees)) > > Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k, > R4=R6=11k, R5=10k. all 1% resistors. > > > Here&#4294967295;s the spectrum as recorded by an SRS770 spectrum analyzer. > > http://imageshack.us/photo/my-images/839/stepsin.png/ > > The 2nd harmonic is only down by 50dB. I don&#4294967295;t understand why it&#4294967295;s so > big. Is there some way to do better than this? The 9th and 11th > harmonics are big and then the 19th and 21st. > > Thanks George H. >
50 dB is only 0.3%, which isn't too bad. That might easily be due to the output impedances of the 4017 drivers, or to the resistor tolerances. Does it get better or worse when you change VDD? If so, it's probably the output impedance. Cheers Phil Hobbs