Hacker News new | past | comments | ask | show | jobs | submit login

> The very strong 45º lines in the rotated image are probably mostly artifacts caused by the image edges seen in the rotated version.

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).




When you do a Fourier transform of sound, you'd usually apply a windowing function: multiply the sound with a function that descends continuously to zero at the boundary of the "window", so that there is no discontinuity there. That function is chosen in such a way that it should affect frequencies of interest in the transform's output only mildly.


(Off-topic for OP, on-topic for the above interesting comment..)

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?


What fundamental frequency? If your signal is a mixture of frequency you care about and some other random ones, the random ones will generate lot of discontinuity if you tune the period to the interesting one. Also, if you're slightly off with your estimation of the interesting frequency, your signal will not match up.

Using a window trades off sensitivity for low frequencies and a slight bit of frequency resolution against these problems.


That makes sense. Seems like the same technique could be used with images, yes?


Yes, although not with very low-resolution images (8x8 or 16x16), because then you run out of frequency gap between interesting frequencies and ones that are contributed to by the windowing function. EDIT: Another facet of the same issue viewed from pixel space is that you lose a lot of contribution of pixels close to the edge, and in such small images majority of pixels are close to the edge.

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




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: