Fourier transforms of images (2017)
plus.maths.org
plus.maths.org
I.e. the fourier transform explains, why apertures limit the resolution of optical devices. It is not only absolute brightness, but fundamentally an information-bottleneck.
Edit: nevermind, I got it [1]. I see, however, the result only holds 'modulo' paraxial waves well-behaved in the linear regime... So it's not that every lens automagically computes a FFT at the speed of light as it seemed at first!
[1] https://en.wikipedia.org/wiki/Fourier_optics#Fourier_transfo...
I think this is correct, and there are also some (more subtle) artifacts in the unrotated version for the same reason. The thing I don't understand is why this occurs for 2D images, but there are no artifacts created by the "edges" of a 1D sound (i.e. the start and end of the clip).
I've looked at the windowing options on a typical oscilloscope. (The Tektronix MSO 3014 is the one we happen to use in our lab.) Hanning window, Hamming window, Blackman-Harris, etc.
I'm wondering how much of the off-frequency noise in a typical signal is due to the discontinuity at the end/beginning of the fragment of the signal captured by the scope.
If it turns out that the discontinuity is the dominant source, there may be a straightforward way to avoid it.
A way to eliminate the discontinuity is to capture the data from the scope, transfer it to a computer, and trim the file so that it is a multiple of the fundamental frequency in length.
Then, use a mixed-radix FFT algorithm on the resulting file.
(It may be necessary to add or subtract a few lines from the file to ensure that the length of the file does not have large prime factors. Mixed-radix FFT is quadratic in the largest prime factor of the size of the input.)
Is this common practice? Or, are there reasons other than masking the effect of the boundary discontinuity that people typically use windowing functions?
Using a window trades off sensitivity for low frequencies and a slight bit of frequency resolution against these problems.
There's also an interesting alternative for images, if you don't care about inverting the transform to get the original image: you can express an image as a sum of a periodic component and a very slowly changing one. The periodic component looks like the original to the human eye, so taking DFT of it is usually sufficient for analysis. The paper that discovered that technique: https://hal.archives-ouvertes.fr/hal-00388020v1/document
Since your other comment mentioned limitations of optical apertures, maybe it's worth noting that the way the 45 degree rotation was done here (plunking the rotated image into a black background) mimics the action of an optical aperture -- that is, clipping the observed image along that rectangle.
This causes 45 degree spikes, similar to: https://en.wikipedia.org/wiki/Diffraction_spike#Diffraction_....
Topologically, an underlying problem is that there is not a continuous family of rotations for a torus (the topological space corresponding to two independent periodic dimensions).
https://arxiv.org/abs/1711.11561 (https://news.ycombinator.com/item?id=16165126)
Example: http://registry.gimp.org/node/11742
Optical illusion, or processing side-effect?
Hardly the only example, though, cf for example OCT (which is commonly used clinically in ophthalmology)
http://www.imagemagick.org/Usage/fourier/
Here's another one for advanced uses, including sharpening through FFT division: http://www.imagemagick.org/Usage/fourier/fft_math/https://github.com/aguaviva/micro-jpeg-visualizer
Enjoy the 5 lines (but slow) IDCT :)
for y in range(0,8):
for x in range(0,8):
nn = an*math.cos( n* math.pi * (x +.5)/8.0 )
mm = am*math.cos( m* math.pi * (y +.5)/8.0 )
self.base[ XYtoLin(x, y) ] += nn*mm*coeffhttps://www.mathworks.com/products.html
But the language itself is uniquely readable even for its brevity. You can do things in a few lines of code that would take 10 pages in a scripting language or 100 pages in lower level languages like C or Java. Here's the most concise explanation for how JPEG/MPEG compression works that I've ever found:
https://www.mathworks.com/help/images/discrete-cosine-transf...
If you can't afford MATLAB right now then you can at least play around with the language in GNU Octave:
If you want to DFT an image for analysis purposes (ie. if you don't need the transform to be invertible), you can use the trick from the "Periodic plus Smooth Image Decomposition"[1] paper that extracts a "periodic approximation" of the image. It's used e.g. for DFT-based texture enlargement/periodization.
[1] https://hal.archives-ouvertes.fr/hal-00388020v1/document
edit: ahhh, it encodes x position, but luminance distribution on y https://youtu.be/0ghTPnf89ME?t=166