User:Contribution/Chanofreq Project: Difference between revisions
Contribution (talk | contribs) |
Contribution (talk | contribs) No edit summary |
||
| Line 73: | Line 73: | ||
=== Frequency settings === | === Frequency settings === | ||
Frequency values are encoded by the parser as positive integers with the help of three settings: | |||
* '''minfreq''': Defines the lower bound of frequencies. | |||
* '''maxfreq''': Defines the higher bound of frequencies. | |||
* '''bitfreq''': Specifies the bit depth for the positive integer representation. | |||
Frequencies are encoded this way: parser_frequency = int(((FREQUENCY - minfreq) * (2 ** bitfreq) / (maxfreq - minfreq)) + 0.5) | |||
With these default settings, | Each unit increase in the encoded integer corresponds to a frequency increment of (maxfreq - minfreq) / 2^bitfreq. | ||
By default, the frequency parameters are set as follows: minfreq = 0 Hz, maxfreq = 21474.83648 Hz, and bitfreq = 32-bit. | |||
With these default settings, FREQUENCY has a precision of five decimal places with an additional sixth decimal place that must be either 0 or 5. This configuration is optimized for compatibility with the human hearing range and 32-bit hardware and software systems, minimizing phase errors across all frequencies. In the worst-case scenario, 1 phase error would occur approximately once every 4.6 days. These default settings are suitable for most applications, but there is flexibility to modify '''minfreq''' and '''maxfreq''', and to use smaller or larger integer data types with '''bitfreq''' as needed. | |||
To change a setting: | To change a setting: | ||