design a lowpass filter  - Page 1
Forum section: electronics / projects

author: strikefreedom
author_rank: Newbie
timestamp: April 10, 2012, 02:15:12 am
content: can anyone help me how to design a lowpass filter array?

author: slateraptor
author_rank: Frequent Contributor
timestamp: April 10, 2012, 02:32:32 am
content: As in discrete-time FIR lowpass? Passive lowpass using discrete components? Active lowpass using op amps? Filter order? What have you done so far and exactly what is it that you don't understand?

author: Psi
author_rank: Super Contributor
timestamp: April 10, 2012, 02:58:07 am
content: If by array you mean a software lowpass filter..Then you can do a running/moving average.Step 1 - Move all data along by one to make room for new data. (ideally done in a loop)array = arrayarray = array... etc ...array = arrayarray = arrayStep 2 - Add new value to array (Input)array = newdata;Step 3 - Add up all elementsTotal = array + array ... etc... + array + arrayStep 4 - Divide by number of elements to produce outputTotal = Total / 20The above pseudo-code will result in a filter that removes quickly changing data.It's better/faster when the number of elements is a power of 2 (4,8,16,32 etc) because then you can use a binary shift for the divide operation.

author: strikefreedom
author_rank: Newbie
timestamp: April 10, 2012, 10:19:01 am
content: This is my example lab and the coef file with length 89//Fir.c FIR filter. Include coefficient file with length N#include "bs2700.cof" //coefficient file#include "dsk6713_aic23.h" //codec-dsk support fileUint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rateint yn = 0; //initialize filter's outputshort dly; //delay samplesinterrupt void c_int11() //ISR{short i;dly=input_sample(); //input newest sampleyn = 0; //initialize filter's outputfor (i = 0; i< N; i++)yn += (h* dly); //y(n) += h(i)* x(n-i)for (i = N-1; i > 0; i--) //starting @ end of bufferdly= dly[i-1]; //update delays with data moveoutput_sample(yn >> 15); //scale output filter samplereturn;}void main(){comm_intr(); //init DSK, codec, McBSPwhile(1); //infinite loop}#define N 89short h={-14, 23, -9, -6, 0, 8, 16, -58, 50, 44, -147, 119, 67, -245, 200, 72, -312, 257, 53, -299, 239, 20, -165, 88, 0, 105, -236, 33, 490, -740, 158, 933, -1380, 392, 1348, -2070, 724, 1650, -2690, 1104, 1776, -3122, 1458, 1704, 29494, 1704, 1458, -3122, 1776, 1104, -2690, 1650, 724, -2070, 1348, 392, -1380, 933, 158, -740, 490, 33, -236, 105, 0, 88, -165, 20, 239, -299, 53, 257, -312, 72, 200, -245, 67, 119, -147, 44, 50, -58, 16, 8, 0, -6, -9, 23, -14};Now i need re-design it , lowpass filter and coef file with length 20....can anyone helpplease and thank

author: madworm
author_rank: Frequent Contributor
timestamp: April 10, 2012, 10:57:24 am
content: How about a list-convolution with a Gaussian kernel?Each new data point is the Gaussian-weighted average of itself and its surroundings. The wider the Gaussian, the smoother the result. Probably needs periodic borders for the array.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: April 10, 2012, 12:13:12 pm
content: @strikefreedomThat's a pretty average piece of code.Sorry, had to say it.

author: Bored@Work
author_rank: Super Contributor
timestamp: April 10, 2012, 12:23:01 pm
content: Quote from: strikefreedom on April 10, 2012, 10:19:01 amThat code pops up all over the Internet. Typically in connection with Indian students trying to find someone to do their homework. It can be traced back to a book by some Rulph Chassaing.QuoteI would recommend you go away and do your home work on your own. And between reading your textbook and your course notes spend a minute or two and read your school's rules about academic dishonesty.EDIT:And stop posting the same stupid question to half of the Internethttp://www.electro-tech-online.com/electronic-projects-design-ideas-reviews/126595-design-lowpass-filter.html