Ubiquitous in engineering are sensors that periodically send readings to a processor. Information from these readings must then be processed so that the system can respond appropriately. There are issues with readings, however:
As examples of the second:
This first signal is straight-forward and it is called an averaging filter. It is used strictly for removing white noise.
Your program will query the user for an integer N that is greater than zero. You will read numbers from a file. Once you have read in N numbers, you will begin to produce output; that output being the average of the last N numbers that were read in.
Enter the number of values to average (0 to quit): 10 Enter a file name: data.txt
For example, if the input file contains the following twenty numbers:
39.572 19.314 2.242 80.019 42.755 84.262 41.229 99.642 38.641 69.461 77.301 73.062 10.651 39.641 94.491 21.094 75.007 45.474 73.660 32.984
your output will be:
51.7137 55.4866 60.8614 61.7023 57.6645 62.8381 56.5213 59.8991 54.4823 57.9842 54.3365