Maker Pro
Maker Pro

How is the IIR filter coefficient comes from?

B

boki

Dear All,

We calculate the IIR filter coefficient by


h(kt)=(2fc/fs)(sin{r(k)}/r(k))
r(k)=2*pi*fc*[k-(N-1)/2]/fs, k=0,1,2,3,....

pi=3.14159

but, how these equations come from?


Thanks a lot!

Best regards,

Boki.
 
A

Activ8

Dear All,

We calculate the IIR filter coefficient by

h(kt)=(2fc/fs)(sin{r(k)}/r(k))
r(k)=2*pi*fc*[k-(N-1)/2]/fs, k=0,1,2,3,....

pi=3.14159

but, how these equations come from?

Thanks a lot!

Best regards,

Boki.

From a bilinear transform. You start with a known s-domain filter
transfer function and convert to the z-domain. You'd probably want
to start with an already published s-domain xfer function for an
analog filter which can most likely be found on the net but if not,
they're in various text.
 
J

Joel Kolstad

boki said:
We calculate the IIR filter coefficient by

h(kt)=(2fc/fs)(sin{r(k)}/r(k))
r(k)=2*pi*fc*[k-(N-1)/2]/fs, k=0,1,2,3,....

pi=3.14159

but, how these equations come from?

A book from Mitra or Oppenheim?

Just kidding.

The 'traditional' way to get IIR filter coefficients is to determine the
transfer function (i.e., a rational polynomial) for a continuous time filter
and then use some appropriate mapping (the bi-linear transform most
commonly) to get that equation H(s) into the discrete time domain, H(z).
The inverse Z transform then gets you the coefficients.

You can also apply 'direct' methods in the Z domain to design your filter;
the results are a little better, but the theory (often) a little harder.

Matlab can design many different discrete time filters for you... try out
'fdatool' if you have Matlab at your disposal.

You probably should move your question over to comp.dsp. BTW, what I've
said in the paragraph above there usually takes a month or so of a DSP class
to cover, so don't feel bad if you start reading a DSP book and find it's
taking awhile.

---Joel Kolstad
 
G

gwhite

Joel said:
boki said:
We calculate the IIR filter coefficient by

h(kt)=(2fc/fs)(sin{r(k)}/r(k))
r(k)=2*pi*fc*[k-(N-1)/2]/fs, k=0,1,2,3,....

pi=3.14159

but, how these equations come from?

A book from Mitra or Oppenheim?

LOL. "A book" is where everyone but boki gets them.

Matlab can design many different discrete time filters for you... try out
'fdatool' if you have Matlab at your disposal.

Not everyone with MATLAB has FDATOOL, since it is in an add-on toolbox
(SIGNAL in this case). Everyone who has MATLAB does have FILTER.

C:\math\MATLABx.x\Pro6\toolbox\signal\fdatoolgui\fdatool.m

FILTER One-dimensional digital filter.
Y = FILTER(B,A,X) filters the data in vector X with the
filter described by vectors A and B to create the filtered
data Y. The filter is a "Direct Form II Transposed"
implementation of the standard difference equation:

a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb)
- a(2)*y(n-1) - ... - a(na+1)*y(n-na)

If a(1) is not equal to 1, FILTER normalizes the filter
coefficients by a(1).

FILTER always operates along the first non-singleton dimension,
namely dimension 1 for column vectors and non-trivial matrices,
and dimension 2 for row vectors.

[Y,Zf] = FILTER(B,A,X,Zi) gives access to initial and final
conditions, Zi and Zf, of the delays. Zi is a vector of length
MAX(LENGTH(A),LENGTH(B))-1 or an array of such vectors, one for
each column of X.

FILTER(B,A,X,[],DIM) or FILTER(B,A,X,Zi,DIM) operates along the
dimension DIM.

See also FILTER2 and, in the Signal Processing Toolbox, FILTFILT.

Overloaded methods
help cas/filter.m
help dfilt/filter.m
help par/filter.m
 
B

boki

Thanks for information.
I am confusing about fourier series...

Best regards,
Boki.

Joel Kolstad said:
boki said:
We calculate the IIR filter coefficient by

h(kt)=(2fc/fs)(sin{r(k)}/r(k))
r(k)=2*pi*fc*[k-(N-1)/2]/fs, k=0,1,2,3,....

pi=3.14159

but, how these equations come from?

A book from Mitra or Oppenheim?

Just kidding.

The 'traditional' way to get IIR filter coefficients is to determine the
transfer function (i.e., a rational polynomial) for a continuous time filter
and then use some appropriate mapping (the bi-linear transform most
commonly) to get that equation H(s) into the discrete time domain, H(z).
The inverse Z transform then gets you the coefficients.

You can also apply 'direct' methods in the Z domain to design your filter;
the results are a little better, but the theory (often) a little harder.

Matlab can design many different discrete time filters for you... try out
'fdatool' if you have Matlab at your disposal.

You probably should move your question over to comp.dsp. BTW, what I've
said in the paragraph above there usually takes a month or so of a DSP class
to cover, so don't feel bad if you start reading a DSP book and find it's
taking awhile.

---Joel Kolstad
 
B

boki

Activ8 said:
Dear All,

We calculate the IIR filter coefficient by

h(kt)=(2fc/fs)(sin{r(k)}/r(k))
r(k)=2*pi*fc*[k-(N-1)/2]/fs, k=0,1,2,3,....

pi=3.14159

but, how these equations come from?

Thanks a lot!

Best regards,

Boki.

From a bilinear transform. You start with a known s-domain filter
transfer function and convert to the z-domain. You'd probably want
to start with an already published s-domain xfer function for an
analog filter which can most likely be found on the net but if not,
they're in various text.

I found there are two method to do FIR.
A. find the coefficient from fourier series.
B. Window method.

My thinking:
A. Fourier series:
1. Use fourier series to contribute a desire filter curv(ac response)
2. find fourier series
3. convolution signal with series
4. Get the FIR.

B. Window
Not study yet.

I am correct?

Thank you very much.

Best regards,

Boki.
 
B

Boki

I have a better book here :)

Thanks for information.

Best regards,
Boki.


gwhite said:
Joel said:
boki said:
We calculate the IIR filter coefficient by

h(kt)=(2fc/fs)(sin{r(k)}/r(k))
r(k)=2*pi*fc*[k-(N-1)/2]/fs, k=0,1,2,3,....

pi=3.14159

but, how these equations come from?

A book from Mitra or Oppenheim?

LOL. "A book" is where everyone but boki gets them.

Matlab can design many different discrete time filters for you... try out
'fdatool' if you have Matlab at your disposal.

Not everyone with MATLAB has FDATOOL, since it is in an add-on toolbox
(SIGNAL in this case). Everyone who has MATLAB does have FILTER.

C:\math\MATLABx.x\Pro6\toolbox\signal\fdatoolgui\fdatool.m

FILTER One-dimensional digital filter.
Y = FILTER(B,A,X) filters the data in vector X with the
filter described by vectors A and B to create the filtered
data Y. The filter is a "Direct Form II Transposed"
implementation of the standard difference equation:

a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb)
- a(2)*y(n-1) - ... - a(na+1)*y(n-na)

If a(1) is not equal to 1, FILTER normalizes the filter
coefficients by a(1).

FILTER always operates along the first non-singleton dimension,
namely dimension 1 for column vectors and non-trivial matrices,
and dimension 2 for row vectors.

[Y,Zf] = FILTER(B,A,X,Zi) gives access to initial and final
conditions, Zi and Zf, of the delays. Zi is a vector of length
MAX(LENGTH(A),LENGTH(B))-1 or an array of such vectors, one for
each column of X.

FILTER(B,A,X,[],DIM) or FILTER(B,A,X,Zi,DIM) operates along the
dimension DIM.

See also FILTER2 and, in the Signal Processing Toolbox, FILTFILT.

Overloaded methods
help cas/filter.m
help dfilt/filter.m
help par/filter.m
 
A

Activ8

Activ8 said:
Dear All,

We calculate the IIR filter coefficient by

h(kt)=(2fc/fs)(sin{r(k)}/r(k))
r(k)=2*pi*fc*[k-(N-1)/2]/fs, k=0,1,2,3,....

pi=3.14159

but, how these equations come from?

Thanks a lot!

Best regards,

Boki.

From a bilinear transform. You start with a known s-domain filter
transfer function and convert to the z-domain. You'd probably want
to start with an already published s-domain xfer function for an
analog filter which can most likely be found on the net but if not,
they're in various text.

I found there are two method to do FIR.
A. find the coefficient from fourier series.
B. Window method.

My thinking:
A. Fourier series:
1. Use fourier series to contribute a desire filter curv(ac response)
2. find fourier series
3. convolution signal with series
4. Get the FIR.

Well, if you're going to convert to frequency domain, you may as
well stay there for the filtering action. Convolution in the time
domain is just multiplication in the freq domain which takes less
time. then do the inverse DFT/FFT

Software is the best way to find the coefficients, IMO. You can find
implementations of the Remez and Parcks/McClellan algorithms on the
net.

Speaking of software, I got that DFP toolkit for MATLAB ( windows :(
) and upgraded the files to the latest release - 1.0.1. When I try
to set the filter type (lowpass, whatever) and the sample rate and
all and click "apply" I get an error about handling the callback. I
was wondering if you had this problem and if you found a fix.
B. Window
Not study yet.

Only window I know of is that used to mmke a sampled signal look
periodic, well, periodic with a smooth transition into the next
period..
 
Top