You may want to compare your version of the wheel to pkane's DISTORT.
So if I get this right you may be applying the nonlinearity directly to the waveform? While this may prove adequate for simple tests, my hunch is that any signal components remotely approaching fs/2 would spell trouble in the form of aliasing. Nonlinear processing like that tends to require a quasi-analog signal, which means generous amounts of oversampling and float samples. (That tends to help out anything nonlinear quite a bit, including things like brickwall limiters.) soxr may be able to help out with that, as well as the requisite downsampling and dithering to output format.
Long-term follower of your website btw, even if my tuner tuner times generally are years behind me at this point.
So if I get this right you may be applying the nonlinearity directly to the waveform? While this may prove adequate for simple tests, my hunch is that any signal components remotely approaching fs/2 would spell trouble in the form of aliasing. Nonlinear processing like that tends to require a quasi-analog signal, which means generous amounts of oversampling and float samples. (That tends to help out anything nonlinear quite a bit, including things like brickwall limiters.) soxr may be able to help out with that, as well as the requisite downsampling and dithering to output format.
Long-term follower of your website btw, even if my tuner tuner times generally are years behind me at this point.
Thanks for the heads-up on aliasing. I hadn't considered it. I wrote the distortion generator mainly to get an idea how important low-order distortion was for FM tuners. I use the audio output from my tuners as source for the distortion generator. It is limited to 15 kHz by steep filters in the analog transmit processor or 16 kHz in the HD Radio transmit processor of local stations. I use 44.1 kHz sampling. I checked the spectrum for a number of audio samples and didn't see any evidence of aliasing. I will add a note to the writeup about it and probably suggest 96 kHz sampling for problem cases.
I think I'm going to rewrite the program to only repeat audio so I can make the loudness of undistorted and distorted sections equal. Initially I'll use RMS to measure loudness but I may eventually add a modern loudness measure. I ran some tests and loudness matching is much more important than I realized. Currently I'm letting the nonlinearity increase loudness however it wants. My thinking was that this is what an actual nonlinear circuit does. But the listener has to factor out the loudness change when assessing his distortion tolerance. I can make that unnecessary, at least within the limits of using RMS as a loudness measure.
Contact me by email if you want to continue the discussion. I do not monitor this forum.
Brian
I think I'm going to rewrite the program to only repeat audio so I can make the loudness of undistorted and distorted sections equal. Initially I'll use RMS to measure loudness but I may eventually add a modern loudness measure. I ran some tests and loudness matching is much more important than I realized. Currently I'm letting the nonlinearity increase loudness however it wants. My thinking was that this is what an actual nonlinear circuit does. But the listener has to factor out the loudness change when assessing his distortion tolerance. I can make that unnecessary, at least within the limits of using RMS as a loudness measure.
Contact me by email if you want to continue the discussion. I do not monitor this forum.
Brian