# Parks-McClellan FIR Filter

Started by March 23, 2009
```Hi,

I have a question regarding filter coefficients for a Parks-McClellan
filter.

I'm trying to write a simple software loop for the filter using its
difference equation, but I've noticed a difference between the number of
taps.

For, say, a ten tap FIR filter designed using a Hamming window, there will
be eleven filter coefficients C0, C1,...C10

which mulitply by the filter inputs x(n) to get an out y(n) like so:-

y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-10)*C10

For a tenth order filter designed using the Parks-McClellan method I get
ten coefficients C0 - C9. So what I'm assuming is that the way to go is the
following:-

y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-9)*C9

Is this correct?
```
```On Mon, 23 Mar 2009 12:17:50 -0500, "mike2108"
<michealhoran@hotmail.com> wrote:

>Hi,
>
>I have a question regarding filter coefficients for a Parks-McClellan
>filter.

Parks-McClellan is an algorithm for determining filter coefficients
given some input constraints.   I think you mean you have a FIR filter
designed using Parks-McClellan.

Just a nit.

>I'm trying to write a simple software loop for the filter using its
>difference equation, but I've noticed a difference between the number of
>taps.
>
>For, say, a ten tap FIR filter designed using a Hamming window, there will
>be eleven filter coefficients C0, C1,...C10
>
>which mulitply by the filter inputs x(n) to get an out y(n) like so:-
>
>y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-10)*C10
>
>For a tenth order filter designed using the Parks-McClellan method I get
>ten coefficients C0 - C9. So what I'm assuming is that the way to go is the
>following:-
>
>y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-9)*C9
>
>Is this correct?

Looks right to me.

Eric Jacobsen
Minister of Algorithms
Abineau Communications
http://www.ericjacobsen.org

Blog: http://www.dsprelated.com/blogs-1/hf/Eric_Jacobsen.php
```
```>On Mon, 23 Mar 2009 12:17:50 -0500, "mike2108"
><michealhoran@hotmail.com> wrote:
>
>>Hi,
>>
>>I have a question regarding filter coefficients for a Parks-McClellan
>>filter.
>
>Parks-McClellan is an algorithm for determining filter coefficients
>given some input constraints.   I think you mean you have a FIR filter
>designed using Parks-McClellan.
>
>Just a nit.
>
>>I'm trying to write a simple software loop for the filter using its
>>difference equation, but I've noticed a difference between the number
of
>>taps.
>>
>>For, say, a ten tap FIR filter designed using a Hamming window, there
will
>>be eleven filter coefficients C0, C1,...C10
>>
>>which mulitply by the filter inputs x(n) to get an out y(n) like so:-
>>
>>y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-10)*C10
>>
>>For a tenth order filter designed using the Parks-McClellan method I
get
>>ten coefficients C0 - C9. So what I'm assuming is that the way to go is
the
>>following:-
>>
>>y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-9)*C9
>>
>>Is this correct?
>
>Looks right to me.
>
>Eric Jacobsen
>Minister of Algorithms
>Abineau Communications
>http://www.ericjacobsen.org
>
>Blog: http://www.dsprelated.com/blogs-1/hf/Eric_Jacobsen.php
>

Thanks very much Eric.

Mike
```
```On Mar 23, 1:17&#4294967295;pm, "mike2108" <michealho...@hotmail.com> wrote:
> Hi,
>
> I have a question regarding filter coefficients for a Parks-McClellan
> filter.
>
> I'm trying to write a simple software loop for the filter using its
> difference equation, but I've noticed a difference between the number of
> taps.
>
> For, say, a ten tap FIR filter designed using a Hamming window, there will
> be eleven filter coefficients C0, C1,...C10

You appear to be using an 11 point window (nonzero points).

>
> which mulitply by the filter inputs x(n) to get an out y(n) like so:-
>
> y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-10)*C10
>
> For a tenth order filter designed using the Parks-McClellan method I get
> ten coefficients C0 - C9. So what I'm assuming is that the way to go is the
> following:-
>
> y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-9)*C9
>
> Is this correct?

```
```mike2108 wrote:
> Hi,
>
> I have a question regarding filter coefficients for a Parks-McClellan
> filter.

Note Eric's nit.

> I'm trying to write a simple software loop for the filter using its
> difference equation, but I've noticed a difference between the number of
> taps.
>
> For, say, a ten tap FIR filter designed using a Hamming window, there will
> be eleven filter coefficients C0, C1,...C10

That's an eleven-tap filter, nor ten.

> which mulitply by the filter inputs x(n) to get an out y(n) like so:-
>
> y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-10)*C10
>
> For a tenth order filter designed using the Parks-McClellan method I get
> ten coefficients C0 - C9. So what I'm assuming is that the way to go is the
> following:-
>
> y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-9)*C9

Because the software does it right.

> Is this correct?

Ten taps is correct.

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;
```
```Well, you have to be careful talking about the "number of taps" and the
"order".

A first order filter has two taps, etc.

Fred

```
```>mike2108 wrote:
>> Hi,
>>
>> I have a question regarding filter coefficients for a Parks-McClellan
>> filter.
>
>Note Eric's nit.
>

Noted

>> I'm trying to write a simple software loop for the filter using its
>> difference equation, but I've noticed a difference between the number
of
>> taps.
>>
>> For, say, a ten tap FIR filter designed using a Hamming window, there
will
>> be eleven filter coefficients C0, C1,...C10
>
>That's an eleven-tap filter, nor ten.
>
>> which mulitply by the filter inputs x(n) to get an out y(n) like so:-
>>
>> y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-10)*C10
>>
>> For a tenth order filter designed using the Parks-McClellan method I
get
>> ten coefficients C0 - C9. So what I'm assuming is that the way to go is
the
>> following:-
>>
>> y(n) = x(n)*C0 + x(n-1)*C1+.....x(n-9)*C9
>
>Because the software does it right.
>
>> Is this correct?
>
>Ten taps is correct.
>
>Jerry
>--
>Engineering is the art of making what you want from things you can get.
>&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
>

>Well, you have to be careful talking about the "number of taps" and the
>"order".

>A first order filter has two taps, etc.

>Fred

Thanks very much for the replies,

I'll be more careful in future.
```