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 X-Raly sensor is producing continuous measurements with a frequency of approximately 1800 Hz (the
measurement frequency isn't precise, values are read with a period from 12000 of a second to 11500 of a
second).
Whenever a density measurement is ready the following callback function is called.
void MeasureDensityReady (int densitiy, int time_us);
The variable density contains the single measurement and time_uS 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 500 Hz (the
measurement frequency isn't precise; values are read with a period from 1400 of a second to 1/600 of a
second).
Whenever a position measurement is ready the following callback function is called:
void MeasurePositionReady(int position_m, int time_u3);
The variable position_mm contains the position of the board when is measured from the X-Ray sensor.
time_uS 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 min_pos_mm, int max_pos_mm,
int *mean_density, int *min_density, int *median_density);
This function should calculate following values in the length interval from min_pos_mm to max_pos_mm of
the board:
Mean density
Minimal density
Median of the density
Only the last 5 seconds of the measured data are of interest. That means the calculation thread can ask
only for the last 5 seconds of measured data.
Implement the 3 function concerning the efficiency of calculations and optimization of the memory usage.
The implementation of the main function where these 3 functions are called is not asked, pretending this
function is already existing.
Try to comment the most complex part of the 3 functions. Take into account time and memory complexity. Try to reduce it at maxium.
The X - Raly sensor is producing continuous

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!