DSPRelated.com
Forums

Gain of an IIR Filter

Started by gokul_s1 September 2, 2007
robert bristow-johnson wrote:

   ...

> that's clearly true. even if the loudspeaker is omni-directional, > phase still depends on the distance one is away from the loudspeaker > (the linear-phase term resulting from delay) and such a change in > phase (from an isolated omni-directional loudspeaker) is not audible > because it is just a very small delay and the listener has no > reference to compare such listened audio to.
Is that true even when the environment supports echoes? ... Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
On Sep 3, 11:48 pm, Jerry Avins <j...@ieee.org> wrote:
> robert bristow-johnson wrote: > > ... > > > that's clearly true. even if the loudspeaker is omni-directional, > > phase still depends on the distance one is away from the loudspeaker > > (the linear-phase term resulting from delay) and such a change in > > phase (from an isolated omni-directional loudspeaker) is not audible > > because it is just a very small delay and the listener has no > > reference to compare such listened audio to. > > Is that true even when the environment supports echoes?
well, it's not the same thing. a pure delay is just that. you hear the original signal *once* at some delay and no echoes after that. if you have no reference to compare the possibly delayed signal to, how would you know it sounds different than it would have sounded if it had arrived at your ears 500 ms earlier. if echoes start happening to a sound, it is not a pure delay (and might not even be an APF, so there would be magnitude variations in the frequency response), and you are hearing that. now, a certain APF (that i postulated) will sound like echoes, and being an APF, it's perfectly flat amplitude response. here is a case where nothing but a pure phase-change (albeit a pretty messy one) cause audible differences. not all phase changes are perceived, but it's not safe, even in audio systems, to assume that phase is not perceptually salient and that we can just change it to zero or another convenient value. sometimes you can and sometimes you clearly can't and sometimes it's hard to tell. i remember posting a short MATLAB program that scrambles up the phases of a partial sum of a square wave. it made the wave look like crap, but it still sounded like a wimpy bandlimited square wave. without some non-linearity processing afterward, it *was* hard to hear the phase changes. r b-j
robert bristow-johnson wrote:
> On Sep 3, 11:48 pm, Jerry Avins <j...@ieee.org> wrote: >> robert bristow-johnson wrote: >> >> ... >> >>> that's clearly true. even if the loudspeaker is omni-directional, >>> phase still depends on the distance one is away from the loudspeaker >>> (the linear-phase term resulting from delay) and such a change in >>> phase (from an isolated omni-directional loudspeaker) is not audible >>> because it is just a very small delay and the listener has no >>> reference to compare such listened audio to. >> Is that true even when the environment supports echoes? > > well, it's not the same thing. a pure delay is just that. you hear > the original signal *once* at some delay and no echoes after that. if > you have no reference to compare the possibly delayed signal to, how > would you know it sounds different than it would have sounded if it > had arrived at your ears 500 ms earlier. if echoes start happening to > a sound, it is not a pure delay (and might not even be an APF, so > there would be magnitude variations in the frequency response), and > you are hearing that. > > now, a certain APF (that i postulated) will sound like echoes, and > being an APF, it's perfectly flat amplitude response. here is a case > where nothing but a pure phase-change (albeit a pretty messy one) > cause audible differences. not all phase changes are perceived, but > it's not safe, even in audio systems, to assume that phase is not > perceptually salient and that we can just change it to zero or another > convenient value. sometimes you can and sometimes you clearly can't > and sometimes it's hard to tell. i remember posting a short MATLAB > program that scrambles up the phases of a partial sum of a square > wave. it made the wave look like crap, but it still sounded like a > wimpy bandlimited square wave. without some non-linearity processing > afterward, it *was* hard to hear the phase changes.
I'm not sure I like your first example. You may not hear phase, but interference can be quite audible. Moreover, with echoes, the reflection coefficients of different surfaces can vary with frequency in different ways. I'm glad I don't need to think more about that. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
robert bristow-johnson wrote:

> On Sep 3, 6:30 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
(snip on frequency response and phase)
>>For other than audio systems, including phase makes a lot >>of sense.
> this is a true (but misleading, IMO) statement. the qualification is > not necessary. including phase for audio systems makes sense also.
Did you check out the phase response before your last purchase of audio equipment? It is nice to have a graph of the phase shift over the full frequency range, and there are some that supply a graph. For a speaker that is likely to be at a single point somewhere in front at a specified distance. As I most likely wouldn't listen at that distance, it doesn't help so much. While speakers are likely to have the most phase shift (distance to drivers, and the LC filters in the crossover), the tone controls of amplifiers likely have a phase shift, also. There is also the equalization for phono (does anyone still do that), tape, and the de-emphasis filter for FM radio. While doing end-to-end phase vs. frequency seems a good idea, I have never known anyone to do it for an audio system. -- glen
On Sep 4, 1:29 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> robert bristow-johnson wrote: > > On Sep 3, 6:30 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: > > (snip on frequency response and phase) > > >>For other than audio systems, including phase makes a lot > >>of sense. > > this is a true (but misleading, IMO) statement. the qualification is > > not necessary. including phase for audio systems makes sense also. > > Did you check out the phase response before your last purchase > of audio equipment? It is nice to have a graph of the phase > shift over the full frequency range, and there are some that > supply a graph. For a speaker that is likely to be at a single > point somewhere in front at a specified distance. As I most likely > wouldn't listen at that distance, it doesn't help so much. > > While speakers are likely to have the most phase shift (distance > to drivers, and the LC filters in the crossover), the tone controls > of amplifiers likely have a phase shift, also. There is also the > equalization for phono (does anyone still do that), tape, and the > de-emphasis filter for FM radio. > > While doing end-to-end phase vs. frequency seems a good idea, I > have never known anyone to do it for an audio system.
Not directly, but I do remember long ago reading about people measuring or attempting to hear transient response in "high-end" audio equipment, transient response being one stand-in for non-linear phase response. It's seems possible that a system which is insensitive to reasonable amounts of absolute phase might still be sensitive to small variations in time domain transient duration, which could result by sufficient phase distortion of interesting short transient sounds. (But I've probably spent too much time around small aircraft engines to hear any differences produced by gold plated speaker magnet wires inside high vacuum speaker enclosures myself. :) IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
On 4 Sep., 22:29, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> robert bristow-johnson wrote: > > On Sep 3, 6:30 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: > > (snip on frequency response and phase) > > >>For other than audio systems, including phase makes a lot > >>of sense. > > this is a true (but misleading, IMO) statement. the qualification is > > not necessary. including phase for audio systems makes sense also. > > Did you check out the phase response before your last purchase > of audio equipment? It is nice to have a graph of the phase > shift over the full frequency range, and there are some that > supply a graph. For a speaker that is likely to be at a single > point somewhere in front at a specified distance. As I most likely > wouldn't listen at that distance, it doesn't help so much. > > While speakers are likely to have the most phase shift (distance > to drivers, and the LC filters in the crossover), the tone controls > of amplifiers likely have a phase shift, also. There is also the > equalization for phono (does anyone still do that), tape, and the > de-emphasis filter for FM radio. > > While doing end-to-end phase vs. frequency seems a good idea, I > have never known anyone to do it for an audio system.
Here is an example: http://www.celticaudio.com/ Go to "technical articles", and download "Putting the Science Back into Loudspeakers". John Watkinson's philosphy for audio reproduction is centered around a trying to achieve a linear-phase response reproduction system. He stresses this much more than magnitude response issues. Regards, Andor
Andor <andor.bariska@gmail.com> writes:

> On 4 Sep., 22:29, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: >> robert bristow-johnson wrote: >> > On Sep 3, 6:30 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: >> >> (snip on frequency response and phase) >> >> >>For other than audio systems, including phase makes a lot >> >>of sense. >> > this is a true (but misleading, IMO) statement. the qualification is >> > not necessary. including phase for audio systems makes sense also. >> >> Did you check out the phase response before your last purchase >> of audio equipment? It is nice to have a graph of the phase >> shift over the full frequency range, and there are some that >> supply a graph. For a speaker that is likely to be at a single >> point somewhere in front at a specified distance. As I most likely >> wouldn't listen at that distance, it doesn't help so much. >> >> While speakers are likely to have the most phase shift (distance >> to drivers, and the LC filters in the crossover), the tone controls >> of amplifiers likely have a phase shift, also. There is also the >> equalization for phono (does anyone still do that), tape, and the >> de-emphasis filter for FM radio. >> >> While doing end-to-end phase vs. frequency seems a good idea, I >> have never known anyone to do it for an audio system. > > Here is an example: > > http://www.celticaudio.com/ > > Go to "technical articles", and download "Putting the Science Back > into Loudspeakers". John Watkinson's philosphy for audio reproduction > is centered around a trying to achieve a linear-phase response > reproduction system. He stresses this much more than magnitude > response issues.
What's REALLY interesting is his application of information theory to loudspeaker design. I just scanned the article quickly, but it looks worthy of a good read. -- % Randy Yates % "Remember the good old 1980's, when %% Fuquay-Varina, NC % things were so uncomplicated?" %%% 919-577-9882 % 'Ticket To The Moon' %%%% <yates@ieee.org> % *Time*, Electric Light Orchestra http://home.earthlink.net/~yatescr
On Sep 4, 3:05 pm, Jerry Avins <j...@ieee.org> wrote:
> robert bristow-johnson wrote: > > > well, it's not the same thing. a pure delay is just that. you hear > > the original signal *once* at some delay and no echoes after that. if > > you have no reference to compare the possibly delayed signal to, how > > would you know it sounds different than it would have sounded if it > > had arrived at your ears 500 ms earlier. if echoes start happening to > > a sound, it is not a pure delay (and might not even be an APF, so > > there would be magnitude variations in the frequency response), and > > you are hearing that. >
...
> > I'm not sure I like your first example. You may not hear phase, but > interference can be quite audible.
and once you get multipath interference, it's no longer a pure delay. what i am trying to get down to, with this "audibility of phase" issue is something that we can nail down. i brought this up (among other issues) in 2003 March with a letter to the AES Journal taking on an author named Andrew Horner. he and i have both done stuff regarding Wavetable Synthesis, but Andrew totally discarded phase information of each harmonic, so the wave shape was not preserved at all (and i had a problem with it, particularly since he didn't even hand-wave a justification for this loss of information). but there are *some* phase inaudibility situations that i grant. how to set up an experiment to find out? i am envisioning listening to two, possibly different and possibly identical, sounds, one after the other. this is what i would call "AB Testing" as opposed to "ABX Testing" where in the latter you hear two sounds (A&B) that are nominally different, and then a third sound (X) that you assign to A or B. in AB Testing, you hear two sounds and you have to say if they are the same or if they are not. there will be an equal number of placebos put in (two sounds that are identical) and every false positive (where the listener judges two identical sounds to be different) will be subtracted from the number of true positive (where the listener judges two different sounds to be different). same for the false negatives (where the listener judges two different sounds to be identical) and true negatives (where the listener judges two identical sounds to be identical). that's how we subtract the bias from the "Monster Cable partisans" who might be tempted to judge any pair as different, just to make sure they hit the ones that actually *are* different. but, according to the basis, the two sounds are *not* heard simultaneously. it's one after another. if you have two identical sounds, but one had a 5 second delay that the other did not, i guess the listener might be confused a little as to whether or not he should judge them as different sounds. that confusion from a *gross* delay, i want to remove from the issue of discussion. so now, you have two identical sounds, but one is front-padded with 10000 samples of zeros. a delay of a 1/4 second. when the listener hears one and then the other, we cannot expect that listener to know, without a reference blip of some sort telling him where the beginning of the sound is, if there was such a delay. you can think of this as running the same exact sound, serially in time, once through a wire and the second time through a 1/4 second ideal delay. can you expect the listener to know the difference (with no reference)? so that is an obvious example where a phase change is not audible (that's why linear-phase filters are sometimes salient). so now replace the 1/4 second delay line with an All-Pass Filter (APF) as such: H(z) = (z^(-N) - p)/(1 - p*z^(-N)) where -1 < p < +1 and N is the number of samples delay in the internal delay element. clearly |H(e^(jw)| = 1 for any real w. if it's a true "positive", the listener hears the sound once passed through a wire and another time passed through the APF. it should be an equal number of positive trials with the APF before or after the wire. and an equal number of negative trials with the APF in both sounds and with the APF absent in both sounds. certainly if p=0, you are left with a pure delay that we are not counting as an audible difference since the listener has no reference to hear it against (no direct path, no echoes). the listener cannot be expected to know if some particular sound got delayed 25 ms or not. but a non-trivial psycho-acoustic perceptual question arizes when p <> 0 and N > 0. what values of delay N, and feedback coefficient, p, cause the listener to know that the APF was placed in the signal path as opposed to not? i can safely say that if p = 0.95 and N = 20000 (assuming approx 44 kHz sampling rate), that any listener who is not deaf will hear the difference for sounds that have a beginning and an end. but it's an APF, no frequency components are changed in amplitude. now whether or not a listener can hear the difference when the common source is a solid periodic tone, that's a different story. certainly if the tone is a single sinusoid, the listener cannot know the difference, for the same reason as the pure delay, we are phase insensitive to that. but if the tone has harmonics and some harmonics are delayed differently than other harmonics, it is a useful and non- trivial question to ask "under what circustances can we hear a difference?" this is the only well-defined context i can think of where this "audibility of phase" question really is meaningful. r b-j
On Sep 4, 4:29 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> robert bristow-johnson wrote: > > On Sep 3, 6:30 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: > > (snip on frequency response and phase) > > >>For other than audio systems, including phase makes a lot > >>of sense. > > this is a true (but misleading, IMO) statement. the qualification is > > not necessary. including phase for audio systems makes sense also. > > Did you check out the phase response before your last purchase > of audio equipment?
other than a Discman (portable CD player), i haven't purchased audio equipment in better than 3 decades. (my turntable still works.)
> It is nice to have a graph of the phase > shift over the full frequency range, and there are some that > supply a graph. For a speaker that is likely to be at a single > point somewhere in front at a specified distance.
sure, and maybe we'll wanna subtract the linear-phase component associated with that known distance, since it does not reflect any performance issue of the speaker.
> As I most likely > wouldn't listen at that distance, it doesn't help so much.
the linear-phase component associated with that distance should not be a consideration at all. let's lose it.
> While speakers are likely to have the most phase shift (distance > to drivers, and the LC filters in the crossover), the tone controls > of amplifiers likely have a phase shift, also.
sure.
> There is also the > equalization for phono (does anyone still do that),
anyone who listens to vinyl must do that, i would think.
> tape, and the de-emphasis filter for FM radio.
and the effects of those should be tested modularly. the question is how does the RIAA phono equalization (or errors in it, since it is s'posed to undo filtering that happens in the recording/pressing process), tape de-emphasis, whatever, how does that single stage operation affect phase and how much is such an effect audible?
> While doing end-to-end phase vs. frequency seems a good idea, I > have never known anyone to do it for an audio system.
end-to-end is only useful if, somehow, you can hear the raw sound without the system. you hear it without and then hear it with the system and ask, "can i hear the difference". otherwize, i don't see the point. r b-j
robert bristow-johnson wrote:
> On Sep 4, 3:05 pm, Jerry Avins <j...@ieee.org> wrote: >> robert bristow-johnson wrote: >> >>> well, it's not the same thing. a pure delay is just that. you hear >>> the original signal *once* at some delay and no echoes after that. if >>> you have no reference to compare the possibly delayed signal to, how >>> would you know it sounds different than it would have sounded if it >>> had arrived at your ears 500 ms earlier. if echoes start happening to >>> a sound, it is not a pure delay (and might not even be an APF, so >>> there would be magnitude variations in the frequency response), and >>> you are hearing that. > ... >> I'm not sure I like your first example. You may not hear phase, but >> interference can be quite audible. > > and once you get multipath interference, it's no longer a pure delay. > > what i am trying to get down to, with this "audibility of phase" issue > is something that we can nail down. i brought this up (among other > issues) in 2003 March with a letter to the AES Journal taking on an > author named Andrew Horner. he and i have both done stuff regarding > Wavetable Synthesis, but Andrew totally discarded phase information of > each harmonic, so the wave shape was not preserved at all (and i had a > problem with it, particularly since he didn't even hand-wave a > justification for this loss of information). but there are *some* > phase inaudibility situations that i grant. how to set up an > experiment to find out? > > i am envisioning listening to two, possibly different and possibly > identical, sounds, one after the other. this is what i would call "AB > Testing" as opposed to "ABX Testing" where in the latter you hear two > sounds (A&B) that are nominally different, and then a third sound (X) > that you assign to A or B. in AB Testing, you hear two sounds and you > have to say if they are the same or if they are not. there will be an > equal number of placebos put in (two sounds that are identical) and > every false positive (where the listener judges two identical sounds > to be different) will be subtracted from the number of true positive > (where the listener judges two different sounds to be different). > same for the false negatives (where the listener judges two different > sounds to be identical) and true negatives (where the listener judges > two identical sounds to be identical). that's how we subtract the > bias from the "Monster Cable partisans" who might be tempted to judge > any pair as different, just to make sure they hit the ones that > actually *are* different. > > but, according to the basis, the two sounds are *not* heard > simultaneously. it's one after another. if you have two identical > sounds, but one had a 5 second delay that the other did not, i guess > the listener might be confused a little as to whether or not he should > judge them as different sounds. that confusion from a *gross* delay, > i want to remove from the issue of discussion. so now, you have two > identical sounds, but one is front-padded with 10000 samples of > zeros. a delay of a 1/4 second. when the listener hears one and then > the other, we cannot expect that listener to know, without a reference > blip of some sort telling him where the beginning of the sound is, if > there was such a delay. you can think of this as running the same > exact sound, serially in time, once through a wire and the second time > through a 1/4 second ideal delay. can you expect the listener to know > the difference (with no reference)? so that is an obvious example > where a phase change is not audible (that's why linear-phase filters > are sometimes salient). > > so now replace the 1/4 second delay line with an All-Pass Filter (APF) > as such: > > H(z) = (z^(-N) - p)/(1 - p*z^(-N)) > > where -1 < p < +1 and N is the number of samples delay in the > internal delay element. clearly |H(e^(jw)| = 1 for any real w. if > it's a true "positive", the listener hears the sound once passed > through a wire and another time passed through the APF. it should be > an equal number of positive trials with the APF before or after the > wire. and an equal number of negative trials with the APF in both > sounds and with the APF absent in both sounds.
I think that phase due to pure delay is irrelevant. Consider my playing the CD you made for me tonight and again tomorrow night using the same equipment. 'Nuff said?
> certainly if p=0, you are left with a pure delay that we are not > counting as an audible difference since the listener has no reference > to hear it against (no direct path, no echoes). the listener cannot > be expected to know if some particular sound got delayed 25 ms or > not. but a non-trivial psycho-acoustic perceptual question arizes > when p <> 0 and N > 0. what values of delay N, and feedback > coefficient, p, cause the listener to know that the APF was placed in > the signal path as opposed to not? i can safely say that if p = 0.95 > and N = 20000 (assuming approx 44 kHz sampling rate), that any > listener who is not deaf will hear the difference for sounds that have > a beginning and an end. but it's an APF, no frequency components are > changed in amplitude. > > now whether or not a listener can hear the difference when the common > source is a solid periodic tone, that's a different story. certainly > if the tone is a single sinusoid, the listener cannot know the > difference, for the same reason as the pure delay, we are phase > insensitive to that. but if the tone has harmonics and some harmonics > are delayed differently than other harmonics, it is a useful and non- > trivial question to ask "under what circustances can we hear a > difference?"
Yes. I, guru that I am can tell you. :-) Try this with a percussive sound, wood block showing the effect better than most drum skins. But the effect is subtle, and I for one don't ordinarily care.
> this is the only well-defined context i can think of where this > "audibility of phase" question really is meaningful.
Agreed. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;