DSPRelated.com
Forums

questions raised by reading and thinking with possibly missing background

Started by Richard Owlett December 10, 2005
Randy Yates wrote:
> Richard Owlett <rowlett@atlascomm.net> writes: > > > Richard Owlett wrote: > > > >> ... > >> That got me thinking ;< > > > > What are the *NECESSARY* conditions for a FIR filter of an arbitrary > > shape in the frequency domain to be "linear phase". > > > > One of the references I was reading stated that "a FIR filter would be > > 'linear phase' if its coefficients were symmetric about the middle > > coefficient." > > > > Is that a "sufficient" condition or a "necessary" condition? > > What implication does it have for the passband response?
...
> It is a sufficient condition. A trivial example of an FIR filter > that does not meet this condition but is still linear phase is > the FIR given by h[0] = 0, h[1] = 0, and h[2] = 1.
That, to me, is just an obfuscation which can be remedied by a more thorough definition of "middle coefficient", and the addition/removal of up to an infinite number of zero terms. IMHO. YMMV. -- rhn A.T nicholson d.O.t C-o-M
Randy Yates wrote:
> Randy Yates <yates@ieee.org> writes: > > [...] > > I've heard that a linear-phase filter has magnitude and phase > > responses that are Hilbert transforms of each other, but I've > > never been interested enough to investigate. > > Sorry - correction!: Those are *minimum-phase* filters.
Minimum-phase FIR filters are interesting if speed of response is more important than the phase linearity. For low pass filters, minimum-phase filters would seem to me to be far more "natural" than linear-phase filters, given that linear-phase low pass filters have a "pre-ringing" response that sounds extremely unnatural compared to any natural or analog filtering process. And minimum-phase filters have the fastest mean response or delay for a given pile of poles and zeros. But the advantage of linear-phase filters for the OP is that, given matched delays, they can be summed without worrying about any phase cancellations of some frequency bands. IMHO. YMMV. -- rhn A.T nicholson d.O.t C-o-M
"Ron N." <rhnlogic@yahoo.com> writes:

> Randy Yates wrote: >> Randy Yates <yates@ieee.org> writes: >> > [...] >> > I've heard that a linear-phase filter has magnitude and phase >> > responses that are Hilbert transforms of each other, but I've >> > never been interested enough to investigate. >> >> Sorry - correction!: Those are *minimum-phase* filters. > > Minimum-phase FIR filters are interesting if speed of response > is more important than the phase linearity. For low pass filters, > minimum-phase filters would seem to me to be far more "natural" > than linear-phase filters, given that linear-phase low pass filters > have a "pre-ringing" response that sounds extremely unnatural > compared to any natural or analog filtering process. And > minimum-phase filters have the fastest mean response or > delay for a given pile of poles and zeros.
Hey Ron, how do you know so much about minimum-phase filters? This is still, at my ripe-old-age, one of the topics I have yet to broach in my career. Say, do you have an example of a linear-phase filter and corresponding minimum-phase filter in which the linear-phase version exhibits the "pre-ringing" phenomenom? I'd love to try this out for myself. -- % Randy Yates % "Midnight, on the water... %% Fuquay-Varina, NC % I saw... the ocean's daughter." %%% 919-577-9882 % 'Can't Get It Out Of My Head' %%%% <yates@ieee.org> % *El Dorado*, Electric Light Orchestra http://home.earthlink.net/~yatescr
Randy Yates wrote:
> "Ron N." <rhnlogic@yahoo.com> writes:
...
> > Minimum-phase FIR filters are interesting if speed of response > > is more important than the phase linearity. For low pass filters, > > minimum-phase filters would seem to me to be far more "natural" > > than linear-phase filters, given that linear-phase low pass filters > > have a "pre-ringing" response that sounds extremely unnatural > > compared to any natural or analog filtering process. And > > minimum-phase filters have the fastest mean response or > > delay for a given pile of poles and zeros. > > Hey Ron, how do you know so much about minimum-phase filters?
I don't. That I have anything at all to say about the topic falls into the category of "random walk" continuing ed.
> This is still, at my ripe-old-age, one of the topics I have yet to > broach in my career.
I was experimenting with cepstral methods for pitch recognition, and found in my reading that a cepstrum calculation could also be used to construct minimum phase FIR filters. There's a long comp.dsp thread on the subject that I started somewhere around mid-March of 2004.
> Say, do you have an example of a linear-phase filter and corresponding > minimum-phase filter in which the linear-phase version exhibits the > "pre-ringing" phenomenom? I'd love to try this out for myself.
I don't have the c code handy, but I started with this description found on the net:
>> wn = [ones(1,m); 2*ones((n+odd)/2-1,m) ; ones(1-rem(n,2),m); >> zeros((n+od d)/2-1,m)]; >> y = real(ifft(exp(fft(wn.*real(ifft(log(abs(fft(x)))))))));
rewrote it, and fed it some very low pass (relative to the sample rate) linear-phase FIR filters. Minimum-phase FIR filters converted from symmetric windowed Sincs can also be used for upsampling interpolation (and, if an analog or physical filter was used for the original Nyquist limiting process before sampling, a non-linear-phase reconstruction might perhaps be closer to the original signal than a symmetric windowed-Sinc reconstruction). IMHO. YMMV. -- rhn A.T nicholson d.O.t C-o-M
Richard Owlett wrote:
> Richard Owlett wrote: > > > ... > > That got me thinking ;< > > What are the *NECESSARY* conditions for a FIR filter of an arbitrary > shape in the frequency domain to be "linear phase". > > One of the references I was reading stated that "a FIR filter would be > 'linear phase' if its coefficients were symmetric about the middle > coefficient." > > Is that a "sufficient" condition or a "necessary" condition?
We discussed this last June: http://groups.google.com/group/comp.dsp/msg/9be6c8f2861d1d3a
> What implication does it have for the passband response?
None that I could think of, apart from the linear phase. Regards, Andor
Ron N. wrote:
...
> Minimum-phase FIR filters are interesting if speed of response > is more important than the phase linearity.
Also, if number of coefficients is important - a given magnitude response can usually be met with less coefficients if the phase-linearity condition is dropped.
> For low pass filters, > minimum-phase filters would seem to me to be far more "natural" > than linear-phase filters, given that linear-phase low pass filters > have a "pre-ringing" response that sounds extremely unnatural > compared to any natural or analog filtering process.
Perhaps that is the reason why digital audio sounds so extremely unnatural - it's them damn linear-phase reconstruction filters! Regards, Andor
abariska@student.ethz.ch writes:

> Richard Owlett wrote: >> Richard Owlett wrote: >> >> > ... >> > That got me thinking ;< >> >> What are the *NECESSARY* conditions for a FIR filter of an arbitrary >> shape in the frequency domain to be "linear phase". >> >> One of the references I was reading stated that "a FIR filter would be >> 'linear phase' if its coefficients were symmetric about the middle >> coefficient." >> >> Is that a "sufficient" condition or a "necessary" condition? > > We discussed this last June: > > http://groups.google.com/group/comp.dsp/msg/9be6c8f2861d1d3a
Consider the filter coefficients determined as function y = test(x) %function y = test(x) n = [-25 : 25]; Fs = 1; Ts = 1/Fs; t = n*Ts; plot(sinc(t+1/7)); These are neither symmetric nor antisymmetric in the sense you defined, and yet this is a linear phase filter, is it not? -- % Randy Yates % "Maybe one day I'll feel her cold embrace, %% Fuquay-Varina, NC % and kiss her interface, %%% 919-577-9882 % til then, I'll leave her alone." %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr
Randy Yates wrote:
> abariska@student.ethz.ch writes: > > > Richard Owlett wrote: > >> Richard Owlett wrote: > >> > >> > ... > >> > That got me thinking ;< > >> > >> What are the *NECESSARY* conditions for a FIR filter of an arbitrary > >> shape in the frequency domain to be "linear phase". > >> > >> One of the references I was reading stated that "a FIR filter would be > >> 'linear phase' if its coefficients were symmetric about the middle > >> coefficient." > >> > >> Is that a "sufficient" condition or a "necessary" condition? > > > > We discussed this last June: > > > > http://groups.google.com/group/comp.dsp/msg/9be6c8f2861d1d3a > > Consider the filter coefficients determined as > > function y = test(x) > %function y = test(x) > n = [-25 : 25]; > Fs = 1; > Ts = 1/Fs; > t = n*Ts; > plot(sinc(t+1/7)); > > These are neither symmetric nor antisymmetric in the sense you defined, > and yet this is a linear phase filter, is it not?
No, it's not. Regards, Andor
Randy Yates wrote:

> Consider the filter coefficients determined as > > function y = test(x) > %function y = test(x) > n = [-25 : 25]; > Fs = 1; > Ts = 1/Fs; > t = n*Ts; > plot(sinc(t+1/7)); > > These are neither symmetric nor antisymmetric in the sense you defined, > and yet this is a linear phase filter, is it not?
I'm with Andor:
>> X = grpdelay(sinc(t+1/7),1,20); >> X
X = 24.7190 24.8790 24.9947 24.7873 24.7215 24.9915 24.9908 24.5986 24.7294 25.6582 32.6615 25.6582 24.7294 24.5986 24.9908 24.9915 24.7215 24.7873 24.9947 24.8790 Compare that with:
>> X2 = grpdelay(sinc(t),1,20); >> X2
X2 = 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 25.0000 Ciao, Peter K.
Richard Owlett wrote:
> Jerry Avins wrote:
...
>> The the differences between the shapes of filters is subtle. If those >> filters without steps at the ends, I find it difficult to distinguish >> a Blackman from Nuttall, Blackman-Harris, von Hann, and others. What >> distinguishing feature of Blackman attracts you? > > > I have a pdf of unknown title ( got saved as Windows.pdf ) written by > Craig Stuart Sapp <craig@ccrma.stanford.edu> 25 Feb 1997. > > I has a collection of various windows and their transforms. The > particular Blackman window illustrated had a "nice" central lobe and all > the residual lobes were of "uniform" shape and at least 60 dB down.
Those plots are not the shapes of the windows. Rather, they are the shapes of the frequency responses obtained by applying the windows to a filter, not at all what you wrote. Better shapes than any of them (but not by much) are filters optimized by Parks-McClellan and such. Look up "windowed sinc".
> *DARN YOU MR. AVINS* > You just made me read rather than just look at pretty pictures ;{
:-)
> The plot of the particular Blackman-Harris window had max side lobes > another 20 dB down, but scale of drawing emphasized the side lobes near > the central one. > > Transform of illustrated Hann window -- too much slop > Transform of illustrated Hann-Poisson window has a "pleasing shape" with > less "rejection" off central peak. > > I've been "hit over head with 2x4" on another issue. > What a implications of all these being symmetric about some point. > Obviously if I'm going to have > "passband 1 of width a centered at freq b" > and > "passband 2 of width y centered at freq z" > what strange effects will asymmetry have?
Try it and see. Won't ScopeDSP do it for you? ... Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;