Phase Shift Help

Discussion in 'General Electronics Chat' started by Robin Mitchell, Apr 8, 2014.

  1. Robin Mitchell

    Thread Starter Well-Known Member

    Oct 25, 2009
    734
    200
    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:
    [​IMG]
    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
     
  2. crutschow

    Expert

    Mar 14, 2008
    13,019
    3,235
    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).
     
    atferrari likes this.
  3. Veracohr

    Well-Known Member

    Jan 3, 2011
    552
    76
    Perhaps there's a way of changing the phase in the oscillator? What circuit generates the triangle wave?
     
    Robin Mitchell likes this.
  4. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    That's how I would solve it, at the source. Generate the triangle wave with the required phase shift.
     
    Robin Mitchell likes this.
  5. Robin Mitchell

    Thread Starter Well-Known Member

    Oct 25, 2009
    734
    200
    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.
     
  6. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    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
     
    Robin Mitchell likes this.
  7. Robin Mitchell

    Thread Starter Well-Known Member

    Oct 25, 2009
    734
    200
    AnalogKid, that was a nice suggestion. I shall try it as soon as!
     
  8. crutschow

    Expert

    Mar 14, 2008
    13,019
    3,235
    An XOR is usually used to give a double pulse. You should just need a buffer (non-inverting) gate.
     
  9. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,542
    1,251
    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
     
  10. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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: Apr 10, 2014
  11. Robin Mitchell

    Thread Starter Well-Known Member

    Oct 25, 2009
    734
    200
    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 :/
     
  12. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,173
    397
    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.
     
  13. t06afre

    AAC Fanatic!

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

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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. ;)
     
    Robin Mitchell likes this.
  15. Robin Mitchell

    Thread Starter Well-Known Member

    Oct 25, 2009
    734
    200
    If i had to make it using vacuum tubes, I think I would faint!
     
  16. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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?
     
Loading...