Tutorial 6
Normalizing a function
You may have use for a function which has been set so that the highest value of the magnitude is one. When one finds the fourier transform of an image such as a letter of the alphabet the maximum value of this transform depends upon the size of the letter. So we may need a way of rescaling the function. The script below does the job. You may enjoy following its construction. This script just takes a letter as a binary file, enters it, transforms it, normalizes it, and displays it. the normalization is done in the two icons before the display.The "peak finder" icon finds the highest peak and makes the data available to the "rescale" icon, which does the work. To pass this information there must be a red data connection from the peak finder to the rescale icon. The variables maxR & maxI are the real part and imaginary part of the maximum value found by the peak finder. The formula shown at the left makes use of this information. For more information, open the rescale window and click the "Check this out" button at the lower left. This example just sets the highest magnitude to one. If you recall that the center pixel of a Fourier transform of a function is just the complex sum of all of the pixels divided by N (the array size) you should be able to make the integral of the magnitude square of the function to be one. Think of it as a homework problem. |