Question: The X - Raly sensor is producing continuous measurements with a frequency of approximately 1 8 0 0 Hz ( the measurement frequency isn't precise,
The XRaly sensor is producing continuous measurements with a frequency of approximately Hz the
measurement frequency isn't precise, values are read with a period from of a second to of a
second
Whenever a density measurement is ready the following callback function is called.
void MeasureDensityReady int densitiy, int timeus;
The variable density contains the single measurement and timeuS express the time difference elapsedfrom
the start of the program to time the actual measurement was taken, in microseconds.
The position sensor detects the position of the board with a frequency of approximately Hz the
measurement frequency isn't precise; values are read with a period from of a second to of a
second
Whenever a position measurement is ready the following callback function is called:
void MeasurePositionReadyint positionm int timeu;
The variable positionmm contains the position of the board when is measured from the XRay sensor
timeuS express the fime difference elapsed from the start of the program to time the actual measurement
was taken, in microseconds.
An asynchrony thread should calculate a couple of values in a given length intervall of the board with
following function:
void CaleulateDensityValues int minposmm int maxposmm
int meandensity, int mindensity, int mediandensity;
This function should calculate following values in the length interval from minposmm to maxposmm of
the board:
Mean density
Minimal density
Median of the density
Only the last seconds of the measured data are of interest. That means the calculation thread can ask
only for the last seconds of measured data.
Implement the function concerning the efficiency of calculations and optimization of the memory usage.
The implementation of the main function where these functions are called is not asked, pretending this
function is already existing.
Try to comment the most complex part of the functions. Take into account time and memory complexity. Try to reduce it at maxium.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
