Programmable sine/cosine generator

I am looking for a mostly-analog circuit that will generate sin(a+w*t) and cos(a+w*t) for arbitrary initial phase (a) and a fixed frequency (w).

Ideally the initial phase would not be fed into the circuit as an angle "a" but instead as sin(a) and cos(a).

I'm thinking that two coupled integrators solving the differential equations:

df/dt = wg and dg/dt = -wf

will work if I set the initial values of f and g to sin(a) and cos(a).

Does anyone know of off-the-shelf parts that do all this for me? (And ideally have a little "load" signal that will reset the integrating capacitors to the sin(a) and cos(a) values I want to start at.)

If not, I think this is straightforward enough to do with op-amps in the integrators, but I'm a little unclear about a good clean way to jam the initial values of sin(a) and cos(a) onto the integrating capacitors. I'm thinking bilateral CMOS switches. Any gotchas?

Tim.

Reply to
Tim Shoppa
Loading thread data ...

That sounds like how I'd do it. If you have to do it for a great number of cycles or at frequencies much higher than audio you may have problems with your signal exponentially dying out or growing; in that case you may have to add some sort of AGC with a controlled gain someplace. You may also have some issues with charge injection, depending on the voltages involved, the frequency (since it affects capacitances) and the quality of the switches you use.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Reply to
Tim Wescott

I'm going to guess that a digital solution would be less touchy to get working, more stable over time, and cheaper... there are probalby micros/DSPs with both A/D for the initial conditions and D/A for the output, certainly possibly with a two chip solution (micro + dual DAC)

Reply to
cs_posting

My best guess as a solution also. Arbitrary angle with analog would be a bitch (unless I did it as a custom chip :-)

...Jim Thompson

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

Tim,

I agree that the digital approach is the way to go for a stable, predictable output. However, if you want to try the 2 integrator approach, you can try the following:

Assuming that the peak output is 1V, and the input resistor value is R, then . Using an analog switch, connect a feedback resistor R in parallel . with the integrating cap. Do this for both integrators. . . Using a analog switches, Connect input resistors R to both . integrator inputs. . Connect a voltage to one of the input resistors that is equal . to Sin(Theta) . Connect a voltage to the other input resistor that is equal . to Cos(Theta) . Close all switches, and allow the integrators . (Now low pass filters) to settle. This will . initialize the phase (Theta). . . Open the switches and let 'er run! . .You will have problems with integrator drift, so the 90 deg phase relationship won't last long. . Regards, Jon

Reply to
Jon

You could look into a PIC microcontroller plus Analog Devices AD9854 or 2x AD9833 (cheaper, less power)

Chris

Reply to
Chris Jones

It would probably be a lot easier to start the two integrators at zero (sin 0) and maximum (cos 0), then use a pair of 1:! inverters to get

-sin and -cos, so that you can create your phase-shifted sin and cos outputs as the linear sums of the outputs of the two integrators.

As has already been mentioned, you will need some form of automatic gain control to keep the peak amplitudes out of the integrators stable.

You'd need four potentiometers - two strung between +sin and -sin and two between +cos and -cos - to weigh the outputs of the integrators to give you the phase shifts you wanted. You used to be able to buy a pair if non-linear sin/cos pots on a common shaft, which would make setting up easier, but I suspect that today you will be stuck with buying four ten-turns pots and four turns-counting dials.

One of Analog Devices direct digital synthesis (DDS) chips offering quadrature outputs would be a rather cheaper and more user-friendly way to go.

Bill Sloman, Nijmegen

Reply to
bill.sloman

Good point, in fact if I look in my Radiation Lab books this is the way they generate this.

I want my phase to be electronically programmable with a setting time of a microsecond or so, so pots and knobs is out. But this idea may scale well enough to analog multipliers and enforcing (1-sin**2) = cos**2 to get the amplitude perfect.

Tim.

Reply to
Tim Shoppa

Then the DDS chip is the way to go, digital though it may be.

You can replace the pots and knobs with four quadrant multiplying A/D converter chips, but these didn't tend to multiply all that accurately at frequencies above about 10kHz when I last looked - the stray capacitances around the R-2R network started getting significant - and getting everything to re-settle in a microsecond or so would have been impossible.

----------------- Bill Sloman, Nijmegen

Reply to
bill.sloman

Have such a circuit diagram. Two simple integrators (cap between basis and collector) in series give 180 deg. So one add. inverter makes the circuit to oscillate.

Was used in a frequ. shifter to avoid acustics feed back in the 70ies. Can also be used to make a "Goauult voice " like in Stargate.

Complete circuit uses therefore a broadband sine/cos phaseshifter and two multipliers and adder, where one sideband is eliminated.

rgds Rudy

Reply to
newsrudy

Or may be take a look at the 8038.

Reply to
J. David

IIRC, there was a nice article in Circuit Cellar a few months ago about digital frequency and waveform synthesis.

Hint: Onve you've got the sin(wt) part figured out, cos(wt) is pretty easy.

--
Paul Hovnanian     mailto:Paul@Hovnanian.com
------------------------------------------------------------------
Who is General Failure and why is he reading my hard drive?
Reply to
Paul Hovnanian P.E.

The ALC will be fun too. If the oscillator has to produce correct output right from the start, without amplitude "bounce", then you will have to setup the ALC capacitor before turn on, possibly with some kind of opamp and reset switch setup. The ALC is a feedback circuit with an effect on distortion, and of itself can consume some development time.

Let me join the chorus - unless you are doing this as a challenge, a micro will do it with less development, less cost, less PCB area. The result will be stable over time and temperature. A tiny micro, and D/A. Simply better engineering.

What you are cooking up sounds like the sort of circuitry inside HP test gear of the 1960s and 1970s - a triumph of analog engineering.

I think we are all interested to know "why analog".

Roger Lascelles

Reply to
Roger Lascelles

In article , Roger Lascelles wrote: [...]

The ALC will need to be a proportional feedback around one of the integrators. You are having to tune the real part to truely be zero to make the loops oscillations have a steady amplitude.

The easiest way to get the ALC circuit set up would be to run the oscillator for a long time before you load the values into it. This way, the ALC will have settled before hand.

formatting link
has a micro with a DAC and some ADC inputs. The whole kit would run $100US.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

That bad? Recall our conversation a few months ago on the subject of "phase jerkers" vs PLL's. What I'm talking about here is essentially a phase-jerkable fixed-frequency analog oscillator. I thought I was being nice by saying that both the initial sine and cosine were available as analog inputs!

Have you done it? :-)

A little building in the lab makes it look like the two-op-amp integrator solution is fine up to several MHz. The bitch is loading the new phase in less than 100ns. By the time I've loaded up the phase a good fifth or tenth of an oscillation has gone by.

Maybe I should look in AoE about zeroing integrators, see if they have a good fast way of doing it, then extrapolate to loading arbitrary values into the integrators.

Tim.

Reply to
Tim Shoppa

That was done digitally.

Phase jerking analog is far more complex.

Yep, that's a killer.

Multi-bit DAC's with only HF filtering start to look attractive don't they ?:-)

...Jim Thompson

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

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.