Re: [music-dsp] a family of simple polynomial windows and waveforms

2016-06-12 Thread robert bristow-johnson







 Original Message 

Subject: Re: [music-dsp] a family of simple polynomial windows and waveforms

From: "Ross Bencina" 

Date: Mon, June 13, 2016 12:25 am

To: music-dsp@music.columbia.edu

--



>> many hours of integration by parts
there's gotta be easier ways of doing it (like Euler's with binomial).
anyway, i haven't quite groked Charles Z's thing quite yet.


--
�


r b-j � � � � � � � � �r...@audioimagination.com
�


"Imagination is more important than knowledge."
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] a family of simple polynomial windows and waveforms

2016-06-12 Thread Ross Bencina

many hours of integration by parts

___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] a family of simple polynomial windows and waveforms

2016-06-12 Thread Charles Z Henry
I encountered a similar family of functions when looking at polynomial
interpolators' analytical spectrum.  Every polynomial interpolator can be
re-written as a convolution with a piecewise polynomial function, and the
symmetric piecewise polynomial functions have a convenient basis in the
form (|t|-a)^n on the interval [-a,a], which in turn have analytical
expressions for their fourier transforms.

So, here's the final tables I found especially useful (all obtained by many
hours of integration by parts and published to pd-list in 2008)

Note: use w for angular frequency in your transform.  The expressions get
more cumbersome when using 2*pi*f everywhere.

these functions f(t) are non-zero on the interval from [-a,a] and
zero, elsewhere

f(t)   |  F(w)
1 |  2/w*sin(aw)
|t||  2a/w*sin(aw) + 2/w^2*(cos(aw)-1)
t^2  |  2a^2/w*sin(aw) + 4a/w^2*cos(aw) - 4/w^3*sin(aw)
|t|^3 | 2a^3/w*sin(aw) + 6a^2/w^2*cos(aw) - 12a/w^3*sin(aw) -
12/w^4*(cos(aw)-1)

and a new set of functions that seem to be more useful, because terms
cancel.  I'll also include another column for the limit as w->0.

f(t)  | lim(w->0) F(w) |   F(w)
|t| - a  |-a^2 |2/w^2*(cos(aw)-1)
(|t| - a)^2 |  2/3*a^3  |4a/w^2 - 4/w^3*sin(aw)
(|t| - a)^3 | -1/2*a^4  |   -6a^2/w^2 - 12/w^4*(cos(aw)-1)
(|t| - a)^4 |  2/5*a^5  |8a^3/w^2 - 48a/w^4 + 48/w^5*sin(aw)
(|t| - a)^5 | -1/3*a^6  |   -10a^4/w^2 + 120a^2/w^4 +
240/w^6*(cos(aw)-1)
(|t| - a)^6 |  2/7*a^7  |12a^5/w^2 - 240a^3/w^4 +
1440a/w^6 - 1440/w^7*sin(aw)
(|t| - a)^7 | -1/4*a^8  |   -14a^6/w^2 + 420a^4/w^4 -
5040a^2/w^6 - 10080/w^8*(cos(aw)-1)

There is a general form for these functions, but I'm struggling to put
it in a good way.  I will show the last 4 functions F(w) to show the
pattern.  (if anyone wants to continue this work to bigger and bigger
polynomials, I hope this spares some headaches)

(|t| - a)^4 |4*2*a^3/w^2  - 4!/(4-3)!*2*a/w^4 + 4!*2/w^5*sin(aw)
(|t| - a)^5 |   -5*2*a^4/w^2 + 5!/(5-3)!*2*a^2/w^4 + 5!*2/w^6*(cos(aw)-1)
(|t| - a)^6 |6*2*a^5/w^2  - 6!/(6-3)!*2*a^3/w^4 +
6!/(6-5)!*2*a/w^6 - 6!*2/w^7*sin(aw)
(|t| - a)^7 |   -7*2*a^6/w^2 + 7!/(7-3)!*2*a^4/w^4  -
7!/(7-5)!*2*a^2/w^6 - 7!*2/w^8*(cos(aw)-1)
On Jun 10, 2016 8:32 PM, "James McCartney"  wrote:

>
> fun with math:
>
> You can create a family of functions, which can be used as windows, LFO
> waves or envelopes from the formula:
>
> f(x) = (1-x^a)^b
>
> evaluated from x = -1 to +1
>
> where 'a' is an even positive integer and 'b' is a positive integer.
>
> 'a' controls the flatness of the top and 'b' controls the end tapers.
>
> here is a plot:
>
> http://i.imgur.com/zoFeMbi.png
>
> you can make it into a bipolar wave alternating positive negative like
> this:
>
> x < .5 ? f(4x-1) : -f(4x-3)
>
> where x is a unipolar phasor (0 to 1 sawtooth).
> 4x-1 transforms the interval 0 to .5 into -1 to 1.
> 4x-3 transforms the interval .5 to 1 into -1 to 1.
>
> plot:
>
> http://i.imgur.com/8wvnFAE.png
>
> --
> --- james mccartney
>
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp
>
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Re: [music-dsp] a family of simple polynomial windows and waveforms

2016-06-12 Thread Ross Bencina

On 12/06/2016 8:04 PM, Andy Farnell wrote:

Great to follow this Ross, even with my weak powers of math
its informative.


My powers of math are still pretty weak, but I've been spending time at 
the gym lately ;)




I did some experiments with Bezier after being hugely inspired by
the sounds Jagannathan Sampath got with his DIN synth.
(http://dinisnoise.org/)
Jag told me that he had a cute method for matching the endpoints
of the segment (you can see in the code), and listening, sounds
seem to be alias free, but we never could arrive at a proof of
that.

Now I am revisiting that territory for another reason and wondering
about the properties of easily computed polynomials again.



My less-than-stellar understanding is that at the breakpoints, 
higher-order continuity determines the bandwidth of the harmonics 
induced by the discontinuity (This is related to the BLIT, BLEP, etc 
story discussed here many times). Each additional matched derivative 
gives you an extra 6db of roll-off. Which would stand to reason, since 
in the limit (i.e. infinite matched derivatives in a periodic waveform) 
you'd get a sinusoid. Or you could bandlimit the breakpoints using some 
other scheme (e.g. oversampling).


As to the exact impact the order of the polynomial has on bandwidth, 
aside from at the breakpoints, I'm not sure. But taking a stab at it: a 
polynomial of order n will have at-most n zero-crossings -- that might 
allow for a rough estimate of the maximum bandwidth. As for the minimum 
bandwidth: it doesn't take that many terms to get a sine wave with 
100db-accuracy (consider the error term in the Taylor series).


It may well be that the harmonic content in the DIN synth comes mainly 
from controlling (dis)continuity at the breakpoints rather than the 
spectrum of the polynomial curve per-se.


Cheers,

Ross.





___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp



Re: [music-dsp] a family of simple polynomial windows and waveforms

2016-06-12 Thread Andy Farnell
Great to follow this Ross, even with my weak powers of math
its informative.

So, just an application note: of course the idea of "cheap" oscillators
with interesting band limited waveforms, that require no more
than a phasor and arithmetic (multiplies, integer powers, etc) is
a goal.

I did some experiments with Bezier after being hugely inspired by
the sounds Jagannathan Sampath got with his DIN synth.
(http://dinisnoise.org/)
Jag told me that he had a cute method for matching the endpoints
of the segment (you can see in the code), and listening, sounds
seem to be alias free, but we never could arrive at a proof of
that.

Now I am revisiting that territory for another reason and wondering
about the properties of easily computed polynomials again.

all best,
Andy


n Sun, Jun 12, 2016 at 02:57:41PM +1000, Ross Bencina wrote:
> On 12/06/2016 3:05 AM, Andy Farnell wrote:
> >Does it make any sense to talk about the "spectrum of a polynomial"
> >over some (periodic) interval (less than infinity)?? Or is that
> >silly talk?
> 
> For the infinite interval:
> 
> Expanding the definition of the Fourier transform, for polynomial p:
> 
> P(w) = integral -infinity to infinity p(x) [e^(-2 pi i x w) ] dx
> 
> w is a real number.
> 
> This integral diverges as a Riemann integral. The Cauchy Principle
> value for polynomials of strictly odd order is zero. I don't know
> whether there's another theory of integration where this Fourier
> integral would make sense.
> 
> Looking at transform 308 in the tables here:
> https://en.wikipedia.org/wiki/Fourier_transform
> 
> It appears that if you know about distribution theory (I don't) and
> the derivatives of the Dirac delta you might be able to make sense
> of it.
> 
> But clearly a polynomial over an infinite interval is not going to
> make for a very useful signal :)
> 
> ~
> 
> For a finite (non-periodic) interval, you're essentially talking
> about a polynomial windowed with a rectangular window. Such a
> function has finite support, so the Fourier integral can be
> evaluated over a finite interval.
> 
> Consider an integral related to the Fourier integral for James'
> function with a = 2, b = 1, i.e. f(x) = (1-x^2) (the Welch window).
> 
> F(k) = integral -1 to 1 [(1-x^2)e^(ikx)] dx
> 
> Integration by parts (twice) yeilds:
> 
> F(k) = (-4/k^2)cos(k) + (4/k^3)sin(k)
> 
> For higher powers of a and b, you'll end up with a cascade of
> roughly ab integration by parts, and the decay of the transform is
> something like 1/k^ab.
> 
> ~
> 
> Now, how best to evaluate the Fourier integral for a repeated
> (periodic) polynomial segment?
> 
> Cheers,
> 
> Ross.
> 
> ___
> dupswapdrop: music-dsp mailing list
> music-dsp@music.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/music-dsp
> 


signature.asc
Description: Digital signature
___
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp