mathematical functions in audacity

how can I calculate an amplitude like this:



I want to know the result, if the signal gets computed with the formula above.
Does the sound become more higher pitched? Please answere to me! Thx

What is “x”? Is that the sample values?
If so, then it only makes sense for positive sample values and can be calculated using the Nyquist prompt effect with:

(snd-exp (mult (snd-log (s-max s 1e-15)) 1.1))

“1e-15” is a very small number that is used here to avoid taking the log of zero (which is “undefined”).

You can of course first save the sign of the samples and then multiply it with the raised x from Steve’s code (but with ‘(s-abs x)’

(setf sign (mult s (recip s)))

Either way, the function simply additional harmonics. The increase in pitch is most apparent when you take the power

(setf s (prod s s))

– it’s an octave jump.

What are you doing there Robert? That just gives a constant value of 1. :confused:

Sorry for that, it’s

(setf sign (mult s (recip (s-abs s))))
;; or
(setf sign (clip (mult ny:all s) 1))

However, the proper way is of course wave shaping which allows defining the case of negative or zero-valued input samples.