Sign in

username or email:

password:



Not a member?
Forgot your password?

Search compdsp



Search tips

Ads

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGA

Discussion Groups | Comp.DSP | Asymmetric FIR filter from simmetric one?

There are 7 messages in this thread.

You are currently looking at messages 1 to .


Is this discussion worth a thumbs up?

0

Asymmetric FIR filter from simmetric one? - 2012-08-29 13:24:00

Hello,

I need a lowpass FIR filter with a thin passband and about 50-60dB
attenuation in the stop band. The filter must introduce as little
delay as possible (6-10 samples max would be best). After a lot of
work, I came with some coefficients that provided the frequency
response I was looking for, but the delay is excessive. Rather than
using the Parks-McClellan method (I did try it, too) in the end I
obtained the best results by using a Kaiser window directly (i.e.
applying it to a 0Hz filter). The filter is 53 coefficients long.

I does what I want frequency wise, and I can differentiate the
output cleanly, but it introduces way too much delay unfortunately.

If I used half of the filter coefficients, would I have to go again
through comparison of tens and tens of windows and filter design
methods like I did, or can I assume that the Kaiser that proven to
be best for my application will still be?

I know that by making the FIR asymmetric I will lose linear phase,
in the end it may still be a better choice than a longer, overally
more delayed, filter.

What I would like to ask You is expecially how do I design a filter
that begins with "1.0" (first coefficient) and then follows with
smaller coefficients, i.e. like a half window?

Sorry I'm self taught.. I hope I managed to explain it well enough.

I would prefer not to use IIR filters, if anything because it's a
microcontroller application and floating point (which seems quite
necessary in the IIR case) is neither fast nor easy to implement.

With best regards,
Mike

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Asymmetric FIR filter from simmetric one? - Tim Wescott - 2012-08-29 16:55:00



On Wed, 29 Aug 2012 17:24:33 +0000, mike wrote:

> Hello,
> 
> I need a lowpass FIR filter with a thin passband and about 50-60dB
> attenuation in the stop band. The filter must introduce as little delay
> as possible (6-10 samples max would be best). After a lot of work, I
> came with some coefficients that provided the frequency response I was
> looking for, but the delay is excessive. Rather than using the
> Parks-McClellan method (I did try it, too) in the end I obtained the
> best results by using a Kaiser window directly (i.e. applying it to a
> 0Hz filter). The filter is 53 coefficients long.
> 
> I does what I want frequency wise, and I can differentiate the output
> cleanly, but it introduces way too much delay unfortunately.
> 
> If I used half of the filter coefficients, would I have to go again
> through comparison of tens and tens of windows and filter design methods
> like I did, or can I assume that the Kaiser that proven to be best for
> my application will still be?
> 
> I know that by making the FIR asymmetric I will lose linear phase, in
> the end it may still be a better choice than a longer, overally more
> delayed, filter.
> 
> What I would like to ask You is expecially how do I design a filter that
> begins with "1.0" (first coefficient) and then follows with smaller
> coefficients, i.e. like a half window?
> 
> Sorry I'm self taught.. I hope I managed to explain it well enough.
> 
> I would prefer not to use IIR filters, if anything because it's a
> microcontroller application and floating point (which seems quite
> necessary in the IIR case) is neither fast nor easy to implement.

Floating point is not at all necessary for the IIR case.  Where in heck 
did you get that idea?  If your input range is already known then, bit 
for bit, floating point is worse than fixed.

I'd certainly investigate doing this with an IIR filter.  The big 
drawback of IIR filters is that they're not symmetric, and you've already 
thrown out that bathwater.  Going to a FIR filter is, in my opinion, 
throwing out the baby as well.  You'll need to use high precision, but 
that's not a floating-point thing -- that's a high precision thing.

I'm almost certain that if you take your FIR filter, whack it in two at 
the center point, then convolve that part with itself, that you'll have 
exactly the same frequency amplitude response with minimum phase shift.  
This is based on hundreds of milliseconds -- perhaps even entire seconds 
-- of deep mathematical thought, so you know it must be true.

You don't say how "thin" your passband is compared to your sampling rate, 
but at a rough estimate, if you want your output signal to be largely 
"there" after N samples, then your bandwidth can't be much less than 1/N 
times the sampling rate, even if you are using a minimum phase filter.

-- 
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Asymmetric FIR filter from simmetric one? - Fred Marshall - 2012-08-30 01:14:00

One way to approach it would be to use the P-M method but with double 
the stop band attenuation.  i.e. if you need 60dB then design one with 
120dB.
Then add enough of a constant to the center coefficient so the stopband 
ripple is always positive with double zeros.
Then take the resulting polynomial and compute the zeros.
The zeros will be symmetric about the unit circle.
Then remove all the zeros outside the unit circle and make all the 
double zeros in the stopband into single zeros.
Then compute the resulting polynomial which will have the "same" 
frequency response (actually the sqrt thereof).
And this one will be minimum phase.
Ala Schuessler....

Fred
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Asymmetric FIR filter from simmetric one? - Fred Marshall - 2012-08-30 14:39:00

Just as a matter of interest:

I did this within the P-M sort of algorithm successfully.
The stopband objective criterion was set to the current ripple peak.
At the end, the stopband varied from zero to +2*[ripple peak]

Fred
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Asymmetric FIR filter from simmetric one? - mnentwig - 2012-08-30 17:32:00

>> with a thin passband
the first thing that comes to mind is: decimate early.

That said, try the following script for an asymmetric FIR design (edit as
needed):
http://www.dsprelated.com/blogimages/MarkusNentwig/comp.dsp/asymFIR_120830.m

It attempts to design a linear-phase least-squares filter with an
asymmetric impulse response. This sounds contradictory, but I've got a
funny little theory, how it could still work. Which I'll keep to myself for
now :-)
 
If in doubt, compare the result against your existing design method,
whether it's competitive. If so, iterate the group delay target over the
allowed range and pick the one that gives the best result. 

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Asymmetric FIR filter from simmetric one? - Piergiorgio Sartor - 2012-08-30 18:36:00

On 08/29/2012 07:24 PM, m...@unknown.no.spam.com wrote:
[...]

As already Tim Wescott mentioned, my guess would be that you
cannot have arbitrary attenuation, bandwidth and delay.
You can choose only two of those, the other is then, somehow,
defined, at least boundary defined.

bye,

-- 

piergiorgio
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Asymmetric FIR filter from simmetric one? - Fred Marshall - 2012-08-30 20:13:00

On 8/30/2012 3:36 PM, Piergiorgio Sartor wrote:
> On 08/29/2012 07:24 PM, m...@unknown.no.spam.com wrote:
> [...]
>
> As already Tim Wescott mentioned, my guess would be that you
> cannot have arbitrary attenuation, bandwidth and delay.
> You can choose only two of those, the other is then, somehow,
> defined, at least boundary defined.
>
> bye,
>

Interesting point.
If you design the filter whose square root would be taken then the 
length is double and the delay is half that.
Then, when you take the square root and select the minimum phase 
version, the length is half and, with minimum phase, I presume the delay 
is less than length/2 more or less (as it's not flat delay any more).

So, to the degree that you are selecting the zeros for the same 
amplitude response (attenuation and bandwidth) then you are tweaking the 
delay.  You can go from minimum phase, to maximum phase and some number 
of designs in between.

Fred
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.