Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Every Engineer should be familiar with the moving average filter that was discussed in lecture. In this problem write the code for the recursive implementation
Every Engineer should be familiar with the moving average filter that was discussed in lecture. In this problem write the code for the recursive implementation of t moving average filter using a FIFO and the provided FIFO functions. This code will be part of the TIMERO routir at the sampling rate of the filter. An example of an eight tap moving average filter is given below. Caution this example shows what the filter does. It is not the recursive implementation. The recursive implementation can easily be derived from the example. Do not use arrays. Hint this only takes a few lines of code. (25 points) 7. ER0 interrupt service routine. TIMERO is set for periodic interrupts Available FIFO functions FIFO push(value) pushes an new value into the FIFO. FIFO firstO FIFO last(O FIFO clearO FIFO popC If the FIFO is full the first value is popped off gets the first value put into the FIFO gets the last value put into the FIFO clears the FIFO pops the first value put into the FIFO yintermediate[11] = x[11] + x[10] + x[9] + x[8] + x[7] + x[6] + x[5] + x[4] yFilterValuel11] yintermediate 8 yintermediate [12] [12] +x[11] [10 9]+x[8] x17]+ x16]+[5] yFilterValue[12] yintermediate 8 The x values are inputs. The y value is the calculated value from the filter uint32 t yFilter Value; void TimerOA_Handler(void) uint32_t currentInput; currentInput - readCurrXValue): yFilter Value - Every Engineer should be familiar with the moving average filter that was discussed in lecture. In this problem write the code for the recursive implementation of t moving average filter using a FIFO and the provided FIFO functions. This code will be part of the TIMERO routir at the sampling rate of the filter. An example of an eight tap moving average filter is given below. Caution this example shows what the filter does. It is not the recursive implementation. The recursive implementation can easily be derived from the example. Do not use arrays. Hint this only takes a few lines of code. (25 points) 7. ER0 interrupt service routine. TIMERO is set for periodic interrupts Available FIFO functions FIFO push(value) pushes an new value into the FIFO. FIFO firstO FIFO last(O FIFO clearO FIFO popC If the FIFO is full the first value is popped off gets the first value put into the FIFO gets the last value put into the FIFO clears the FIFO pops the first value put into the FIFO yintermediate[11] = x[11] + x[10] + x[9] + x[8] + x[7] + x[6] + x[5] + x[4] yFilterValuel11] yintermediate 8 yintermediate [12] [12] +x[11] [10 9]+x[8] x17]+ x16]+[5] yFilterValue[12] yintermediate 8 The x values are inputs. The y value is the calculated value from the filter uint32 t yFilter Value; void TimerOA_Handler(void) uint32_t currentInput; currentInput - readCurrXValue): yFilter Value
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started