DATA FILTRATION (VIEW) – FFT 1D, HT 1D, FFT 2D, HT 2D Jiří Kislinger Brno University of Technology, Faculty of Chemistry, Institute of Physical and Applied Chemistry, Purkyňova 118, 612 00, Brno, e-mail: xckislinger@fch.vutbr.cz HTU UTH Harmonic analysis is a mathematical procedure for describing and analyzing phenomena of a periodically recurrent nature. In our case it is provided by discrete Fourier transform (DFT), sometimes called finite Fourier transform. The DFT can be computed efficiently in practice using a fast Fourier transform (FFT) algorithm. Let x0, ..., xn-1 be complex numbers. The DFT is defined by the formula B ∑x e f = n j −1 − 2 πi j k k B B = 0,..., n − 1 . jk n B =0 In particular we are dealing with the Cooley-Tukey FFT algorithm. This is a divide and conquer algorithm that recursively breaks down a DFT of any composite size n = n1n2 into many smaller DFTs of sizes n1 and n2, along with O(n) multiplications by complex roots of unity traditionally called twiddle factors. The most well known use of the Cooley-Tukey algorithm is to divide the transform into two pieces of size n/2 at each step, and is therefore limited to power-of-two sizes, but any factorization can be used in general. These are called the radix-2 and mixed-radix cases, respectively (and other variants have their own names as well). Although the basic idea is recursive, most traditional implementations rearrange the algorithm to avoid explicit recursion. Also, because the Cooley-Tukey algorithm breaks the DFT into smaller DFTs, it can be combined arbitrarily with any other algorithm for the DFT. The Haar wavelet is the simplest possible wavelet. Its disadvantage is that it is not continuous and therefore not differentiable. It can also be described as a step function f (x) with B B B B B B B B ⎧ 1 ⎪ f ( x ) = ⎨− 1 ⎪ 0 ⎩ ≤ x < 1 2, 2 ≤ x < 1, 0 1 otherwise. The 2×2 Haar matrix that is associated with the Haar wavelet is 1 1⎤ ⎥ ⎣1 − 1⎦ H 2 = ⎡⎢ One can transform any sequence (a0, a1, ..., a2n, a2n+1) of even length into a sequence of two-component-vectors ((a0, a1), ..., (a2n, a2n+1)). If one right-multiplies each vector with the matrix H2, one gets the result ((s0, d0), ..., (sn, dn)) of one stage of the Fast Haar-Wavelet Transform. Usually one separates the sequences s and d and continues with transforming the sequence s. If one has a sequence of length a multiple of four, one can build blocks of 4 elements and transform them in a similar manner with the 4×4 Haar matrix B B B B B B B B B B B B B H4 = B B ⎡1 ⎢ 1 ⎢ ⎢1 ⎢ ⎣1 B B B B B B B B B B B 1 1 0⎤ 1 − 1 0⎥⎥ , −1 0 1⎥ ⎥ − 1 0 − 1⎦ which combines two stages of the Fast Haar-Wavelet Transform. First of all (after opening the image, of course) we choose appropriate Process: Harmonic Analysis (1D or 2D) or Wavelet analysis (1D or 2D again). Not speaking of other possibilities (several predefined filtration algorithms for smoothing, sharpening or derivative filters in the option Filtrations), let us focus then on the View part of the tool bar on the left: Processed Image Selecting this option means that analyzed sample has not undergone any possible filtration from View offer. Setting from the upper part of the tool bar, i.e. black-and-white intensity in our case is viewed (Fig. 1). 1. waveletova transformace (zadano Haar, nasledne Haar wavelet) http://en.wikipedia.org/wiki/Haar_wavelet 2. opticka prenosova funkce (zadano MTF, nasledne Modulation Transfer Function) - http://en.wikipedia.org/wiki/Modulation_Transfer_Function HU UH HU Fig. 1 Processed Image, Harmonic Analysis 1D UH Changing Processed Image to one may receive fractal analysis. Increasing the number decreases the resolution. E.g. 32 means that one gets either average value of intensity of row (alternatively column) with width of 32 pixels (1D analysis, Fig. 2) or average value of intensity of square with side of 32 pixels (2D analysis, Fig. 3). Processed Data Fig. 2 Processed Data, value 32, Wavelet Analysis 1D Fig. 3 Processed Data, value 32, Wavelet Analysis 2D MTF, PTF The Optical Transfer Function (OTF) describes the spatial (angular) variation as a function of spatial (angular) frequency. When the image is projected onto a flat plane, such as photographic film or a solid-state detector, spatial frequency is the preferred domain, but when the image is referred to the lens alone, angular frequency is preferred. OTF may be broken down into the magnitude and phase components as follows: (ξ η ) = (ξ η ) ⋅ (ξ η ) where (ξ η ) = (ξ η ) (ξ η ) = e − 2⋅π⋅λ (ξ ,η ) and (ξ, η) are spatial frequency in the x- and y-plane, respectively. The OTF accounts for aberration, which the limiting frequency expression above does not. The magnitude is known as the Modulation Transfer Function (MTF) and the phase portion is known as the Phase Transfer Function (PTF). We count them from the real and imaginary part of Fourier spectra: OTF , MTF MTF PTF , PTF , , , i , MTF = Re 2 + Im 2 PTF = Im Re These two alternatives are possible for Harmonic analyses only. They are displayed with excluded direct current for better view (Fig. 4-7). Fig. 4 MTF, Harmonic Analysis 1D Fig. 5 MTF, Harmonic Analysis 2D Fig. 6 PTF, Harmonic Analysis 1D Fig. 7 PTF, Harmonic Analysis 2D There is also the possibility to depict only the real (Re) or the imaginary (Im) part of the spectra (Fig. 8, Fig. 9). Fig. 8 Re, Harmonic Analysis 1D Fig. 9 Im, Harmonic Analysis 2D HT Spectrum Such spectrum is a result of Haar transform (described hereinbefore) which transforms a real image into a discrete spectrum. Basically, image factors are read out row-by-row and columnby-column and according to that are sorted. Low-pass filter image factors may be transformed back. The low-pass filter is necessary for factors separation. (Fig. 10) Fig. 10 HT Spectrum, Wavelet Analysis 1D All low level filters By means of this operation high frequencies are filtered. Acquired image is quarter size. Filtration proceeds until we receive an image of size of one pixel. Using Area Size value 256, there appear 8 images. Filtration is quite noticeable in the graph. (Fig. 11) Fig. 11 All low level filters, Wavelet Analysis 2D