sine wave generator

get away

This modem

So being non-standard came back to bite you in the ass.

?-)

Reply to
josephkk
Loading thread data ...

away

modem

Who woula thought that the system would last over 30 years?

The remote units are a 6802 CPU with 1k bytes of eprom. The receive direction is an Exar PLL to demod the FSK, then a software UART; the transmit direction is a software UART and a software FSK generator.

It started being managed by a VAX, and has evolved a few generations to a PC running Windows.

Reply to
John Larkin

Right. John's triangle (input to my ckt) actually swings +/- 2.5V, =

5Vp-p. Corrected above.

x3 would be +/-7.5V, chopped off at +/-5v by ye olde Yankee clipper.

Appended to John's LTSpice, the above ckt operates as intended.

--
Cheers, 
James Arthur
Reply to
dagmargoodboat

e
 /

Strictly LTSpice'd--I added the above to John's circuit, replacing his log shaper.

Sort of. I like using CMOS gates for making accurate rail-to-rail waveforms, so, why not a rail-to-rail op-amp? That's easier than clampy-pampy. The random op-amp I chose doesn't hit the rails perfectly--there might be something better.

I used John's.

--
Cheers, 
James Arthur
Reply to
dagmargoodboat

Resurrecting a post I did here 7 years ago, and changing it to 1KHz...

formatting link

I'm sure I can subtract out the 5th the same way.

(DSTM2 is a clock at 3KHz, might be better at 6KHz, then DIV2, to preserve symmetry.) ...Jim Thompson

-- | James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at

formatting link
| 1962 | I love to cook with wine. Sometimes I even put it in the food.

Reply to
Jim Thompson

On 12/30/2012 3:51 PM, snipped-for-privacy@yahoo.com wrote:

I can't get the low values you did.

Fourier components of V(out) DC component:-0.210202

Harmonic Frequency Fourier Normalized Number [Hz] Component Component 1 3.054e+04 5.893e+00 1.000e+00 2 6.109e+04 2.964e-01 5.029e-02 3 9.163e+04 1.063e+00 1.804e-01 4 1.222e+05 1.032e-01 1.752e-02 5 1.527e+05 1.563e-02 2.652e-03 6 1.833e+05 6.871e-02 1.166e-02 7 2.138e+05 1.758e-01 2.983e-02 8 2.443e+05 8.000e-02 1.357e-02 9 2.749e+05 7.106e-02 1.206e-02 Total Harmonic Distortion: 19.163627%

dt=3.2741e-005 FROM 0.000163028 TO 0.000195769 f: 1/dt=30542.8

See if my mod is the same as yours...

Version 4 SHEET 1 1180 680 WIRE -144 0 -448 0 WIRE 0 0 -144 0 WIRE 48 0 0 0 WIRE 144 0 48 0 WIRE 384 0 208 0 WIRE -448 16 -448 0 WIRE 384 16 384 0 WIRE -144 32 -144 0 WIRE -320 80 -352 80 WIRE -304 80 -320 80 WIRE -32 80 -64 80 WIRE -16 80 -32 80 WIRE 304 96 272 96 WIRE 320 96 304 96 WIRE -352 112 -352 80 WIRE -384 128 -528 128 WIRE -64 128 -64 80 WIRE -272 144 -320 144 WIRE -240 144 -272 144 WIRE -144 144 -144 96 WIRE -144 144 -160 144 WIRE -96 144 -144 144 WIRE 272 144 272 96 WIRE 384 144 384 96 WIRE -528 160 -528 128 WIRE -448 160 -448 96 WIRE -384 160 -448 160 WIRE 48 160 48 0 WIRE 48 160 -32 160 WIRE 80 160 48 160 WIRE 208 160 208 0 WIRE 208 160 160 160 WIRE 256 160 208 160 WIRE -96 176 -144 176 WIRE 384 176 384 144 WIRE 384 176 320 176 WIRE 464 176 384 176 WIRE 256 192 208 192 WIRE -352 208 -352 176 WIRE -320 208 -352 208 WIRE -304 208 -320 208 WIRE -64 208 -64 192 WIRE -16 208 -64 208 WIRE 0 208 -16 208 WIRE -144 224 -144 176 WIRE -992 256 -1024 256 WIRE -960 256 -992 256 WIRE -784 256 -832 256 WIRE -752 256 -784 256 WIRE 208 256 208 192 WIRE 272 256 272 208 WIRE 304 256 272 256 WIRE 320 256 304 256 WIRE -608 272 -656 272 WIRE -560 272 -608 272 WIRE -448 272 -448 160 WIRE -448 272 -480 272 WIRE -400 272 -448 272 WIRE -272 272 -272 144 WIRE -272 272 -320 272 WIRE -1024 304 -1024 256 WIRE -832 304 -832 256 WIRE -656 304 -656 272 WIRE -1024 416 -1024 384 WIRE -832 416 -832 384 WIRE -656 416 -656 384 FLAG -1024 416 0 FLAG -832 416 0 FLAG -992 256 +5 FLAG -784 256 -5 FLAG -144 224 0 FLAG -320 80 +5 FLAG -32 80 +5 FLAG -320 208 -5 FLAG -16 208 -5 FLAG -656 416 0 FLAG 0 0 TRIANGLE FLAG -528 160 0 FLAG -608 272 KICK FLAG -272 144 MID FLAG 304 96 +5 FLAG 304 256 -5 FLAG 208 256 0 FLAG 384 144 out SYMBOL voltage -1024 288 R0 WINDOW 0 61 39 Left 2 WINDOW 3 64 76 Left 2 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL voltage -832 288 R0 WINDOW 0 55 40 Left 2 WINDOW 3 57 76 Left 2 SYMATTR InstName V2 SYMATTR Value -5 SYMBOL res -144 128 R90 WINDOW 0 66 57 VBottom 2 WINDOW 3 68 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 1K SYMBOL res -304 256 R90 WINDOW 0 68 58 VBottom 2 WINDOW 3 73 56 VTop 2 SYMATTR InstName R2 SYMATTR Value 2K SYMBOL res -464 256 R90 WINDOW 0 70 58 VBottom 2 WINDOW 3 75 56 VTop 2 SYMATTR InstName R3 SYMATTR Value 100K SYMBOL cap -160 32 R0 WINDOW 0 -44 2 Left 2 WINDOW 3 -50 33 Left 2 SYMATTR InstName C1 SYMATTR Value 10n SYMBOL voltage -656 288 R0 WINDOW 3 38 113 Left 2 SYMATTR Value PULSE(1 0 100u) SYMATTR InstName V3 SYMBOL res -464 0 R0 WINDOW 0 -53 36 Left 2 WINDOW 3 -52 66 Left 2 SYMATTR InstName R4 SYMATTR Value 1K SYMBOL Opamps\\UniversalOpamp2 -352 144 R0 SYMATTR InstName U3 SYMBOL Opamps\\UniversalOpamp2 -64 160 R0 SYMATTR InstName U4 SYMBOL Opamps\\LTC6255 288 176 R0 SYMATTR InstName U5 SYMBOL res 64 144 M90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R5 SYMATTR Value 1k SYMBOL res 368 112 M180 WINDOW 0 36 76 Left 2 WINDOW 3 36 40 Left 2 SYMATTR InstName R6 SYMATTR Value 3k TEXT -880 144 Left 2 !.tran 0 400u 40u TEXT -968 32 Left 2 ;FSK Modem Sine Generator TEXT -936 80 Left 2 ;J Larkin Dec 19 2012 TEXT 152 352 Left 2 !.four 42248.4 v(out) TEXT 160 408 Left 2 !.meas tran dt trig v(out) val = 0 rise = 5 targ v(out) val = 0 rise = 6\n.meas tran f param 1/dt

** watch out for the line wrap**
Reply to
John S

   /
/

ormalized

   Component
  1.000e+00
  5.029e-02
  1.804e-01
  1.752e-02
  2.652e-03
  1.166e-02
  2.983e-02
  1.357e-02
  1.206e-02

No, not quite the same. John's original post runs 22x too fast for

2200 Hz. My results include his later value changes: R1 1k-->10K, C1 10n-->22nF.
--
Cheers, 
James Arthur
Reply to
dagmargoodboat

Okay, much better...

Fourier components of V(out) DC component:-0.109467

Harmonic Frequency Fourier Normalized Number [Hz] Component Component 1 2.195e+03 5.250e+00 1.000e+00 2 4.390e+03 6.742e-02 1.284e-02 3 6.585e+03 6.908e-02 1.316e-02 4 8.780e+03 3.190e-02 6.075e-03 5 1.097e+04 2.323e-01 4.424e-02 6 1.317e+04 8.509e-03 1.621e-03 7 1.536e+04 9.214e-02 1.755e-02 8 1.756e+04 1.872e-02 3.566e-03 9 1.975e+04 2.227e-02 4.242e-03 Total Harmonic Distortion: 5.170363%

dt=0.000455632 FROM 0.00211684 TO 0.00257247 f: 1/dt=2194.76

That makes the 2nd = -37.8 dB and the 3rd = -37.6 dB. Much more in line with your report.

Thanks.

Reply to
John S

 \    /
 \__/

ormalized

   Component
  1.000e+00
  1.284e-02
  1.316e-02
  6.075e-03
  4.424e-02
  1.621e-03
  1.755e-02
  3.566e-03
  4.242e-03

Thanks for double-checking.

It suggests a simple digital method too: ramp, ramp, hold, invert, repeat. A shift register and some logic would do it.

--
Cheers, 
James Arthur
Reply to
dagmargoodboat

I just noticed that my 5th is higher than yours. I also found a fairly strong correlation to last stage gain and harmonics.

Not complaining, just observing.

John

Reply to
John S

What do you think of this, James?

You can change frequency and amplitude in the dot commands on the right side of the simulation.

(As always, watch out for line wraps)

Version 4 SHEET 1 880 680 WIRE -1008 48 -1168 48 WIRE -912 48 -1008 48 WIRE -896 48 -912 48 WIRE -1168 96 -1168 48 WIRE -1008 112 -1008 48 WIRE -1168 192 -1168 176 WIRE -1008 192 -1008 176 FLAG -1168 192 0 FLAG -1008 192 0 FLAG -912 48 source SYMBOL current -1168 176 R180 WINDOW 0 24 80 Left 2 WINDOW 3 150 3 Left 2 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName I1 SYMATTR Value PULSE({-i} {i} 0 1n 1n {th} {t}) SYMBOL cap -1024 112 R0 SYMATTR InstName C1 SYMATTR Value 1u TEXT -1632 256 Left 2 !.tran 5m startup uic TEXT -592 0 Left 2 !.param f = 2000 TEXT -1648 -88 Left 2 !.param t = 1/f\n.param th = t/2\n.param i =

2e-6*Vpeak/th TEXT -1632 320 Left 2 !.ic v(source) = Vinit TEXT -1632 288 Left 2 !.param Vinit = -Vpeak TEXT -592 32 Left 2 !.param Vpeak = 2
Reply to
John S

Raise the resistor values on your rail-to-rail OpAmp and it'll clip symmetrically.

I also did a first approximation all digital...

Newsgroups: sci.electronics.design Subject: Re: sine wave generator Date: Sun, 30 Dec 2012 17:47:56 -0700 Message-ID: ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     | 
| Analog Innovations, Inc.                         |     et      | 
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    | 
| Phoenix, Arizona  85048    Skype: Contacts Only  |             | 
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  | 
| E-mail Icon at http://www.analog-innovations.com |    1962     | 
              
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

 /  \    /
   \__/

C1

 Normalized
     Component
    1.000e+00
    1.284e-02
    1.316e-02
    6.075e-03
    4.424e-02
    1.621e-03
    1.755e-02
    3.566e-03
    4.242e-03

My output is heavily loaded--the original log-shaper is still attached.

Things start getting fiddly when you're looking to improve on

-30dB...I was tickled getting even -20dB from a simple technique, virtually for free.

--
Cheers, 
James Arthur
Reply to
dagmargoodboat

Nice clean triangle generator. Slick.

Reply to
dagmargoodboat

Good point. I'd left John's log-shaper attached, which was actually making things slightly better by rounding the trapezoid's vertices. Unloading the op-amp, it's slightly dirtier.

Missed it. I'll give it a look.

--
Cheers, 
James Arthur
Reply to
dagmargoodboat

C1

Oh, yes, the symmetrical /3. I did see that, basically a Walsh generator. You didn't show the math function used to generate the composite waveform; it looks like (a*f - b*3f).

I've done that. What I meant here though was a digital controller to operate the ramp generator, producing the clipped triangle.

If we want to get nutty we could breakpoint the curve into multiple slope regions, and modulate the ramp current source accordingly.

I liked the analog version Rocky posted up thread better--dirt simple.

--
Cheers, 
James Arthur
Reply to
dagmargoodboat

The FFT is much nicer if you run the sim for longer, get more cycles.

This is one of those circuits that works great in Spice, but not in real life.

--

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

Are you deranged? I did not do an FFT of the triangle waveform. I merely submitted it for anyone to use as a triangle voltage source.

It works fine in spice. What's wrong with you?

Reply to
John S

You might want to consider this from the LTSpice help file:

"The Fourier analysis is performed over the period from the final time, Tend, to one period before Tend unless an integer Nperiods is given after Nharmonics. If Nperiods is given as -1, the Fourier analysis is performed over the entire simulation data range."

Reply to
John S

life.

That's not the question at issue here.

I did not do an FFT of the triangle waveform. I merely

Well, we were discussing harmonic contents of waveforms, specifically for my modem project. The observation is general: crunch a lot of cycles if you want a crisp FFT.

I said that: in Spice.

I suppose I'm not as angry and hostile as you are. Should I work on that?

--

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

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.