Pulling apart the phase shifter program
Posted: Tue Aug 26, 2014 6:55 am
Let me start by saying that I really love phase shifters and I'd love to be able to get the types of sounds I'm used to from analog phasers out of the FV-1. So I'm deconstructing the supplied phase shifter algorithm and seeing where some variation can be introduced.
First off, I think that 4 all-pass stages are required for each notch you want in the spectrum. A single all pass stage could give you 90 degrees phase shift at the highest frequency, but that is a limit, so mixing 2 stages of that with your dry signal would be more like a low pass filter. So, instead, we use 4 stages and the notch occurs when they are shifting 45 degrees each. Thus for each notch you want, use 4 phase shift stages.
Second, the structure of the phase shifter provided includes the possibility of internal overflow/distortion, which explains the scaling down by 1/64 of the input signal prior to entering the all pass banks. What I'm not sure of at this point is whether that represents 1/32 for each 4 AP stages, or 1/8th... but I'm guessing it is 1/8th. Then there is the corresponding group of 6 SOF -2.0,0 at the output, whose total gain is the 64 by which we scaled down. So, each bank of 4 APs would need 3 SOF -2.0,0 for gain recovery (and an extra SOF -1.0,0 if you wish not to invert the phase shifted signal). Of course, you can get other sounds by inverting the phase shifted signal, thereby moving the notches. Let's just do it on purpose.
The supplied algorithm multiplies the AP stage output also by the phase parameter, which goes between 0.75 and 0.95 (I'm pretty sure). That is not a huge amount of variation and for my experiments I'm considering just leaving that out completely and doing wet/dry mixing at the very end. Is there any other reason for this?
Next up is the control processing.
I'm not going to get into the complications of the S4.19 number representation in between the LOG and EXP instructions.
Based on my understanding of EXP, the parameters given are basically scale and offset after doing 2^(ACC). So is it safe to say that you could replace:
with:
??
The end result of taking the square root of the SIN wave is that you distort the symmetry, which ultimately leads to a subjectively more pleasing sweep on the phase parameter. Conceivably you could take a +/- 1.0 amplitude triangle wave and subject it to the same processing, giving a slightly different sound, or experiment with the center and width endpoints of the resulting LFO signal.
Finally, I found a little article over at CCRMA regarding the all-pass stage, which suggests that there is a structure which uses twice as many delay elements, for the benefit of preventing internal over flow.
https://ccrma.stanford.edu/~jos/pasp/Al ... Combs.html
First off, I think that 4 all-pass stages are required for each notch you want in the spectrum. A single all pass stage could give you 90 degrees phase shift at the highest frequency, but that is a limit, so mixing 2 stages of that with your dry signal would be more like a low pass filter. So, instead, we use 4 stages and the notch occurs when they are shifting 45 degrees each. Thus for each notch you want, use 4 phase shift stages.
Code: Select all
rdax p1,1
wrax temp,1
mulx phase ; actual phase shift parameter in action
rdax mono,0.015625 ;input to phase shift network
wrax p1,-1
mulx phase ; "mixing" parameter, ? is it needed ?
rdax temp,1
wrax temp1,0
The supplied algorithm multiplies the AP stage output also by the phase parameter, which goes between 0.75 and 0.95 (I'm pretty sure). That is not a huge amount of variation and for my experiments I'm considering just leaving that out completely and doing wet/dry mixing at the very end. Is there any other reason for this?
Next up is the control processing.
Code: Select all
cho rdal,sin1 ;read sin1 as +/-1
sof 0.5,0.5 ;make positive only sin ranges 0 to 1
log 0.5,0
exp 1,0 ;square root function
sof 1,-0.5 ;make +/-0.5
sof 1.999,0 ;make +/-1 again
mulx pot2 ;pot2 controls width and mix
sof 0.1,0.85
wrax phase,0 ;phase variable ranges 0.8 to 0.95
Based on my understanding of EXP, the parameters given are basically scale and offset after doing 2^(ACC). So is it safe to say that you could replace:
Code: Select all
exp 1,0 ;square root function
sof 1,-0.5 ;make +/-0.5Code: Select all
exp 1,-0.5 ;square root functionThe end result of taking the square root of the SIN wave is that you distort the symmetry, which ultimately leads to a subjectively more pleasing sweep on the phase parameter. Conceivably you could take a +/- 1.0 amplitude triangle wave and subject it to the same processing, giving a slightly different sound, or experiment with the center and width endpoints of the resulting LFO signal.
Finally, I found a little article over at CCRMA regarding the all-pass stage, which suggests that there is a structure which uses twice as many delay elements, for the benefit of preventing internal over flow.
https://ccrma.stanford.edu/~jos/pasp/Al ... Combs.html
The phaser example is one of the more challenging for me to understand. Comments/corrections certainly welcome.This can be recognized as direct form I [452], which requires 2M delays instead of M ; however, unlike direct-form II, direct-form I cannot suffer from ``internal'' overflow--overflow can happen only at the output.