Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

12. (20 Points) Write a block processing C language function called echo that im

ID: 3919679 • Letter: 1

Question

12. (20 Points) Write a block processing C language function called echo that implements the system shown below and a function called echoInit to initialize the algorithm. xin] Delay xin-nol Assume that the input x, output y, and gain G are all in Q15 format and that the maximum possible value of the delay no is 32,000 samples. The function echolnit does not return any value and does not have any inputs. The function echo does not return any value, and the inputs to the function are as follows (in this order): x -pointer to the input buffer (type pointer to Int16) y-pointer to the output buffer (type pointer to Int 16) . N - size of input and output buffers (type Int16) .G-gain (type Int16) a. Write the contents of the header file echo.h: no-delay in number of samples (type Int16) b. Wire the contents of the Souree Stle echo.c withPencaons echol) and echo nite):

Explanation / Answer

//echo.h

#ifndef ECHO_H
#define ECHO_H
void echo(int16_t *, int16_t *, int16_t , int16_t , int16_t )
void echoInit();

#endif

//echo.c

#include<stdio.h>

#include"echo.h"

void echo(int16_t *x, int16_t *y, int16_t N, int16_t nO, int16_t G )

{

y[N] = x[N] + G*x[N-nO];

}

void echoInit()

{

//initialize values for x,y,N,nO and G here

}