There are 7 messages in this thread.
You are currently looking at messages 0 to 7.
Hi, The fdatool in matlab usually designs a real equiripple filter with a group delay (N-1)/2 or N/2, where N is filter length. Given desired magnitude response, to design a linear phase filter with a prescribed group delay, will the optimum filter be real coefficient and symmetric? Thanks. ZedToe
"ZedToe" <a...@yahoo.com.sg> wrote in message news:7...@posting.google.com... > Hi, > > The fdatool in matlab usually designs a real equiripple filter with a > group delay (N-1)/2 or N/2, where N is filter length. > > Given desired magnitude response, to design a linear phase filter with > a prescribed group delay, will the optimum filter be real coefficient > and symmetric? ZedToe, The group delay is a unique result of the filter being real and symmetric. Then it's a constant. If you want to prescribe a longer group delay, you can simply add a delay. If you want to prescribe a shorter group delay, you could consider adding an "advance" but that's unobtainium unless you're doing batch processing and delay isn't really the issue - in that case you can advance the data all you want because you aren't dealing with real time. It would be cheating to create a "simulation" using batch processing and expect that to represent real time processing - in this context. But, what if you want a shorter group delay in real time? Then you're going to have to depart from linear phase / constant group delay and go to work on phase response in a region of frequency at a minimum. You might start with a minimum phase filter to determine what actually is achievable regarding delay (maybe what you want isn't physically realizable) and then go from there by adding an all-pass phase adjusting filter stage..... something like that. Consider that the longer the filter then the longer the delay. Fred
In article 7...@posting.google.com, ZedToe at a...@yahoo.com.sg wrote on 01/07/2004 11:50: > Hi, > > The fdatool in matlab usually designs a real equiripple filter with a > group delay (N-1)/2 or N/2, where N is filter length. dunno about the fdatool, but for the regular remez() (which should really be called the Parks-McClellan algorithm), it is always (N-1)/2 so when N is odd, the delay is an integer and when N is even, the delay is halfway between two neighboring samples. > Given desired magnitude response, to design a linear phase filter with > a prescribed group delay, will the optimum filter be real coefficient > and symmetric? the filter is always real coefficient (a non-real coef filter will have differences between negative frequencies and positive frequencies which is not possible for a "real" system). if the delay is constant (which is what remez() does normally) the filter will be symmetric. Eric Jacobson posted a "trick" on comp.dsp on how you can use MATLAB's remez() to design a non-symmetric FIR that has prescribed magnitude *and* phase using two passes at remez(). one pass is for the even symmetry component and the other is for the odd. r b-j
"robert bristow-johnson" <r...@surfglobal.net> wrote in message news:BC21C824.77C2%r...@surfglobal.net... > In article 7...@posting.google.com, ZedToe at > a...@yahoo.com.sg wrote on 01/07/2004 11:50: > > > Hi, > > > > The fdatool in matlab usually designs a real equiripple filter with a > > group delay (N-1)/2 or N/2, where N is filter length. > > dunno about the fdatool, but for the regular remez() (which should really be > called the Parks-McClellan algorithm), it is always (N-1)/2 so when N is > odd, the delay is an integer and when N is even, the delay is halfway > between two neighboring samples. > > > Given desired magnitude response, to design a linear phase filter with > > a prescribed group delay, will the optimum filter be real coefficient > > and symmetric? > > the filter is always real coefficient (a non-real coef filter will have > differences between negative frequencies and positive frequencies which is > not possible for a "real" system). if the delay is constant (which is what > remez() does normally) the filter will be symmetric. > > Eric Jacobson posted a "trick" on comp.dsp on how you can use MATLAB's > remez() to design a non-symmetric FIR that has prescribed magnitude *and* > phase using two passes at remez(). one pass is for the even symmetry > component and the other is for the odd. r b-j, Well, Eric's scheme starts with a *given* magnitude and phase function for a realizable filter as I understand it. It also generates a minimax approximation to the original function - which mixes approximation methods if the original wasn't minimax/Chebyshev. Anyway, this is different from starting with an *arbitrary* phase specification that one might desire. I guess one might still try to use that method in this way: 1) Get the magnitude response from the real part as Eric suggests. 2) Express the phase response as linear in the region where flat group delay is desired with a high weight and some arbitrary phase response everywhere else with a low weight (i.e. "don't care"). It would take some experimentation I'm sure. Alternately, one might start with a design method that results in a realizable (analog) filter that meets the specifications and use Eric's method thereafter. Alternately, one might use METEOR which seems to allow combined magnitude and phase constraints if I recall. I wonder what happens if one were to do this: Do just step (1) as above with the magnitude response - or simply use PM to get a linear phase filter with desired magnitude response. This will yield a linear phase filter with quads of conjugate zeros. Then, outside the frequency range where linear phase is desired, move all the other zeros to inside the unit circle - keeping the quads only in the range where linear phase / flat delay is necessary. Might this be a filter that is "minimum phase everywhere else" and close to linear phase in the band of interest under the assumption that the nearest zeros dominate the phase response? er.....maybe. Fred
In article 1...@centurytel.net, Fred Marshall at fmarshallx@remove_the_x.acm.org wrote on 01/10/2004 17:48: > > "robert bristow-johnson" <r...@surfglobal.net> wrote in message > news:BC21C824.77C2%r...@surfglobal.net... ... >> Eric Jacobson posted a "trick" on comp.dsp on how you can use MATLAB's >> remez() to design a non-symmetric FIR that has prescribed magnitude *and* >> phase using two passes at remez(). one pass is for the even symmetry >> component and the other is for the odd. > > Well, Eric's scheme starts with a *given* magnitude and phase function for a > realizable filter as I understand it. It also generates a minimax > approximation to the original function - which mixes approximation methods > if the original wasn't minimax/Chebyshev. Anyway, this is different from > starting with an *arbitrary* phase specification that one might desire. that difference is subtle, but i think i understand you. when you say "arbitrary", i would call that "unspecified" (i.e. "weighting = 0"). when i say "arbitrary", i mean the devil gives it to you and you gotta play along. > I guess one might still try to use that method in this way: > > 1) Get the magnitude response from the real part as Eric suggests. > 2) Express the phase response as linear in the region where flat group delay > is desired with a high weight and some arbitrary phase response everywhere > else with a low weight (i.e. "don't care"). > It would take some experimentation I'm sure. i dunno, i understand Eric's trick as *both* the real and imag parts come from *both* the magnitude and phase. you can apply one weighting function to the imag and another to the real, but i don't see an easy way to apply different weighting to the magnitude and phase. > Alternately, one might start with a design method that results in a > realizable (analog) filter that meets the specifications and use Eric's > method thereafter. > > Alternately, one might use METEOR which seems to allow combined magnitude > and phase constraints if I recall. i've heard of METEOR. never used it. > I wonder what happens if one were to do this: > > Do just step (1) as above with the magnitude response - or simply use PM to > get a linear phase filter with desired magnitude response. This will yield > a linear phase filter with quads of conjugate zeros. Then, outside the > frequency range where linear phase is desired, move all the other zeros to > inside the unit circle - keeping the quads only in the range where linear > phase / flat delay is necessary. Might this be a filter that is "minimum > phase everywhere else" and close to linear phase in the band of interest > under the assumption that the nearest zeros dominate the phase response? > er.....maybe. i gotta read and think about this more to respond with any intelligence. sorry, i'm too dumb at the moment. r b-j
Fred Marshall wrote:
>
> Do just step (1) as above with the magnitude response - or simply use PM to
> get a linear phase filter with desired magnitude response. This will yield
> a linear phase filter with quads of conjugate zeros. Then, outside the
> frequency range where linear phase is desired, move all the other zeros to
> inside the unit circle - keeping the quads only in the range where linear
> phase / flat delay is necessary. Might this be a filter that is "minimum
> phase everywhere else" and close to linear phase in the band of interest
> under the assumption that the nearest zeros dominate the phase response?
> er.....maybe.
>
Interesting idea. How do you factor the linear phase FIR to
find all the zeros?
Bob
--
"Things should be described as simply as possible, but no
simpler."
A. Einstein
"robert bristow-johnson" <r...@surfglobal.net> wrote in message news:BC26597E.7999%r...@surfglobal.net... > In article 1...@centurytel.net, Fred Marshall at > fmarshallx@remove_the_x.acm.org wrote on 01/10/2004 17:48: > > > > > "robert bristow-johnson" <r...@surfglobal.net> wrote in message > > news:BC21C824.77C2%r...@surfglobal.net... > ... > >> Eric Jacobson posted a "trick" on comp.dsp on how you can use MATLAB's > >> remez() to design a non-symmetric FIR that has prescribed magnitude *and* > >> phase using two passes at remez(). one pass is for the even symmetry > >> component and the other is for the odd. > > > > Well, Eric's scheme starts with a *given* magnitude and phase function for a > > realizable filter as I understand it. It also generates a minimax > > approximation to the original function - which mixes approximation methods > > if the original wasn't minimax/Chebyshev. Anyway, this is different from > > starting with an *arbitrary* phase specification that one might desire. > > that difference is subtle, but i think i understand you. when you say > "arbitrary", i would call that "unspecified" (i.e. "weighting = 0"). when i > say "arbitrary", i mean the devil gives it to you and you gotta play along. I think we're speaking the same language here. By "arbitrary" I meant a phase specification that the devil gives to you with no notion of physical realizability. Eric started with something that was already derived as a real thing - an analog Butterworth design as I understand it. The original post wanted to *arrive* at a phase response. Depending on what phase response is specified, that could end up being an impossible objective - like negative delay as a gross example. > > > I guess one might still try to use that method in this way: > > > > 1) Get the magnitude response from the real part as Eric suggests. > > 2) Express the phase response as linear in the region where flat group delay > > is desired with a high weight and some arbitrary phase response everywhere > > else with a low weight (i.e. "don't care"). > > It would take some experimentation I'm sure. > > i dunno, i understand Eric's trick as *both* the real and imag parts come > from *both* the magnitude and phase. you can apply one weighting function > to the imag and another to the real, but i don't see an easy way to apply > different weighting to the magnitude and phase. You're right. I slipped up on this one. Fred