Hello, I've been trying to get a simple all-pass algorithm to work.
I've got a doc that shows this, where APs are cascaded all-passes:
in------[AP]-->--[AP]-----------> out
| |
----<---(X gain < 1)---|
It states that the output of the cascaded APs can be fed back 'after a
moderate delay' and added to the input. It also says because they are
all-pass, then the system will never go unstable, even if values of feedback
gain close to 1.0.
I've found the system to go very unstable even if the feedback gain is as
low as 0.1.
I understand they may have over simplified the information, but should this
work at all? If so, can someone please give me some real numbers to plug
into this so I can see if I've missed anything.
Thanks,
David
Feedback into all-pass cascade
Started by ●September 15, 2008
Reply by ●September 15, 20082008-09-15
VelociChicken wrote:> Hello, I've been trying to get a simple all-pass algorithm to work. > I've got a doc that shows this, where APs are cascaded all-passes: > > in------[AP]-->--[AP]-----------> out > | | > ----<---(X gain < 1)---| > > It states that the output of the cascaded APs can be fed back 'after a > moderate delay' and added to the input. It also says because they are > all-pass, then the system will never go unstable, even if values of feedback > gain close to 1.0. > I've found the system to go very unstable even if the feedback gain is as > low as 0.1. > I understand they may have over simplified the information, but should this > work at all? If so, can someone please give me some real numbers to plug > into this so I can see if I've missed anything.Note that I'm not questioning what in heck you're trying to do -- I'll leave that for someone else to undertake. If the all-pass filters really are all-pass with unity gain, then as long as the feedback is lower than unity the overall system should be stable. But the overall system won't be remotely all pass any more. The system _will_ go unstable if the loop gain magnitude exceeds unity; whether it becomes a rising sine wave or just an exponential ramp depends on the details of the system. Verify that your all pass networks are truly all pass, and that they're unity gain. Your problem has to be one or the other. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
Reply by ●September 15, 20082008-09-15
On Sep 15, 3:39 pm, "VelociChicken" <b...@yahoob.com> wrote:> Hello, I've been trying to get a simple all-pass algorithm to work. > I've got a doc that shows this, where APs are cascaded all-passes: > > in--->(+)-->[AP]---->[AP]-------*----> out > ^ | > | | > |---<---(X gain < 1)<----- > > It states that the output of the cascaded APs can be fed back 'after a > moderate delay' and added to the input. It also says because they are > all-pass, then the system will never go unstable, even if values of feedback > gain close to 1.0. > I've found the system to go very unstable even if the feedback gain is as > low as 0.1. > I understand they may have over simplified the information, but should this > work at all? If so, can someone please give me some real numbers to plug > into this so I can see if I've missed anything.the Barkhausen criteria says that to make a feedback network become an oscillator, the magnitude of the loop gain needs to be greater than or equal to 1 (0 dB) at some frequency where the phase shift around the loop is an integer multiple of 2*pi. so the loop gain must be real, positive, and at least as big as 1 at some frequency for it to oscillate at that frequency. so if you're loop gain is never greater than or equal to 1 at any frequency (your feedback gain is less than 1, how about the APF gain, are you sure they are 0 dB APFs?), it shouldn't oscillate. r b-j
Reply by ●September 16, 20082008-09-16
On Sep 16, 7:39 am, "VelociChicken" <b...@yahoob.com> wrote:> Hello, I've been trying to get a simple all-pass algorithm to work. > I've got a doc that shows this, where APs are cascaded all-passes: > > in------[AP]-->--[AP]-----------> out > | | > ----<---(X gain < 1)---| > > It states that the output of the cascaded APs can be fed back 'after a > moderate delay' and added to the input. It also says because they are > all-pass, then the system will never go unstable, even if values of feedback > gain close to 1.0. > I've found the system to go very unstable even if the feedback gain is as > low as 0.1. > I understand they may have over simplified the information, but should this > work at all? If so, can someone please give me some real numbers to plug > into this so I can see if I've missed anything. > > Thanks, > > DavidThis nonsense! Somebody is having you on! It's the pahse that is the problem. An all-pass acts like an approximate time-delay and adding it to any control-loop is a bad idea because the pahse-margin will be killed off. All you could hope for is a very small bandwidth at most. Maybe you are thinking of a phase-lead? You cannot put in endless phase-leads either because they excit the structural resonance, amplify noise etc.
Reply by ●September 16, 20082008-09-16
On Sep 16, 2:26 pm, robert bristow-johnson <r...@audioimagination.com> wrote:> On Sep 15, 3:39 pm, "VelociChicken" <b...@yahoob.com> wrote: > > > > > Hello, I've been trying to get a simple all-pass algorithm to work. > > I've got a doc that shows this, where APs are cascaded all-passes: > > > in--->(+)-->[AP]---->[AP]-------*----> out > > ^ | > > | | > > |---<---(X gain < 1)<----- > > > It states that the output of the cascaded APs can be fed back 'after a > > moderate delay' and added to the input. It also says because they are > > all-pass, then the system will never go unstable, even if values of feedback > > gain close to 1.0. > > I've found the system to go very unstable even if the feedback gain is as > > low as 0.1. > > I understand they may have over simplified the information, but should this > > work at all? If so, can someone please give me some real numbers to plug > > into this so I can see if I've missed anything. > > the Barkhausen criteria says that to make a feedback network become > an oscillator, the magnitude of the loop gain needs to be greater than > or equal to 1 (0 dB) at some frequency where the phase shift around > the loop is an integer multiple of 2*pi. so the loop gain must be > real, positive, and at least as big as 1 at some frequency for it to > oscillate at that frequency. > > so if you're loop gain is never greater than or equal to 1 at any > frequency (your feedback gain is less than 1, how about the APF gain, > are you sure they are 0 dB APFs?), it shouldn't oscillate. > > r b-jIt is Phase-Margin that counts ie how close the phase is to -180 degrees at unity gain. (taking account of the extra minus for negative feedback - thats where you get your 360 degrees - not a good way to explain it though I have seen it in many books on amplifier design. By adding all-pass networks you make the phase more negative and hence more unstable.
Reply by ●September 16, 20082008-09-16
On Sep 16, 2:05�am, HardySpicer <gyansor...@gmail.com> wrote:> On Sep 16, 2:26 pm, robert bristow-johnson <r...@audioimagination.com> > wrote: > > > > > > > On Sep 15, 3:39 pm, "VelociChicken" <b...@yahoob.com> wrote: > > > > Hello, I've been trying to get a simple all-pass algorithm to work. > > > I've got a doc that shows this, where APs are cascaded all-passes: > > > > �in--->(+)-->[AP]---->[AP]-------*----> out > > > � � � � ^ � � � � � � � � � � � �| > > > � � � � | � � � � � � � � � � � �| > > > � � � � |---<---(X gain < 1)<----- > > > > It states that the output of the cascaded APs can be fed back 'after a > > > moderate delay' and added to the input. It also says because they are > > > all-pass, then the system will never go unstable, even if values of feedback > > > gain close to 1.0. > > > I've found the system to go very unstable even if the feedback gain is as > > > low as 0.1. > > > I understand they may have over simplified the information, but should this > > > work at all? If so, can someone please give me some real numbers to plug > > > into this so I can see if I've missed anything. > > > the Barkhausen criteria says that to make a �feedback network become > > an oscillator, the magnitude of the loop gain needs to be greater than > > or equal to 1 (0 dB) at some frequency where the phase shift around > > the loop is an integer multiple of 2*pi. �so the loop gain must be > > real, positive, and at least as big as 1 at some frequency for it to > > oscillate at that frequency. > > > so if you're loop gain is never greater than or equal to 1 at any > > frequency (your feedback gain is less than 1, how about the APF gain, > > are you sure they are 0 dB APFs?), it shouldn't oscillate. > > > r b-j > > It is Phase-Margin that counts ie how close the phase is to -180 > degrees at unity gain. (taking account of the extra minus for negative > feedback - thats where you get your 360 degrees - not a good way to > explain it though I have seen it in many books on amplifier design. By > adding all-pass networks you make the phase more negative and hence > more unstable.- Hide quoted text - > > - Show quoted text -I agree that with loop gain < 1 it should be stable. Try setting the feedback to 0 and make sure the foward path is truly allpass and does not oscillate all by itself (some filter packages spit out a1 and a2 in difference-equation form rather than transfer-function form). On a side note, we sigma-delta guys have been building "conditionally stable" feedback loops for many years (about 1/2 of all audio A/D's use them). In these loops you will find frequency points where the phase shift around the loop is 0 degrees and the loop gain is larger than 1, but the system is stable. This represents a major violation of intuition! The trick is that if the open-loop system has N low-frequency poles then you need to have N-1 open-loop zeroes before you hit the unity- gain point (see the "Nyquist Criteria"). Bob
Reply by ●September 16, 20082008-09-16
> VelociChicken wrote: >> Hello, I've been trying to get a simple all-pass algorithm to work. >> I've got a doc that shows this, where APs are cascaded all-passes: >> >> in------[AP]-->--[AP]-----------> out >> | | >> ----<---(X gain < 1)---| >> >> It states that the output of the cascaded APs can be fed back 'after a >> moderate delay' and added to the input. It also says because they are >> all-pass, then the system will never go unstable, even if values of >> feedback gain close to 1.0. >> I've found the system to go very unstable even if the feedback gain is as >> low as 0.1. >> I understand they may have over simplified the information, but should >> this work at all? If so, can someone please give me some real numbers to >> plug into this so I can see if I've missed anything. > > Note that I'm not questioning what in heck you're trying to do -- I'll > leave that for someone else to undertake. > > If the all-pass filters really are all-pass with unity gain, then as long > as the feedback is lower than unity the overall system should be stable. > But the overall system won't be remotely all pass any more. > > The system _will_ go unstable if the loop gain magnitude exceeds unity; > whether it becomes a rising sine wave or just an exponential ramp depends > on the details of the system. > > Verify that your all pass networks are truly all pass, and that they're > unity gain. Your problem has to be one or the other. > Tim WescottThanks Tim, as you thought this should be stable, I went to check the all-pass code. Guess what - never trust 'black box' code off the internet! I've spent an entire week re-writing surrounding code about 20 times, during experiments, thinking I was doing the wrong thing sometimes, when really I was using broken filters. Ho-hum - some kind of lessen there, something like 'don't build a house with crap cement,' or something... : ) It's a simplified diagram of APs used in audio room reverb simulations, so it's definitely useful and not 'nonsense' as someone stated! Thanks again for pushing the word 'unity' at me Tim. Regards, D
Reply by ●September 16, 20082008-09-16
On Sep 16, 8:43 pm, Robert Adams <robert.ad...@analog.com> wrote:> On Sep 16, 2:05 am, HardySpicer <gyansor...@gmail.com> wrote: > > > > > On Sep 16, 2:26 pm, robert bristow-johnson <r...@audioimagination.com> > > wrote: > > > > On Sep 15, 3:39 pm, "VelociChicken" <b...@yahoob.com> wrote: > > > > > Hello, I've been trying to get a simple all-pass algorithm to work. > > > > I've got a doc that shows this, where APs are cascaded all-passes: > > > > > in--->(+)-->[AP]---->[AP]-------*----> out > > > > ^ | > > > > | | > > > > |---<---(X gain < 1)<----- > > > > > It states that the output of the cascaded APs can be fed back 'after a > > > > moderate delay' and added to the input. It also says because they are > > > > all-pass, then the system will never go unstable, even if values of feedback > > > > gain close to 1.0. > > > > I've found the system to go very unstable even if the feedback gain is as > > > > low as 0.1. > > > > I understand they may have over simplified the information, but should this > > > > work at all? If so, can someone please give me some real numbers to plug > > > > into this so I can see if I've missed anything. > > > > the Barkhausen criteria says that to make a feedback network become > > > an oscillator, the magnitude of the loop gain needs to be greater than > > > or equal to 1 (0 dB) at some frequency where the phase shift around > > > the loop is an integer multiple of 2*pi. so the loop gain must be > > > real, positive, and at least as big as 1 at some frequency for it to > > > oscillate at that frequency. > > > > so if you're loop gain is never greater than or equal to 1 at any > > > frequency (your feedback gain is less than 1, how about the APF gain, > > > are you sure they are 0 dB APFs?), it shouldn't oscillate. > > > > r b-j > > > It is Phase-Margin that counts ie how close the phase is to -180 > > degrees at unity gain. (taking account of the extra minus for negative > > feedback - thats where you get your 360 degrees - not a good way to > > explain it though I have seen it in many books on amplifier design. By > > adding all-pass networks you make the phase more negative and hence > > more unstable.- Hide quoted text - > > > - Show quoted text - > > I agree that with loop gain < 1 it should be stable. Try setting the > feedback to 0 and make sure the foward path is truly allpass and does > not oscillate all by itself (some filter packages spit out a1 and a2 > in difference-equation form rather than transfer-function form). > > On a side note, we sigma-delta guys have been building "conditionally > stable" feedback loops for many years (about 1/2 of all audio A/D's > use them). In these loops you will find frequency points where the > phase shift around the loop is 0 degrees and the loop gain is larger > than 1, but the system is stable. > > This represents a major violation of intuition! > > The trick is that if the open-loop system has N low-frequency poles > then you need to have N-1 open-loop zeroes before you hit the unity- > gain point (see the "Nyquist Criteria"). > > BobNothing new there. A zero introduces phase-lead cancelling out phase- lag. LTI control systems have been done to death and are very well understood. Add a bit of non-linearity though and it is a difference story.
Reply by ●September 16, 20082008-09-16
On Sep 17, 12:45 am, "VelociChicken" <b...@yahoob.com> wrote:> > VelociChicken wrote: > >> Hello, I've been trying to get a simple all-pass algorithm to work. > >> I've got a doc that shows this, where APs are cascaded all-passes: > > >> in------[AP]-->--[AP]-----------> out > >> | | > >> ----<---(X gain < 1)---| > > >> It states that the output of the cascaded APs can be fed back 'after a > >> moderate delay' and added to the input. It also says because they are > >> all-pass, then the system will never go unstable, even if values of > >> feedback gain close to 1.0. > >> I've found the system to go very unstable even if the feedback gain is as > >> low as 0.1. > >> I understand they may have over simplified the information, but should > >> this work at all? If so, can someone please give me some real numbers to > >> plug into this so I can see if I've missed anything. > > > Note that I'm not questioning what in heck you're trying to do -- I'll > > leave that for someone else to undertake. > > > If the all-pass filters really are all-pass with unity gain, then as long > > as the feedback is lower than unity the overall system should be stable. > > But the overall system won't be remotely all pass any more. > > > The system _will_ go unstable if the loop gain magnitude exceeds unity; > > whether it becomes a rising sine wave or just an exponential ramp depends > > on the details of the system. > > > Verify that your all pass networks are truly all pass, and that they're > > unity gain. Your problem has to be one or the other. > > Tim Wescott > > Thanks Tim, as you thought this should be stable, I went to check the > all-pass code. Guess what - never trust 'black box' code off the internet! > I've spent an entire week re-writing surrounding code about 20 times, during > experiments, thinking I was doing the wrong thing sometimes, when really I > was using broken filters. Ho-hum - some kind of lessen there, something like > 'don't build a house with crap cement,' or something... : ) > > It's a simplified diagram of APs used in audio room reverb simulations, so > it's definitely useful and not 'nonsense' as someone stated! > > Thanks again for pushing the word 'unity' at me Tim. > > Regards, > DIt is nonsense! You cannot re-write the laws of physics!! When the gain is unity the phase must be less than -180 for a -ve feedback system. Did you not study control of any sort? Time-delays are bad news for a control loop of ANY sort. An all-pass is a crude approximation to a time-delay. Here is how exp(-sT) = exp(-sT/2)/(exp(+sT/2) = (approx) (1-sT/2/)(1+sT/2) an all pass.
Reply by ●September 16, 20082008-09-16
> Note that I'm not questioning what in heck you're trying to do -- I'll > leave that for someone else to undertake.it looks very much like he is making a phaser or reverb effect (depending on the parameters of the APF's) like here: http://ccrma.stanford.edu/~jos/pasp/Classic_Virtual_Analog_Phase.html from that paper: "Finally, since the gain of the allpass string is unity (by definition of allpass filters), the gain of the entire structure is strictly bounded between 0 and 2. This property allows arbitrary notch controls to be applied without fear of the overall gain becoming ill-behaved. " but JOS (is he on this list???) isn't considering feedback, it looks like... implementing digital phasers in the past, i've found that feedback makes things certainly sound richer, but is pretty scary... gain needs to be prettttty small... a small variable delay can improve both the stability and the richness of the sound possiblities....> If the all-pass filters really are all-pass with unity gain, then as > long as the feedback is lower than unity the overall system should be > stable. �But the overall system won't be remotely all pass any more. > > The system _will_ go unstable if the loop gain magnitude exceeds unity; > whether it becomes a rising sine wave or just an exponential ramp > depends on the details of the system. > > Verify that your all pass networks are truly all pass, and that they're > unity gain. �Your problem has to be one or the other. > > -- > > Tim Wescott > Wescott Design Serviceshttp://www.wescottdesign.com > > Do you need to implement control loops in software? > "Applied Control Theory for Embedded Systems" gives you just what it says. > See details athttp://www.wescottdesign.com/actfes/actfes.html- Hide quoted text - > > - Show quoted text -






