Hi Paul,
I do not know exactly, but it seems that the only amplitude is transformed.
Otherwise, one should not, perhaps, apply such a compression.
And if it is really true, you can try many interesting nonlinear functions.
Your "sigma function" seems to be a very good idea.
I will try it.
But it should be modified.
You see, your function S = Exp(t) / (1 + Exp(t)) > 0
It is always positive!
This means that the amplitude of the compressed wave will be always
positive too.
As you know:
1 <= sin(x) <= 1
1 <= cos(x) <= 1
Your function can be modified in this way:
S_modified = 1 + 2*(Exp(x) / (1 + Exp(x)))
I am going to try this one:
S = 1 + (2*exp(k*x))/(exp(k*x)+1)
It should be "normalized", of course.
Many thanks for interesting idea!
It is obvious that the quality of the compressed sound depends on the
compression function.
Therefore, many different functions should be tried.
Best regards,
Igor
P.S. The plots are in the attachment
QUOTE from the Nyquist documentation:
(sexp sound)
A generalized exponential function. If sound is a SOUND, compute e^(x)
for each sample x. If sound is a number x, just compute e^(x). If
sound is a multichannel sound, return a multichannel sound with sexp
applied to each element. The result has the type, sample rate,
starting time, etc. of sound.
(slog sound)
A generalized natural log function. If sound is a SOUND, compute ln(x)
for each sample x. If sound is a number x, just compute ln(x). If
sound is a multichannel sound, return a multichannel sound with slog
applied to each element. The result has the type, sample rate,
starting time, etc. of sound. Note that the ln of 0 is undefined (some
implementations return negative infinity), so use this function with
care.
http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html
