With this code you can test the function of CRC and its robustness. The menu is:
Here, the user gives:
- k: The length of the message to be seny
- P: The known key to both sides.
- BER: probability of an error through transmission.
Then, a random message for transmission is created and CRC is applied. An example can be seen below.
Here, the user gives as previous the same variables. This time the program runs many times in order to present us the statistics.
An example of 10.000 runs:
An example of 100.000 runs:
An example of 1.000.000 runs:
In all cases we can see that CRC cannot detect only 0.01% of the errors.