DSPRelated.com
Forums

Slightly O.T.: 90 degree phase shift of sinusoidal wave using analog components

Started by Unknown November 21, 2006
Randy Yates wrote:
> Jerry Avins <jya@ieee.org> writes: > >> Randy Yates wrote: >> >> ... >> >>> Unless you do something special to the phase detector, it wouldn't be >>> in quadrature but in direct lock. >>> Now if you could somehow introduce a 90-degree offset in the phase >>> detector, you'd be talking. >> The simplest analog PLLs use an XOR gate as a phase detector. The >> local oscillator is locked to quadrature by such circuits. Digital >> PLLs can be built the same way, but they aren't necessarily simplest. > > What if the designer didn't want quadrature lock but direct lock?
It's a bit more involved. In the early days, before integrated PLL chips, we sometimes cascaded two "standard" PLLs. The CD4046 gave the designer the option of an XOR detector (quadrature, could lock on a harmonic) and a state-machine detector (in-phase guaranteed lock). Nifty chip. Motorola made a nice one too, with different features. An XOR detector is simplicity in itself, and the first digital one I built, long before I heard of a Costas loop. It ran, IIRC, on a Z-80. The local VCO and the signal to be tracked each feed an XOR input. When the two signals are in quadrature, the output is a perfect square wave at double frequency. As the phase slips, the duty cycle changes, and the DC average either rises or falls. A low-pass filter extracts the DC and drives the VCO. The phase is only perfect quadrature if the free-running VCO matches the signal to be tracked unless the loop has integration. (Same an any other servo.) The XOR/low-pass filter combination is a simple synchronous detector. Back when one made an XOR out of four NANDs (and those were on a PC card using transistors), I generally used a diode ring instead. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins <jya@ieee.org> writes:

> Randy Yates wrote: >> Jerry Avins <jya@ieee.org> writes: >> >>> Randy Yates wrote: >>> >>> ... >>> >>>> Unless you do something special to the phase detector, it wouldn't be >>>> in quadrature but in direct lock. >>>> Now if you could somehow introduce a 90-degree offset in the phase >>>> detector, you'd be talking. >>> The simplest analog PLLs use an XOR gate as a phase detector. The >>> local oscillator is locked to quadrature by such circuits. Digital >>> PLLs can be built the same way, but they aren't necessarily simplest. >> What if the designer didn't want quadrature lock but direct lock? > > It's a bit more involved. In the early days, before integrated PLL > chips, we sometimes cascaded two "standard" PLLs. The CD4046 gave the > designer the option of an XOR detector (quadrature, could lock on a > harmonic) and a state-machine detector (in-phase guaranteed > lock). Nifty chip. Motorola made a nice one too, with different > features. > > An XOR detector is simplicity in itself, and the first digital one I > built, long before I heard of a Costas loop. It ran, IIRC, on a Z-80. > > The local VCO and the signal to be tracked each feed an XOR > input. When the two signals are in quadrature, the output is a perfect > square wave at double frequency. As the phase slips, the duty cycle > changes, and the DC average either rises or falls. A low-pass filter > extracts the DC and drives the VCO. > > The phase is only perfect quadrature if the free-running VCO matches > the signal to be tracked unless the loop has integration. (Same an any > other servo.) The XOR/low-pass filter combination is a simple > synchronous detector. Back when one made an XOR out of four NANDs (and > those were on a PC card using transistors), I generally used a diode > ring instead.
That is truly fascinating, Jerry. Reminds me of an era when electronics was hands-on and fun! I had to Google for diode ring, and I still don't really get it. It looks a lot like a full-wave rectifier to me. -- % Randy Yates % "Rollin' and riding and slippin' and %% Fuquay-Varina, NC % sliding, it's magic." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Living' Thing', *A New World Record*, ELO http://home.earthlink.net/~yatescr
Randy Yates wrote:
> "Major Misunderstanding" <mad@uni.com> writes: > > > <jaco.versfeld@gmail.com> wrote in message > > news:1164095780.785134.255820@j44g2000cwa.googlegroups.com... > >> Hi, > >> > >> I apologise if this is not strictly DSP related, but it is still signal > >> processing related. > >> > >> Basically my question is how one can get a 90 degree phase shifted > >> version of a sinusoidal wave using analog components. The only > >> challenge is that the frequency will not be fixed. > >> > >> For a fixed frequency, one could use an all-pass filter. (Are there > >> any other solutions for a fixed frequency.) > >> > >> Basically, I am trying to build a QPSK modulator, and would like to > >> implement frequency hopping as well. > >> > >> Is there a way that this could be done digitally at say 433 MHz? > >> > >> Any thoughts, suggestions and/or pointers to literature would be > >> greatly appreciated. > >> Jaco Versfeld > >> > > > > If it's a pure sine wave then use a phase-locked loop. when in lock > > the VCO output will be in phase quadrature with the inpute > > Unless you do something special to the phase detector, it wouldn't be > in quadrature but in direct lock. > > Now if you could somehow introduce a 90-degree offset in the phase > detector, you'd be talking. > -- > % Randy Yates % "How's life on earth? > %% Fuquay-Varina, NC % ... What is it worth?" > %%% 919-577-9882 % 'Mission (A World Record)', > %%%% <yates@ieee.org> % *A New World Record*, ELO > http://home.earthlink.net/~yatescr
When a PLL is in lock the VCO output is in phase quadrature. You get a cos X sin term which get's integrated to zero phase error. I believe a lot of people believe a PLL gives out a waveform that is IN PHASE - it isn't. It's in quadrature phase. The filter output tracts the rate of change of phase (or instantaneous frequency). A PLL will do the job. Naebad
Randy Yates wrote:

   ...

> I had to Google for diode ring, and I still don't really get it. It > looks a lot like a full-wave rectifier to me.
Look for "balanced modulator". The output is the sum frequency (that double-frequency square wave) and difference frequency (the DC). Why it locks up when the frequency is off is fairly easy to see. The integrated phase error lasts longer when it's pushing the VCO into lock direction than it does when pulling the VCO away from lock. In the end, persistence wins. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"naebad" <minnaebad@yahoo.co.uk> writes:

> Randy Yates wrote: >> "Major Misunderstanding" <mad@uni.com> writes: >> >> > <jaco.versfeld@gmail.com> wrote in message >> > news:1164095780.785134.255820@j44g2000cwa.googlegroups.com... >> >> Hi, >> >> >> >> I apologise if this is not strictly DSP related, but it is still signal >> >> processing related. >> >> >> >> Basically my question is how one can get a 90 degree phase shifted >> >> version of a sinusoidal wave using analog components. The only >> >> challenge is that the frequency will not be fixed. >> >> >> >> For a fixed frequency, one could use an all-pass filter. (Are there >> >> any other solutions for a fixed frequency.) >> >> >> >> Basically, I am trying to build a QPSK modulator, and would like to >> >> implement frequency hopping as well. >> >> >> >> Is there a way that this could be done digitally at say 433 MHz? >> >> >> >> Any thoughts, suggestions and/or pointers to literature would be >> >> greatly appreciated. >> >> Jaco Versfeld >> >> >> > >> > If it's a pure sine wave then use a phase-locked loop. when in lock >> > the VCO output will be in phase quadrature with the inpute >> >> Unless you do something special to the phase detector, it wouldn't be >> in quadrature but in direct lock. >> >> Now if you could somehow introduce a 90-degree offset in the phase >> detector, you'd be talking. >> -- >> % Randy Yates % "How's life on earth? >> %% Fuquay-Varina, NC % ... What is it worth?" >> %%% 919-577-9882 % 'Mission (A World Record)', >> %%%% <yates@ieee.org> % *A New World Record*, ELO >> http://home.earthlink.net/~yatescr > > > When a PLL is in lock the VCO output is in phase quadrature. You get a > cos X sin term which get's integrated to zero phase error.
If you're talking about a multiplier circuit in the phase detector, I agree. Since the filtered output of the multiplier with cos(wc*t+p1) and cos(wc*t+p2) as inputs is cos(p1-p2), and the loop drives this error to zero, and cos(x) = 0 when p1-p2 = 90, the resulting output is in phase quadrature. Thanks for bringing this up - I never thought about it. As you said, I would've thought a typical PLL locks direct, not in quadrature. -- % Randy Yates % "Maybe one day I'll feel her cold embrace, %% Fuquay-Varina, NC % and kiss her interface, %%% 919-577-9882 % til then, I'll leave her alone." %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr
Randy Yates wrote:

   ...

> If you're talking about a multiplier circuit in the phase detector, I > agree. Since the filtered output of the multiplier with cos(wc*t+p1) > and cos(wc*t+p2) as inputs is cos(p1-p2), and the loop drives this > error to zero, and cos(x) = 0 when p1-p2 = 90, the resulting output is > in phase quadrature. > > Thanks for bringing this up - I never thought about it. As you said, > I would've thought a typical PLL locks direct, not in quadrature.
Think of the XOR or balanced modulator as a multiplier. If the harmonics of a square wave don't hurt (in a PLL they actually increase the gain by 4/pi) just multiplying the sine bits is enough. XORing the analog signals does that. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:


> ... just multiplying the sine bits is enough. XORing the analog
Gaaah! Sign bits! Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins <jya@ieee.org> writes:

> Randy Yates wrote: > > ... > >> If you're talking about a multiplier circuit in the phase detector, I >> agree. Since the filtered output of the multiplier with cos(wc*t+p1) >> and cos(wc*t+p2) as inputs is cos(p1-p2), and the loop drives this >> error to zero, and cos(x) = 0 when p1-p2 = 90, the resulting output is >> in phase quadrature. >> Thanks for bringing this up - I never thought about it. As you said, >> I would've thought a typical PLL locks direct, not in quadrature. > > Think of the XOR or balanced modulator as a multiplier. If the > harmonics of a square wave don't hurt (in a PLL they actually increase > the gain by 4/pi) just multiplying the sine bits is enough. XORing the > analog signals does that.
How in the HECK would you "XOR" analog signals? You don't seriously mean inputting analog signals into a digital device? -- % Randy Yates % "I met someone who looks alot like you, %% Fuquay-Varina, NC % she does the things you do, %%% 919-577-9882 % but she is an IBM." %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr
Randy Yates wrote:
> Jerry Avins <jya@ieee.org> writes: > >> Randy Yates wrote: >> >> ... >> >>> If you're talking about a multiplier circuit in the phase detector, I >>> agree. Since the filtered output of the multiplier with cos(wc*t+p1) >>> and cos(wc*t+p2) as inputs is cos(p1-p2), and the loop drives this >>> error to zero, and cos(x) = 0 when p1-p2 = 90, the resulting output is >>> in phase quadrature. >>> Thanks for bringing this up - I never thought about it. As you said, >>> I would've thought a typical PLL locks direct, not in quadrature. >> Think of the XOR or balanced modulator as a multiplier. If the >> harmonics of a square wave don't hurt (in a PLL they actually increase >> the gain by 4/pi) just multiplying the sine bits is enough. XORing the >> analog signals does that. > > How in the HECK would you "XOR" analog signals? You don't seriously mean > inputting analog signals into a digital device?
Why not? With CMOS, make amplifiers out of inverters with resistive feedback from output to input and a resistor and capacitor in the input, and run the clipped signal into a gate. Inside, all circuits (except maybe magnetic cores) are analog. +----\/\/\/\----+ | | | |\ | Gain ~= 23 dB __| |_/\/\/\___|______| \______|___ | | | / |/ Without too much fuss, this works with TTL, too, but you need to watch the dissipation. It's best to use open-collector inverters and a reasonable resistor to + from the output. The asymmetry isn't usually a killer. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:

> Why not? With CMOS, make amplifiers out of inverters with resistive > feedback from output to input and a resistor and capacitor in the input, > and run the clipped signal into a gate. Inside, all circuits (except > maybe magnetic cores) are analog. > > > +----\/\/\/\----+ > | | > | |\ | Gain ~= 23 dB > __| |_/\/\/\___|______| \______|___ > | | | / > |/ > > Without too much fuss, this works with TTL, too, but you need to watch > the dissipation. It's best to use open-collector inverters and a > reasonable resistor to + from the output. The asymmetry isn't usually a > killer. > > Jerry
I can confirm that. It reminds me of my student days, when I realized that these simple digital ICs (7400,...) work as perfect analog amplifiers as long as the amplitude and offset is kept within the transient region. And they were so fast and cheap!! Bernhard