Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

design a lowpass filter

Status
Not open for further replies.
If you need some help you should spend a liitle more time and effort to describe your problem in detail.
Up to now we know nothing else but that you are planning to design a low pass filter.
 
ok...this is my example lab and the coef file with lenth 89


//Fir.c FIR filter. Include coefficient file with length N

#include "bs2700.cof" //coefficient file
#include "dsk6713_aic23.h" //codec-dsk support file
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate
int yn = 0; //initialize filter's output
short dly[N]; //delay samples

interrupt void c_int11() //ISR
{
short i;

dly[0]=input_sample(); //input newest sample
yn = 0; //initialize filter's output
for (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 buffer
dly = dly[i-1]; //update delays with data move
output_sample(yn >> 15); //scale output filter sample
return;
}

void main()
{
comm_intr(); //init DSK, codec, McBSP
while(1); //infinite loop
}



#define N 89
short h[N]={-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 my experiment is design a lowpass filter and the coef file with length 20...

can anyone help me ...please and thank
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top