Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

to be done in C programming. image text in transcribed
please keep as simple as possible and use LOTS of comments
create the 2 functions asked above as simple as possible. as it says below this is just needed to show code that theoreticaly could do what this is asikng. write the code for function 1 and function 2.
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What qualities do you see as necessary for your line of work?

Answered: 1 week ago