kram1032
|
|
« Reply #15 on: March 21, 2017, 12:14:12 AM » |
|
a nice bubbly mess. The only problem with surfaces is that self-intersection doesn't look all too great with them. I wonder if there are some nice scalings that happen to (perhaps just barely) avoid self-penetration. Some possible extensions might include tripling the frequency and dividing the distance by three at each step, for instance.
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #16 on: March 21, 2017, 12:21:07 AM » |
|
here is what that would look like after 4 iterations for sine
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #17 on: March 22, 2017, 01:44:36 PM » |
|
I think there might be one last remaining problem, depending on what exactly you are trying to do, but that one might be really hard to fix: Really, the curve should not be displaced according to the x-coordinate's distance, but rather according to the previous iteration's curve length (rescaled into a unit interval). As of right now it's impossible (I think), to recreate the Koch curve or similar with carefully chosen piecewise-linear functions. Ideally, proper rescaling should do this perfectly. It's essentially impossible to solve problem analytically though. That will require some fancy numeric integration and, to get to higher iterations, also fancy numeric differentiation. Do you think you can do something like that, SamTiba? I'll think about it and try to code something up too.
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #18 on: March 22, 2017, 02:08:41 PM » |
|
Sorry for these multiposts but I keep gettnig "database errors" whenever I try to edit a previous post. Here is what, assuming I got it right in principle, the Koch curve (but without taking into account the curve length) looks like: Completely wrong, clearly.
|
|
|
Logged
|
|
|
|
SamTiba
|
|
« Reply #19 on: March 22, 2017, 11:04:26 PM » |
|
Some special signs in the titel made editing hard for the database so I took them out - it should work fine now I enhanced my code and came to a lot of possible extensions that I'm still currently working on. Got back to working with arrays because my Matlab can't handle piecewise functions. Extensions im working on: We can already start with a curve not with the normal [t,0]-line. We can shift along the tangent but shift along the normal aswell, this gets interesting if we don't start with a line but a curve. I found out (also with trying to rebuild the koch- and levi-c-curve) that the actual length of the curve is more important then thought, you can't simply split along the x-axis and say you reached half of the curve. In addition to that the scaling-factor is also not the same then the number of intersections. We have to take the differ in length of each curve into account. For example for the levi c curve the scaling-factor is sqrt(2)^(-n). It's hard to say for actual curves how to scale but I guess 2^(-n) for sine just sounds too easy. Unfortunately I don't have images to present today but I will get back to that later so that also the quiet image-hungry readers are happy aswell.
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #20 on: March 23, 2017, 09:27:17 AM » |
|
simply taking the complete curve's arc length won't be sufficient, I'm pretty sure: Not only is the overall curve longer than the initial line segment, the speed the curve is traversed with isn't uniform (using the x-coordinate to trace it). The arc length at any given moment is what you'd have to go with. The problem is that parametrizing curves by their arc length is already impossible to do in closed form with incredibly simple curves. (the most complex curve that features a reasonably simple arc length parametrization, I think, is the helical curve) Gotta do that numerically.
|
|
|
Logged
|
|
|
|
matsoljare
|
|
« Reply #21 on: March 23, 2017, 04:18:57 PM » |
|
Seems like this could be used for audio as well, if you played a very high iteration version as a waveform.
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #22 on: March 23, 2017, 04:37:49 PM » |
|
how would you convert a 2D plot into an audio wave? Or are you talking turning a spectrogram into audio?
|
|
|
Logged
|
|
|
|
SamTiba
|
|
« Reply #23 on: March 23, 2017, 10:45:44 PM » |
|
My brother told me about this one aswell because he is studying in that field. You can take any curve as an amplitude for one period and then fasten it up, so our curve would make the 'basic shape' for what you can then hear in 100-20khz. It's similar to using a sawtooth- or squarepulse-function but more enhanced and up to date the usage is spread in the modern music market.
Problem is that we could only use an amplitude so that the function has to be uniqueness. I came to that idea already with using sequences out of the mandelbrot- or julia-fractal but I didn't manage to find something where every x-value had just one and only one y-value.
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #24 on: March 23, 2017, 11:04:47 PM » |
|
yes, that's what I meant by "how would you convert a 2D plot into an audio wave?" I mean, there are some outs, but they don't seem that "natural" if that makes sense. You could interpret the axes in different manners. For instance you could use them as a spectrum, so then the x-axis would be time as usual but the y-axis would represent frequencies being played at the same time. Having multiple y-values would be perfectly fine under that interpretation. But doing this always feels kind of arbitrary, imo...
|
|
|
Logged
|
|
|
|
matsoljare
|
|
« Reply #25 on: March 24, 2017, 03:00:09 PM » |
|
You would follow the line from beginning to end and use the X or Y value as the amplitude.
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #26 on: March 24, 2017, 05:50:08 PM » |
|
but that's the point: You can't. There are arbitrarily many y values for each x value and if you look at the opposite order it's even worse. To interpret the curve as a simple displacement-over-time curve, it HAS to have an unambiguous amplitude.
|
|
|
Logged
|
|
|
|
SamTiba
|
|
« Reply #27 on: April 28, 2017, 11:59:18 AM » |
|
I spent a bit of time with the problem now and I'm ready to present a (hopefully) right result.
The process is now the following:
1) Start: Define the underlying curve and its tangent 2) Each step: distribute the parameter according to the length of the curve to pretend it from stretching, afterwards add the intersected and scaled version to the original position and create the new tangent by rotating the old tangent by the new one (and afterwards norming it)
Attached the result after 15 steps and with a depth of 100k points, also plotted the first 5 curves, where you can nicely see how the length is distributed (it passes the previous curve after equal lengths).
The result shows unstretched, fractalic behaviours and cool spirals. I am stunned of the mixing of smoothness and roughness in this curve. It may look very boring but it's just the start to something and can be extended nicely.
|
|
|
Logged
|
|
|
|
kram1032
|
|
« Reply #28 on: April 28, 2017, 06:10:35 PM » |
|
This looks very plausible to me. To test it, unlike before, this should work out to be exactly the same (at most directly squashed or stretched, but with the turns and intersections in the same positions, relatively) curve even if you rescale it. I.e., what's the result if your first Sine curve is normalized to lie between 0 and 1? Without properly taking the arc length parametrization into account, that would break.
Another great test is trying to replicate the Koch curve or similar with this, as I attempted before.
I actually also really like the look of this new curve! Since it appears to be smooth, I'd not be surprised if its fractal dimension actually ends up being 1. It may not even tend to infinite length. - Since you are now calculating the length, can you check if it look like it converges?
And what about your surface version? Does that still work with this new arc-length aware code? I'd imagine it's not quite so obvious how to actually take curve arc length over to surfaces. Perhaps preserving local area or something?
Oh, and one more request, if you don't mind: I really like the version where the frequency triples each time. It looks kind of like gears. Can you try that please?
|
|
|
Logged
|
|
|
|
SamTiba
|
|
« Reply #29 on: May 01, 2017, 12:30:03 PM » |
|
I did a few optimizations here, applying it to the koch- and levi c curve will take me a bit, stay tuned!
I spit out the length and you are right! The length converges to something around 15.3 . Didn't think of that and it actually surprises me.
The implementation on the surface version is hard, since the Dimension gets really distorted after a time and it would get even more complicated. But I would say it is still possible! Would really like to see the results but since I would have to work with arrays then (and did the surface-version with symbolic maths before) it would take a lot of time.
The tripled version looks like below in the image. The change of direction near the first crossing of the blue line (first step) seems kinda odd, but you can see how it evolves.
|
|
|
Logged
|
|
|
|
|