pflarue / ardop

Source for various version of ARDOP
Other
23 stars 4 forks source link

Calc templates #62

Closed pflarue closed 2 weeks ago

pflarue commented 2 weeks ago

ardopcf (and ardopc before it) uses precalculated waveform sample values from ardopSampleArrays.c as the basis for data sent to the soundcard to transmit. CalcTemplates.c is intended to contain the source code that generated ardopSampleArrays.c. However, CalcTemplates.c had not been maintained and was not fully functional.

This branch restores CalcTemplates.c so that it is now capable of producing newArdopSampleArrays.c containing data nearly identical to the existing ardopSampleArrays.c. The format is close, but not exactly the same. The data values are within +/- 2 (out of +/- 32k). By writing to a different file, the results can be compared before deciding whether or not to replace ardopSampleArrays.c with newArdopSampleArrays.c. Running CalcTemplates also prints some data comparing the new values to those found in ardopSamplesArrays.c. This is intended to help the developers to be confident that no unintended changes are being made.

The resulting newArdopSampleArrays.c is intended to be a temporary file that is either used to replace ardopSampleArrays.c or is deleted. It should not be included in the git repository. Therefore .gitignore is updated to exclude both this file and CalcTemplates, the compiled executable file. Instructions for building CalcTemplates with a single call to gcc is provided as a comment near the top of CalcTemplates.c.

Inspection of CalcTemplates.c allows the developers to see and understand the form of what is being transmitted much more easily than looking at the large arrays of numbers in ardopSampleArrays.c.