Keeping output of a phase shift oscillator in-phase with another sinusoidal signal

I have a sine wave source and a phase shift oscillator which gives out sine wave. The sine wave source is not always enabled. It may be turned of in arbitrarily time periods.

I want the phase shift oscillator to give out a sinusoidal signal in random phase when the sine wave source is disabled, and be in the same phase when the sine wave source is active.

I'm looking for a simple solution like injecting the sinusoidal signal from the sine source to one of the opamp inputs at the oscillator.

How do I implement this system?

• What frequency and how stable must the PSO be when the source is inactive, and what kind of phase error can you stand when the source is active? Aug 8, 2014 at 10:37
• Why a phase shift oscillator and why not keep the reference sinwave fully enabled all the time OR use your phase shift osc as your reference permanently. At the moment you are explaining a solution but I suspect you'll get a better answer if you step back and explain the bigger problem. Aug 8, 2014 at 11:39

The sinusoidal signal attenuates by $\sqrt 2$ at every RC stage. The magnitude of the oscillator output sinusoidal is 5Vp-p. The external sine wave comes from the ST_SIN port. It is original effective level is 6V; it is scaled to 5V by the opamp OP3B. The signal at GTM port controls the analog switch. If it is logic 0, the oscillator works as an ordinary phase shift oscillator. If it is logic 1, the oscillator is hacked by replacing the feedback signal by the sinusoidal came from the ST_SIN port; which makes the phase of the output signal very close to the phase of the external sine wave.
Note 2: I know that I don't need OP3A there (the switch has less than 50 $\Omega$ internal resistance), but it was unused in the quad opamp package, so I decided to put it there.