Phase Shift Help

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
Hi everyone long time no see!

Anyway I have an assignment which involves constructing a synthesiser. Now I got it working (even included extras like an LFO and pitch bend), but there is one extra thing I need to do that im unsure about how to approach.

It is required that the triangle waveform can be phased shifted between 0 and 180 degrees using a control voltage that varies between 0 and 1V.

So I have a phase shifter working except that the output is not triangular but more smooth on the extremes (like a nice curve). I believe this is to do with the capacitor smoothing the incoming wave. Below is the circuit I am using:

Where the variable resistor is replaced with an NMOS with the gate being the control.

Because this has horrible distortion when the phase shift approaches 180 (if anything, beyond 30 degrees is nasty), I have chained many (at least 8), in series with each one producing a tiny shift creating one big shift. But the output of any stage has that smoothness to it.

Any help here? Point me in the right direction?
All the best guys,
Robin
 

crutschow

Joined Mar 14, 2008
34,464
The problem is that the phase of a phase-shift circuit using reactive components depends upon frequency, and a triangle wave consists of many (Fourier) frequencies. The varying phase-shift of these frequencies causes distortion in the triangle wave, since all the components don't have the same time-shift

So to shift the phase of a triangle wave without distortion you need a delay that is independent of the frequency components. This can be done with a bucket-brigade delay, for example. Note that the sample frequency of the bucket-brigade must be higher than twice the highest frequency component in the triangle wave you want to shift (i.e. the amount of rounding you can tolerate at the triangle wave edges).
 

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
That would be great if I could adjust the phase shift from the source, but this thing needs to produce both waveforms, one is the phase shift of the other. then they can be added together in any desired mix.
 

AnalogKid

Joined Aug 1, 2013
11,055
It still can come from the source. If your triangle wave comes from a square wave going through an integrator, then branch out from the square wave source before the first integrator, through a variable delay to a second integrator that is identical (within component tolerances and adjustments) to the first. Now your problem is a variable digital delay, way easier to solve. First thing that pops to mind is an RC delay into an exclusive OR gate, with your FET as the R.

ak
 

crutschow

Joined Mar 14, 2008
34,464
......................................... Now your problem is a variable digital delay, way easier to solve. First thing that pops to mind is an RC delay into an exclusive OR gate, with your FET as the R.
An XOR is usually used to give a double pulse. You should just need a buffer (non-inverting) gate.
 

AnalogKid

Joined Aug 1, 2013
11,055
Yeah, I know. I was thinking of the XOR output clocking a toggle flip-flop, but now I can't think of why I was going down that path. The idea is left over from a past project.

ak
 

THE_RB

Joined Feb 11, 2008
5,438
That would be great if I could adjust the phase shift from the source, but this thing needs to produce both waveforms, one is the phase shift of the other. then they can be added together in any desired mix.
Then use a PIC and some code?

The PIC can detect the input frequency and edge of the triangle wave (sync) then it just creates a new triangle wave with the desired freq and phase offset using PWM.

Total parts count; PIC and one resistor and one cap (for the PWM filter).

Lately it seems like just about every electronics problem people ask can be solved with a cheap micro and some code and practically zero parts. Maybe we should be promoting using micros more instead of old fashioned multi-chip solutions with tons of discretes?

(edit) Actually it could be simpler than that. The PIC could just sense the voltage and direction of instant points in the triangle wave, then use a lookup table or math to directly translate that point to the new point at the correct phase offset (and then make PWM). That would all work independent of any frequency, and provide a true phase offset of whatever the input waveform was doing.

And if you had different lookup tables, you could output a different waveshape than the incoming waveshape. Like a triangle coming in but a sine going out, with the same frequency and the desired phase offset... Interesting!

I've got some good ideas for a working algorithm if you want to get PICcy with it. :)
 
Last edited:

Thread Starter

Robin Mitchell

Joined Oct 25, 2009
819
THE_RB the assignment is an analogue synthesiser so I think PICS and other micros, no matter how awesome, are out of the question. The module that set the assignment is also called "analogue electronics" so again, I dont think digital systems are acceptable :/
 

Bernard

Joined Aug 7, 2008
5,784
Might it be possible to pass triangle wave thru low pass filter, do your phase shifting, then convert to a square wave, then intigrate to a triangle wave. Obtaining a 0 shift might be difficult.
 

t06afre

Joined May 11, 2009
5,934
The Elektor magzine had an analog synth project back in 1977. Just google Elektor Formant Music Synthesiser. See if that gives some design ideas
 

THE_RB

Joined Feb 11, 2008
5,438
THE_RB the assignment is an analogue synthesiser so I think PICS and other micros, no matter how awesome, are out of the question. The module that set the assignment is also called "analogue electronics" so again, I dont think digital systems are acceptable :/
Ahhh. One of those old fashioned courses! Well it's not quite as bad as expecting you to use vacuum tubes to do it.

That will be in your next module. ;)
 

THE_RB

Joined Feb 11, 2008
5,438
Might it be possible to pass triangle wave thru low pass filter, do your phase shifting, then convert to a square wave, then intigrate to a triangle wave. Obtaining a 0 shift might be difficult.
You could also peak detect, giving a fast square wave pulse, then use an adjustable RC delay (ie monostable) then generate a new triangle wave from that.

And are these triangle waves or sawtooth waves?
 
Top