What algorithm is used for this impulse response program?

Status
Not open for further replies.

immadi.jagadish

Member level 5
Joined
Dec 19, 2010
Messages
89
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,820
I am not understanding what algorithm is used for this program

check it out and inform what may be it?

‘C’ Program to Implement Impulse response:

#include <stdio.h>

#define Order 2
#define Len 10

float y[Len]={0,0,0},sum;

main()
{
int j,k;

float a[Order+1]={0.1311, 0.2622, 0.1311};
float b[Order+1]={1, -0.7478, 0.2722};

for(j=0;j<Len;j++)
{
sum=0;
for(k=1;k<=Order;k++)
{
if((j-k)>=0)
sum=sum+(b[k]*y[j-k]);
}
if(j<=Order)
{
y[j]=a[j]-sum;
}
else
{
y[j]=-sum;
}
printf("Respose[%d] = %f\n",j,y[j]);

}
}
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…