0
$\begingroup$

I am trying to implement a Chebyshev waveshaper according to the description on the bottom post here:

Add odd/even harmonics to signal?

It looks similar to the algorithm here: http://www.juce.com/forum/topic/voice-changer-plugin

The results for any odd order setting sound good. But all even order results just end up in massive distortion. I also tried x * abs(x) instead of x², but the result is similar. How should I handle the even order terms? Or do I have to use a completely different method for producing even harmonics?

$\endgroup$
  • $\begingroup$ Could you post the relevant section of your code? $\endgroup$ – JRE May 22 '15 at 7:37
  • $\begingroup$ What is your input signal? Could overflow be a problem? $\endgroup$ – Matt L. May 22 '15 at 7:58
  • $\begingroup$ For 2nd order it's simply: outputBuffer[i] = 2 * pow(inputBuffer[i], 2) - 1; $\endgroup$ – user2561735 May 22 '15 at 8:00
  • $\begingroup$ 4th order: outputBuffer[i] = (8 * pow(inputBuffer[i], 4) - 8 * pow(inputBuffer[i], 2) + 1); $\endgroup$ – user2561735 May 22 '15 at 8:03
  • $\begingroup$ There are two strange things I discovered in this calculation methods: For a 24bit recording I have 16777216 possible amplitude values. 8388608 negative values, 0 and 8388607 positive values. So the possible interval is [-1, 0.999999881] (1 / (2^24 / 2) * 8388607) ... $\endgroup$ – user2561735 May 22 '15 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.