drdeca 2 years ago

Oh! This is applying FFT to the images! I thought it was going to be applying to functions f_n : [0,2pi] -> [0,1]^2 where f_n is the n-th level version of the curve.

I guess in that view, higher order curves would have higher frequencies have higher amplitudes, on account of changing direction more often.

I guess that view of things wouldn’t have much visual appeal, as it would just be associating to each integer frequency, an individual vector. (I guess a 2d complex-valued vector?)

Hm, still, I think there would probably be uh, something to see in the directions of these vectors?

And to handle the complex-valued stuff I would think that if you moved from the e^{i t n} basis to the cosines and sines basis, that one could maybe thereby do-away with that? Or... Well, yeah, that should be true, expressing a real valued periodic function as a weighted sum of sine and cosine functions doesn’t require any complex coefficients, but would doing so actually make the vectors which are the pairs of the coefficients for the two axiis, have a particularly clear meaning?

I would imagine the direction of these vectors should correspond to something like the different directions the curves move in, or differences between these directions.

Oh! One thing that might be nice visually, If you got the Fourier coefficients for the n-th level of the curve, and then took only the first k coefficients and constructed the curve associated with that, then that might be cool looking. I wonder, if you held k constant, but increased n, would the first k coefficients converge? If so, what would the curve from those first k coefficients look like?

  • yarg 2 years ago

    I've messed about with that sort of thing before: https://www.youtube.com/watch?v=pe4UAmb2wJw.

    I never got that far - I was primarily considering it as a point location definition for an image format, and I wanted a symmetrical curve.

    You can actually do that, if you relax the constraint that no grid point is shared (it's not really that big a problem, you just need to base the transform on the location between pixels, and not the centres of the pixels).

    • EntrePrescott 2 years ago

      interesting. Here's another video where one sees how the precision of this Moore curve drawn with epicycles varies with the frequency range:

      https://old.reddit.com/r/woahdude/comments/6udj3e/moore_curv...

      • yarg 2 years ago

        He's using a different sample set than I did, I only used the centre pixel points, but (I believe) he has also included points in between.

        Hence his version retains the blockiness of the Moore curve, whereas mine does not.

akomtu 2 years ago

It's not plane-fillingness, but fractalness of the inputs that makes the DFTs look interesting. So I'd experiment with other L-space system curves. A fractal has some periodicity that appears as bright lines on DFT, and when you add an extra level of recursion, the original periodicity remains and it gets supplemented with its harmonics. I'd also try to interpret a diagonal scan of the DFT images as a sound waveform, probably scaled down to fit it into the audible range. There's also a related so-called Radon transform that would make the DFT images more roundish.

gus_massa 2 years ago

Can you add some examples with different levels of recursion? It would be nice to see how the Fourier Transform changes when the level changes.

Is there something interesting at the limit when the recursion level is close to infinity?

gregsadetsky 2 years ago

Really great!

Curious: what about the reverse - draw the plane filling curves in the Fourier domain and then run an inverse transformation?

Edit: thanks for the reminder everyone, makes sense that the inverse would be roughly speaking “the same”! Cheers

  • pxndx 2 years ago

    The Fourier transform is almost, but not quite it's own inverse when dealing with reals, so they'd be very similar to the results here.

  • cperciva 2 years ago

    Modulo sign, the forward and inverse Fourier transform are the same thing.

  • jchallis 2 years ago

    Should generate the same figures in the space domain up to constant factors of 2 pi.

thewebcount 2 years ago

The results of the Hilbert and Hilbert-like curves look similar to the Robinson’s aperiodic tiling of the plane[0]. In that picture they use squares and rounded squares, but if you did all rounded squares, I think it would look more similar.

[0] https://en.wikipedia.org/wiki/Aperiodic_tiling

DesiLurker 2 years ago

Hmm, I was thinking about building a 2d game solver with a LLM and I was wondering the other day if there is a better way to represent 2D data instead of just raster scanning it to a vector. probably a hadamard transform might work out better but the hilbert pattern looks interesting too.

  • gus_massa 2 years ago

    I'm not sure I understood your idea, but somewhat related (of the inverse representation of your idea?) https://xkcd.com/195/

    • DesiLurker 2 years ago

      its basically trying to figure out the best way to represent 2D or 3D data to be vectorized and fed to a LLM for a puzzle game. I am rather new to the field so may not be using the right terminology.

      The idea is to create a bunch of these random game boards and generate various intermediate player states leading to a solution so the LLM can learn from it & then ask it to come up with steps to solve for a new board config.

      Its not a serious product, I am just trying to get my feet wet and understand how to use these transformers.

bawolff 2 years ago

It is kind of striking how the images look like stars and galaxies

totetsu 2 years ago

Could these be used to make dithering patterns?