Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this program, calculate a running mean value in which the input ignal is provided in fixed-length blocks of blocksize samples at a time. For
For this program, calculate a "running mean value" in which the input ignal is provided in fixed-length blocks of "blocksize" samples at a time. For each call to the function, your program should accept a new input sample block, and provide the corresponding output sample block giving the calculated results (assuming all input blocks follow each other). Every sample of the returned output block should contain the mean value of the most recent ", samples of the input sequence (even if some of the M samples includes values from previous input blocks). Use a structure to store the required information for the calculation from one call to the next The returned mean-value sequence should be the average value of the input sequence measured over the most recent M samples. If r[n] denotes the nth input sample, the output sequence yln] should be M-1 y[n] = Ni .rln _ i] To do this, first create a function "init_running_mean" with a call format given by s - init_running_mean (M, blocksize); Here, "M" is the number of samples to average over in calculating the output value, and blocksize is the input sample block size that will be used in subsequent calls. The returned structure "s should contain all information needed to perform the calculation in subsequent calls (a copy of M, any required storage arrays, etc.). The output samples should be calculated for one input block at a time by a companion routine "calc_running_mean" with a call format given by [y, s] calc-running-mean (x, s) ; = The input x" should be a vector of block size new input samples, and the calculated result y" should be the corresponding block size samples of the output signal. The structure "s is used as both an input and output argument, and may be modified by the function. However, the amount of storage required by the structure s should not increase as calc_running_mean is repeatedly called
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