[ot][spam][crazy][random]-3
I'm thinking maybe it could be nice to work on another pointless fun project. Like the supersampling thing. I know I have other ideas like that kicking around in me. Something that's seemed suppressed for a long time. [It's harder when graphs are involved :S or data recovery :S] maybe i am just confused. Maybe those things aren't harder! Who knows!
something random! and new and fun! one of the daydreams that backed the supersampling goal was a project for recovering video from unlit recordings, basically doing things in feedback with subtle patterns in the noise. I came up with it just as a fun signals challenge during chemotherapy. I ended up building a robot instead (video linked elsewhere on this list). But it was a fun goal! I was imagining that maybe there were existing patterns in environments that were everywhere, that I could start with in order to begin mapping large surfaces from long dark videos. I imagined things like maybe a fridge, for example, running a motor a frequency low enough that surfaces would very subtly change in a regular way. It didn't really matter to me if the magnitudes of the data didn't line up, it was fun to just work on something.
At the moment, it's hard for me to find much other than the matrix thing I just implemented newly :S this wasn't even an approach i'd tried pursuing before.
maybe protocols? I've spent some time trying to implement systems for recovering corrupt git repositories by analysing deallocated filesystem data. One of the fun things about that is working with the internals of a binary protocol.
I'm not really sure what to pursue here, originally i had a nice idea of finding othre algorithms to apply matrices or somesuch to, that was different enough from the previous thing so as to help make more cognitive space to hold stuff, but what i'm readily thinking of are things that are cognitively near the previous thing maybe some of those are interesting! maybe something visual? visual stuff cna be small! and visual AI is huge now, so hobby algorithms are clearly harmless
my last visual work happened also around the time of my chemotherapy; i made a tiny javascript graphics library for drawing spheres in a hardware accelerated way that worked on old hardware it projected the boundary of the sphere to screen space so it could be drawn as an ellipse with low polygon count. it could also draw the shadow from a light source, the edge of which is a half-ellipse, and optionally had a shader for lighting the sphere accurately
i thought i could draw everything that way, calculating in advance the bare minimum to draw
maybe i can make up a form of compression! i was thinking earlier about how, if you really could extract underlying signals from noise, you could compress data much more strongly. i wonder if there's some similar way i could compress other kinds of data? just using something random and stupidish? images are a little hard for me to work with what about written text? written text is made of common words ...
something that's often hard to find online is a database of cpu instructions associated with virtual machine operations that emulate them this seems like a basic thing for making a generic optimizing compiler. it's strange it hasn't normalised. i imagine there's such a thing in virtual machines themselves, like qemu.
i'm thinking about instruction databases here it looks like qemu already has a generalised VM architecture maybe i could find a way to add something that could move it closer to using that to automatically design compilation
I'm a little scared to take my fourier work into an actual fan recording, given how hard the other project ended up being to engage. Maybe I'll crazy a little around the ideal of finding the unknown frequency efficiently. It seems _relatively_ clear how to find the unknown frequency using a feedback loop. It's not that clear whether it will be the "largest" peak or the "lowest" peak or whatnot, but often in an FFT there is a largest peak which is also pretty low, especially in an FFT of only one signal. Having intimately considered parts of the DFT, I can think about how this peak happens because two sinusoids that are near the real frequency resonate with it very accurately. So, given you can find the two sinusoids bordering the highest peak, you could then perform another DFT filled with frequencies tightly packed around those two sinusoids, and from them find a much more accurate depiction of the peak. You wouldn't even need to use sinusoids, you could form a frequency matrix out of your current best guess as to the waveform. It's an old idea, and the feedback loop would be short, and I'd like to try implementing it. But I guess what's active for me is more the idea of thinking about it a little more [maybe unfortunately]. Maybe it can get smaller and simpler, with less feedback structure. A small reusable component? In the end, we can only represent a frequency with so much accuracy: that is, we only _need_ a frequency represented with so much accuracy. If we know the accuracy of the frequency of interest, we could craft frequency matrices that are much more effective. We could also form an exact model of how the wave responds to off-frequency harmonization, and from that try to calculate its precise frequency. This again becomes a chicken-and-egg problem, and one uses a feedback loop to make a best guess, since we don't know the shape of the wave. So, what collapses the recursive feedback is the fact that we can only guess the shape of the wave as accurately as we have data on it. If we only have 16 or 1024 or 1m samples of data, we can only describe the wave with that many samples at once: and as soon as there is noise added the order of magnitude of accurate samples of the wave and accurate bits of precision immediately begins dropping. So there is a bound to the concept of a feedback loop that depends on the data rather than the precision, and thinking about this one can begin to see that there would be again a matrix that can immediately calculate the exact frequency, although this is not strongly and directly apparent. If you imagine newton's method applied to a linear transformation made from every sample, one can show this would collapse into a matrix. {although this leaves out the concept of finding the maximum.} So there are a few concepts here: - how do i find the maximum in a way that can flatting feedback? - do i need a model of the shape of the wave? - what function best models the accuracy of a considered frequency vs the data? - how does the real frequency best relate to the output of that function? The maximum question is most recently interesting, but maybe in general it helps to think about a simple example. We could consider empty data containing only an exact nyquist frequency, and then also data that contains only 1 full sinusoid. Maybe also data that contains 2 full sinusoids. The case of 1 full sinusoid is interesting. There isn't actually information here that there is repeating data, other than the shape of the data being a sinusoid. Most signal mediums carry data as sinusoids, so it's meaningful to consider these. But most data is carried in ways that are so dense that it's not very accurate to model them as sinusoids. Both can happen. Kind of two different possibilities. In the case of sinusoids, it's very accurate to model things as sinusoids and one could consider how multiplying two sinusoids creates an output wave with frequency equal to their difference. There's probably a space in that multiplication where the frequency can be quickly derived. (Stated that way, it's a recursive problem, because you then need the frequency of the output wave, which makes feedback.) [[usually i would have just quickly implemented feedback solutions and moved on to a larger problem. i seem to be in a situation where planning is much easier than acting, and it's fun to find new efficient things.]] Then, in the situation where the signal is not related to sinusoids, it kind of seems like the problem is one of convolution. Various shifts of the signal against itself are compared. What's more interesting is that, here, the signal could be shifted a fractional amount, which relates to modeling its structure at a different resolution. It seems like it would be pretty useful to have a generic model for what is likely to be a signal, and sample locality seems to be a thing here. In my recent tests, I'm using dense underlying signals with wildly changing data, and then modelling them as being composed of sinusoids. This is an additional challenge added to the situation of not knowing the frequency of the signal, since we don't know the number of sinusoids composing them. I don't really know how much signal locality there is in something like that, but I could use my code to downsample it and look at it, theoretically. Something I can remember is that there are no frequencies higher than the nyquist frequency. So the wildest swing something is going to have is from +1 at one sample, to -1 at the next. Nothing is going to be swinging up and down twice in this test data, I think. 0936. I'm having some cognitive concerns. Maybe it makes sense to consider the sample depth of the signal unknown, or to imagine that there could be wild swings present. The wild swing areas would be considered noise, I suppose, since there isn't enough information on them. One way of considering noise, in my opinion, would be signals that are too small, high frequency, loud, numerous, to discern. 0937 I'm thinkiing of that part of the feedback where it helps to model the signal. This originally rose in the idea of considering how the signal might behave if multiplied by an off-frequency signal (or summed with one). Given data for the signal, we can algorithmically sum or multiply that data by a scaled form of the signal, and algorithmically plot a chart of how different offsets result in different outputs. I'm thinking this might be doable in a linear way to condense into a matrix. That's a bit much for me to consider right now it seems. Maybe it's more interesting to implement feedback right now!
So for trying implementing feedback to find the frequency of a signal precisely, I could try out using fourier.py . I could even use my existing test data, but leave it blind. I'd find the highest paired peaks, and then adjust the frequencies of interest and find again, until the error in the least squares solution dropped. Seems like it could be a small loop. 0942 ok, so first i would take an fft of the whole data (assuming I had no signal guess), and find its peak. i guess i can start by writing a quick peak-finder 0949 i wrote def peak_pair_idcs which takes the abs, sums adjacent frequencies, and returns the indices of the max pair using argmax. i put it in fourier.py i guess it needs some tweaks: it should ignore DC, for example, and i'm thinking it should rotate the frequencies in some way. usually it starts at DC, then goes low frequencies up to the nyquist ... but then what does it do?
np.fft.fftfreq(6) array([ 0. , 0.16666667, 0.33333333, -0.5 , -0.33333333, -0.16666667])
it goes back down to low negative frequencies. so it does make sense, maybe it's okay. if DC is high, this likely indicates information near or beyond the nyquist frequency. maybe i could move DC to the nyquist frequency? or add it to it? basically if the frequencies are too high it's not quite working! I think I'll remove DC. nobody wants to zoom in on noise when they're trying to think about signals. 0953 Okay, so then say I have a peak in the dft. How do I zoom in on it? I don't actually need to reconstruct the other data. I'm mostly interested just in the data at that peak. The current code models the output as fully describing the input, which leaves that out. We could stick with it for now, though. If the data _only_ contains that signal, then it is reconstructible from a dft tightly surrounding just that peak, and I think the code I wrote provides for that situation. But it's written in terms of sample rates, rather than frequencies. Those sound pretty similar though. When I have it give a normal dft, I give it the sample frequency and time sample rates. If I wanted it to do a dft of half stuff, I would give it twice the frequency sample rate. 2.0 . Or, I could halve the time sample rate. 0.5 . In a DFT, the frequency of something that is half, is specified related to the sample count, like 1 / N or 2 / N, and then at the nyquist frequency it's (N/2) / N or 0.5 . So this 1 / N or 2 / N, is what I would pass as 0.5 or 2 . The frequency is the ratio advancement per sample. so 1 / N reaches a full cycle in N samples. 2 / N reaches 2 full cycles in N samples. To zoom in on 2 / N, the frequency sample rate would be twice the time sample rate. .. I think. 0958 I'll try assuming that freq * N is what goes for the frequency sample rate. So you'd pass the lower of the two frequencies, to find the real peak. And you'd only need the portions of the FT that are up through the higher of the two frequencies: in fact, limiting how high frequency it goes is part of how it can get really detailed really fast. So, the current code goes up to the nyquist frequency. I'd want a different set of frequencies. A different minimum frequency. At the moment I'm reusing the output of np.fft.fftfreq() which outputs DC, then positive frequencies that are increasing fractions, then negative frequencies that are decreasing fractions (I think), with a change only in sign around the nyquist frequency. I'd want instead to not go all the way up to the nyquist frequency, but go only a little bit. I guess that could be a linear transform of the frequencies. To change their min and max. The current code is stated in terms of sample rates, but it might be more useful to state things in terms of minimum and maximum frequencies. That's a little confusing, changing between sample rates and frequencies, because I am changing the sample index parameter passed to the sinusoid, rather than the actual frequency. But the arithmetic reminds that scaling one of those is equivalent to scaling the other. 1004 I'm thinking of change create_freq2time and create_time2freq so that they specify the minimum and maximum frequencies of interest. Not sure. There's some further confusion around what a frequency is, since the time and space domains have different sampling rates here. Maybe a simplifying concept can be that the time domain has a real, measured sampling rate, whereas the frequency domain is just talking about frequencies, and has not actually been "sampled".
participants (1)
-
Undescribed Horrific Abuse, One Victim & Survivor of Many