Live data from Hacker News

Weierstrass functions: continuous but not differentiable anywhere

puzlet.com

11–20 of 49 posts

Re: Weierstrass functions: continuous but not differentiable anywhere

#11
I did some stuff with a professor in undergrad where I was a code monkey for his harmonic analysis research, and to be more useful(since I hadn't had much analysis) I went to the lectures of his HA course and this was one of the few things I retained.

Personally I think the cool thing about these(and also fractals, which display this as iterations go to infinity) is that they have infinite lengths in a finite(though obviously infinitely subdividable) span.

Re: Weierstrass functions: continuous but not differentiable anywhere

#13
post #7
post #4

Earlier quoted context omitted.

Cool! I didn't appreciate that. I think its interesting to see that behavior in an everyday Fourier series though.

I'm not sure that I'd call something with an infinite number of non-zero Fourier coefficients an "everyday" Fourier series. :)

Any sharp edge in an image has an infinite number of frequencies once Fourier transformed.

This is why images get blurry when resized up! For some reason better algorithms never seem to become popular.

Re: Weierstrass functions: continuous but not differentiable anywhere

#14
post #3

This function produces an audio signal that sounds like an organ. https://gist.github.com/improv32/8414717 http://vocaroo.com/i/s13ZO9QOMULL

I am quite surprised it does not sound like white noise. Anyway, I played the output of that script through some filters, and this sounds nice: play -c 2 weierstrass.wav gain -12 loudness chorus 0.5 0.9 50 0.4 0.25 2 -t 60 0.32 0.4 2.3 -t 40 0.3 0.3 1.3 -s reverb gain 12

Ah, it's easy to see why it won't sound like white noise. The standard function is a Fourier series - a sum of sine waves. It's a power series where the b parameter must be an odd positive integer value 7 or greater. If we want the n = 0 case to map to 20 Hz (minimum of human hearing), and the maximum frequency we can hear is 20kHz (valid for children) then the highest term we can hear is the solution to 20000/7^n = 20; 7^n = 1000, n = 3.55, which means that we'll only be able to hear the first three terms.

This will sound quite interesting, but it's a really bad approximation of the Weierstrass function! http://www.wolframalpha.com/input/?i=sin%28x%29+%2B+0.9*sin%...

Re: Weierstrass functions: continuous but not differentiable anywhere

#15

You can modify it slightly and get a function that has no integral, though it still has a well defined area under its curve (do the limit after the subtraction of the two otherwise-would-diverge sums).

Not sure what you mean by this, since your comment has no context -- there are no limits or sums in the link. However, even the humble Riemann integral would be able to find the area under the graph of a bounded function on a compact interval which is continuous on a set of full Lebesgue measure. Any other function only has a "well-defined area" for some seriously stunted notion of area; you can integrate more functions with a different integral, but what one calls a "well-defined area" pretty much depends on what kind of integral you're using at that point.

Re: Weierstrass functions: continuous but not differentiable anywhere

#16
I was finding it hard to understand why it wasn't differentiable (guess my maths is getting a bit rusty) until I read the below[0] which helped it make sense to me:

>The function has detail at every level, so zooming in on a piece of the curve does not show it getting progressively closer and closer to a straight line. Rather between any two points no matter how close, the function will not be monotone.

[0] http://en.wikipedia.org/wiki/Weierstrass_function

Re: Weierstrass functions: continuous but not differentiable anywhere

#17
post #8

Quick and dirty landscape/horizon generator for games?

That's more or less the idea behind Perlin noise. Start with a low frequency high amplitude smooth function, then sum it together while increasing the frequency and decreasing the amplitude.

See here for more: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

Re: Weierstrass functions: continuous but not differentiable anywhere

#18
post #7
post #4

Earlier quoted context omitted.

Cool! I didn't appreciate that. I think its interesting to see that behavior in an everyday Fourier series though.

I'm not sure that I'd call something with an infinite number of non-zero Fourier coefficients an "everyday" Fourier series. :)

Every function with a Fourier series will have an infinite number of non-zero Fourier coefficients unless it's merely a finite sum of sinusoids. (Like, obviously.) So yeah, those are "everyday" Fourier series.

Re: Weierstrass functions: continuous but not differentiable anywhere

#19

You can modify it slightly and get a function that has no integral, though it still has a well defined area under its curve (do the limit after the subtraction of the two otherwise-would-diverge sums).

Not sure what you mean by this, since your comment has no context -- there are no limits or sums in the link. However, even the humble Riemann integral would be able to find the area under the graph of a bounded function on a compact interval which is continuous on a set of full Lebesgue measure. Any other function only has a "well-defined area" for some seriously stunted notion of area; you can integrate more functi…

Consider this function:

    f(x) = sum[n = 0 to infinity]((1/2)^n sin((1/20)^n pi x))
It converges because each successive term is bounded by [-1/2, +1/2]. But if you integrate it you get:

    f(x) = sum[n = 0 to infinity](10^n / pi cos((1/20)^n pi x))
(Well... you get that if you play fast and loose about swapping the order of the integral and the sum)

Which diverges because the input to the cosine function limits to 0 as n -> infinity, so the cos limits to 1, and we get 10+100+1000+10000...

But if you integrate from two points and delay doing the limit until after then you get

    F(x1, x2)
    = sum[n = 0 to infinity](10^n / pi (cos((1/20)^n pi x2) - cos((1/20)^n pi x1)))
    = sum[n = 0 to infinity](10^n / pi (2*sin(pi/2 (1/20)^n (x1-x2))*sin(pi/2 (1/20)^n (x1+x2)))
Which, for large n, acts like:

    ~= sum[n = 0 to infinity](10^n / pi (2*(pi/2 (1/20)^n (x1-x2))*(pi/2 (1/20)^n (x1+x2)))
    = sum[n = 0 to infinity]((1/40)^n pi/2 *(x1-x2)(x1+x2))
Which converges.

Apologies for any math mistakes. This was all off the cuff. I wouldn't be surprised if some of the more general integration or summation strategies can also handle this case.

Re: Weierstrass functions: continuous but not differentiable anywhere

#20

I was finding it hard to understand why it wasn't differentiable (guess my maths is getting a bit rusty) until I read the below[0] which helped it make sense to me: >The function has detail at every level, so zooming in on a piece of the curve does not show it getting progressively closer and closer to a straight line. Rather between any two points no matter how close, the function will not be monotone. [0] http://en…

Good point, thanks. I added the quote from wikipedia, and moved the link from the CoffeeScript to the HTML.
Post reply on HN