DSPRelated.com
Forums

Low Pass Filter design using ADSP21061 EZkit Lite

Started by Suman July 17, 2003
I have the following specification for design of 
  Low-Pass Filter ( Butter- Worth Filter)
               1. Order of Filter =10.(N)
               2. Cut-off Frequency =1KHz.(Fc)
               3. Sampling Frequency = 5KHz.(Fs)

  I have found out filter coefficients:

              H(f) = sqrt(1/(1+(f/Fc).^(2*N)));

 Input to the filter is
 case 1: input = pure sine signal with 500Hz

 case 2: input = pure sine signal with 1500Hz

 case 3: input = pure sine signal with 500Hz + pure sine signal with
 500Hz

 My problem is

if I am suppose to convolve the input(pure sine)signal with filter
coefficients,
how do I determine Number of coefficients for sine sine  signal and
the filter coefficients

please suggest me.

thanks in advance

Suma
Suman wrote:

> I have the following specification for design of > Low-Pass Filter ( Butter- Worth Filter) > 1. Order of Filter =10.(N) > 2. Cut-off Frequency =1KHz.(Fc) > 3. Sampling Frequency = 5KHz.(Fs) > > I have found out filter coefficients: > > H(f) = sqrt(1/(1+(f/Fc).^(2*N))); > > Input to the filter is > case 1: input = pure sine signal with 500Hz > > case 2: input = pure sine signal with 1500Hz > > case 3: input = pure sine signal with 500Hz + pure sine signal > with 500Hz > > My problem is > > if I am suppose to convolve the input(pure sine)signal with filter > coefficients, > how do I determine Number of coefficients for sine sine signal > and the filter coefficients > > please suggest me. > > thanks in advance > > Suma
Hello Suman, I'm not sure if I understand you correctly. Nevertheless... You should start with a bilinear transform of your butterworth filter. b0 + b1(z^-1) + b2(z^-2) + ... + b10(z^-10) In the equation H(z) = ------------------------------------------- a0 + a1(z^-1) + a2(z^-2) + ... + a10(z^-10) The coefficients are the bi and ai for i=0 to ord(filter). It's a bit lengthy, if you do it manually. So I figured out the coefficients for a filter with the specs you gave by using a tool (Matlab): Taking your filter specification, I receive the following coefficients for a df1 structure: b (numerator) a (denominator) 0.0004994540782331 1 0.004994540782331 -1.99240148160141 0.0224754335204895 3.01948286335538 0.0599344893879721 -2.81852242649451 0.104885356428951 2.03872063706252 0.125862427714741 -1.05454462109568 0.104885356428951 0.414446268750398 0.0599344893879721 -0.115718625236828 0.0224754335204895 0.0224985092722182 0.004994540782331 -0.00266891235357608 0.0004994540782331 0.000148764452177761 The first line is b0 and a0, the next line b1 and a1 etc. (If you don't know what to do with these coefficients, try a search for df1 structure or dfilt.df1 at www.google.com) The basic principle works like the following receipt: the sampled signal enters your processing system. every sample is stored as it comes in, let's say in a cell named x0. The previous content of cell x0 is moved to x1 before it's overwritten by the new sample. The previous content of cell x1 is moved to x2 before it's overwritten by the content of cell x0 (and so on until x10 is written). Now take the content of every storage cell x0...x10 and multiply it with the corresponding coefficient of the numerators 'b' and sum them all up. This is x0*b0 + x1*b1 + x2*b2 + ... x10*b10. A sample ripples through the memory queue one stage per sample. Calculation is done once at every incoming sample, too. Try to understand this before you proceed. Because the first coefficient of a (denominator) is '1', we can make things easier: Store it to a cell named 'm'. Build another storage queue like x which we will name y now. Every content of y0 is rippled through one stage per sample until it falls out (drops) behind y10. At every sample calculate the sum of memory elements yi multiplied by coefficients -ai. (-a1*y1 - a2*y2 ... -a10*y10) Add this sum and the content of cell 'm' (which holds the intermediate result of the first part of calculation). This is the input to memory cell 'y0'. And this is the output of your filter. If you try this out, it should show the behaviour of a 1kHz Low Pass Filter (if your sampling frequency is 5kHz) and you enter all samples conesquently into this processing system. I'd suggest that you try to draw a graphical representation of the process flow before you look for one in a book or on the web. What I described is named the DF1 structure, which (to my opinion) is easy to understand. I hope this could demonstrate how filter coefficients and samples work together. Note: if you refer to documents you'll find slightly different descriptions and sometimes different sign of coefficients a. This could happen, too, if you calculate the coefficients manually. Don't worry, just live with it, if it works... Bernhard -- before sending to the above email-address: replace deadspam.com by foerstergroup.de