Csound Csound-dev Csound-tekno Search About

[Csnd] quartic function (polynomials of degree 4) for single-cycle waves

Date2024-05-23 15:53
From"Jeanette C."
Subject[Csnd] quartic function (polynomials of degree 4) for single-cycle waves
Hey hey,
this is a maths question, perhaps someone can point me in the right direction 
or point out my error of thinking.

I tried to use quartic functions to create waveforms. Formulae of the kind:
a x^4 +- b x^2 + c
are symmetric in respect to the y-axis. With the right coefficients the 
resultant shape has three extrema. Example:
1/4 x^4 - 2 x^2 + 4
has two minima at -2 and 2 at y=0 and one maximum in between at 0 with y=4.
The upside-down version of the function:
-1/4 x^4 + 2 x^2 - 4
has maxima at -2 and 2 of y=0 and a minimum at 0 y=-4.
These two shapes, in the set boundaries of -2 and 2, could be concatenated to 
create one symmetric wave. At -2 and 2 their rate of change is 0, so that 
should avoid undue aliasing or other issues.

My question: is there a way to increase the steepness of the "bump" between 
such outer maxima/minima and construct the whole function in such a way that 
all important values are known: i.e. the x coordinates of the extrema.

I tried to create different functions, but they all sound the same. I've used 
two approaches: create the first derivative of degree three in factorial form:
(x + a) * (x + 0) * (x -a)
And coming from a more visual point of view: x^4 has a minimum at 0. A "bump" 
cna be introduced by subtracting a quadratic function with a factor. The 
minima can be calculated with:
x^4 = a * x^2
with a good factor a this is easy enough to solve.

Though all experiments sound the same. I suppose that this is due to the 
"bump" having the same steepness. Or could it be that I just need to increase 
the factor a quite a lot?

Or is this futile with just quartic functions?

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Here I go, on my own now <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2024-05-23 17:07
Frommskala@ANSUZ.SOOKE.BC.CA
SubjectRe: [Csnd] quartic function (polynomials of degree 4) for single-cycle waves
On Thu, 23 May 2024, Jeanette C. wrote:

> I tried to create different functions, but they all sound the same. I've used
> two approaches: create the first derivative of degree three in factorial form:
> (x + a) * (x + 0) * (x -a)

> Though all experiments sound the same. I suppose that this is due to the
> "bump" having the same steepness. Or could it be that I just need to increase
> the factor a quite a lot?

I'm not sure exactly what you mean by the bump having the same steepness.
But if you require:

minimum at -x
maximum at 0
minimum at +x
the two minima have the same y coordinate (symmetry of inverting x)

then that determines the quartic function up to a multiplicative constant.
Four constraints, each one determines one of the five coefficients of the
quartic, and then overall volume determines the fifth coefficient.  So,
yes, they're all going to sound the same, because they're all going to be
the same function.

-- 
Matthew Skala
mskala@ansuz.sooke.bc.ca                 People before tribes.
https://ansuz.sooke.bc.ca/

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2024-05-23 17:47
From"Jeanette C."
SubjectRe: [Csnd] quartic function (polynomials of degree 4) for single-cycle waves
Hi matthew,
many thanks. Yes, that answers my question. Well, it was worth investigating 
and it was a nice maths puzzle as far as I could solve it. :)

Best wishes,

Jeanette

May 23 2024, mskala@ANSUZ.SOOKE.BC.CA has written:

> On Thu, 23 May 2024, Jeanette C. wrote:
>
>> I tried to create different functions, but they all sound the same. I've used
>> two approaches: create the first derivative of degree three in factorial form:
>> (x + a) * (x + 0) * (x -a)
>
>> Though all experiments sound the same. I suppose that this is due to the
>> "bump" having the same steepness. Or could it be that I just need to increase
>> the factor a quite a lot?
>
> I'm not sure exactly what you mean by the bump having the same steepness.
> But if you require:
>
> minimum at -x
> maximum at 0
> minimum at +x
> the two minima have the same y coordinate (symmetry of inverting x)
>
> then that determines the quartic function up to a multiplicative constant.
> Four constraints, each one determines one of the five coefficients of the
> quartic, and then overall volume determines the fifth coefficient.  So,
> yes, they're all going to sound the same, because they're all going to be
> the same function.
>
> -- 
> Matthew Skala
> mskala@ansuz.sooke.bc.ca                 People before tribes.
> https://ansuz.sooke.bc.ca/
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

... About some useless information,
Supposed to fire my imagination <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here