Question: to be done in C programming. please keep as simple as possible and use LOTS of comments create the 2 functions asked above as simple
8. Please complete the following program by writing these two functions: a. A function that updates the sample buffer i.e., write the current sample over the oldest sample. Use the following prototype: float circularBuffer(float currentSample): lix(n) is passed in, a pointer to the current sample is returned lladd a static variable declaration in this function and set it to the top of the licircular buffer on first call (remember, a static variable is initialized once lland maintains its value between subsequent function calls b. A function that implements the FIR filter convolution equation float filterOutput(float *currentSample) lla pointer to the current sample is passed in and y(n) is returned i.e., the Iffilter output. Declare an array in this routine for the filter coefficients, Il don't bother initializing it though, life is too short! int sample Timerinterrupt=0; float sampleBuffer[10]; void main(void) { float "sampleBufferPtr, adcResult, output, while(1) { If(sampleTimerinterrupt) { ad Result = adc(); Ilget the current sample value i.e. x(n) sampleBufferPtr = circularBuffer(adcResult); output = filterOutput(sampleBufferPtr); sample Timerinterrupt = 0; } } *Note: I'm looking for conceptual work here. You don't have to load this up in a debugger and run it. Just put your thoughts down with good comments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
