Smoothing: preferred methods for determining the maximum frequency?

I read a little about smoothing and it seems to make sense, but there is one thing that I'm not too sure about. How exactly do you find the maximum signal frequency (in the context of graphics).

I understand there is more than one case, so I assume that there is more than one answer. But first let me set out a simple algorithm that I think will represent the maximum frequency, so someone can tell me if I conceptualize it incorrectly.

Say this is for a one-dimensional, final and gray image (in pixels). Am I right in assuming that you could just scan the entire line of the pixel (in the spatial domain), looking for a minimum oscillation, and the inversion of this least oscillation would be the maximum frequency?

Ex values ​​{23,26,28,22,48,49,51,49}

Frequency: to set {}

(1/2) = .5: {28.22}

(1/4) = .25: {22,48,49,51}

So will .5 be the maximum frequency?

And what would be the ideal way to calculate this for a similar pixel line, as above?

And on a more theoretical note, what if your sample input was infinite (more like the real world)? There would be a correct process like:

Predetermine a decent interval for point sampling Determine max frequency from point sampling while(2*maxFrequency > pointSamplingInterval) { pointSamplingInterval*=2 Redetermine maxFrequency from point sampling (with new interval) } 

I know that these algorithms are fraught with inefficiency, so what are some of the preferred methods? (Not looking for something crazy, optimized, just fundamentally better concepts)

+4
source share
4 answers

The right way to approach this is to use the Fourier transform (in practice, the FFT or the fast Fourier transform)

The theory works as follows: if you have a set of pixels with color / shades of gray, then we can say that the image is represented by pixels in the "spatial area"; that is, each individual number indicates an image at a specific spatial location.

However, we really want to present the image in the "frequency domain". Instead of each individual number defining each pixel, each number represents the amplitude of a particular frequency in the image as a whole.

An instrument that converts from a “spatial domain” to a “frequency domain” is the Fourier transform. The output signal FT will be a sequence of numbers that determines the relative contribution of different frequencies.

To find the maximum frequency, you perform an FT and look at the amplitudes that you get at high frequencies - then it's just a matter of searching from the maximum frequency until you click on "minimum significant amplitude". "

You can program your own FFT, but in practice it’s much easier to use a pre-packaged library such as FFTW

+2
source

You do not scan the signal at the highest frequency, and then select a sampling frequency: you select a sampling frequency that is high enough to capture the objects you want to capture, and then you filter the signal to remove high frequencies. You throw away anything that exceeds half the sampling rate before trying it.

Am I right in assuming that you simply scan the entire line of the pixel (in the spatial domain), looking for minimal wobble and the opposite of that smallest wobble would be the maximum frequency?

If you have a pixel line, the selection is already done. It is too late to apply an anti-aliasing filter. The highest frequency that can be present is half the sampling frequency ("1 / 2px", I think).

And on a more theoretical note, what if your sample was infinite (more like the real world)?

Yes, this is when you use a filter. First, you have a continuous function, such as a real image (infinite sampling rate). Then you filter it to remove everything above fs / 2, then you can select it in fs (digitize the image in pixels). The cameras do not actually filter, so you photograph bricks, etc. Moire drawings .

alt text

If you use computer-aided smoothing graphics, you should first think about a perfect continuous mathematical function and think about how you filter and digitize it to display the result.

For example, if you want to create a square wave with a computer, you cannot simply naively alternate the maximum and minimum values. This would be like sampling a real-life signal without filtering in the first place. Higher harmonics wrap themselves back into the main range and cause a lot of false bursts in the spectrum. You need to create the points as if they were selected from a filtered continuous mathematical function:

alt text

+2
source

I think this article from O'Reilly may also be useful to you ... http://www.onlamp.com/pub/a/python/2001/01/31/numerically.html ... there they have referring to the frequency analysis of sound files, but you give you this idea.

+1
source

I think you need a Fourier analysis application ( http://en.wikipedia.org/wiki/Fourier_analysis ). I studied this, but never used it, so take it with a big cheek of salt, but I believe that if you apply it correctly to your set of numbers, you will get a set of frequencies that are components of the series, and then you can choose the highest possible .

I can’t point you to a piece of code that does this, but I’m sure it is somewhere there.

0
source

All Articles