Question: Embedded System Programming What implements the following code and which kind of buffer is xbuff ? (Explain the main functionalities of the code, no need

Embedded System Programming

What implements the following code and which kind of buffer is xbuff ?

(Explain the main functionalities of the code, no need to explain every line.)

#define BUFFSIZE 11

double FIR( double x)

{

static double b[BUFFSIZE] ={ -0.0048, 0.0032, 0.0413, -0.0133, -0.2896 \

0.5195, -0.2896, -0.0133, 0.0413, 0.0032, -0.0048};

static double xbuff[BUFFSIZE] ;

static double* bottom_p= xbuff;

static double* fill_p= xbuff;

static double* read_p= xbuff ;

static double* top_p= bottom_p +( BUFFSIZE -1);

int i;

double y = 0;

*fill_p=x;

read_p=fill_p;

if (++fill_p> top_p){

fill_p= bottom_p;

}

for (i=0; i< BUFFSIZE; i++){

y = y + b[i] * (*read_p);

if ((++read_p) > top_p)

read_p=bottom_p;

}

return y;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!