The physical meaning of FFT results

Source: Internet
Author: User
Tags modulus

The frequency of the image is the index of the intensity of the gray intensity in the image, and it is the gradient of the gray level in the plane space. such as: a large area of the desert in the image is a region of slow gray-scale changes, the corresponding frequency value is very low, and for the Surface attribute transformation of the sharp edge region in the image is a sharp change in the area of gray, the corresponding frequency value is higher. Fourier transform has a very obvious physical meaning in practice, and F is an analog signal with limited energy, then its Fourier transform represents the spectrum of F. From a purely mathematical point of view, Fourier transforms a function into a series of periodic functions to be processed. From the physical effect, the Fourier transform transforms the image from the spatial domain to the frequency domain, and its inverse transformation is to convert the image from the frequency domain to the spatial domain. In other words, the physical meaning of Fourier transform is to transform the image's gray distribution function into the frequency distribution function of the image, and the Fourier inverse transform is to transform the frequency distribution function of the image into the gray distribution function.


In this way, by observing the Fourier transform Spectrum Map, also known as the Power map, we can first see that the image of the energy distribution, if the spectral map of the number of darker points, then the actual image is relatively soft (because the difference between the point and the neighborhood is not small, the gradient is relatively small), conversely, if the spectrum map, Then the actual image must be sharp, the boundary is clear and the boundary between the pixel difference is large. after the spectrum shift to the origin, it can be seen that the frequency distribution of the image is centered on the origin and symmetrically distributed. Shift the spectrum to the center of the circle in addition to clearly see the image frequency distribution, there is also a benefit, it can be separated by periodic rules of the interference signal, such as sinusoidal interference, a pair with sinusoidal interference, frequency shift to the origin of the spectrum map can be seen in addition to the center of a point as the center, symmetrical distribution of the highlight set, This set is the interference noise generated, it can be very intuitive by placing a band-stop filter to eliminate interference. In addition, I would like to state the following points:


1, the image after two-dimensional Fourier transform, its transformation coefficient matrix shows:

If the shift matrix FN origin is located in the center, its spectral energy concentration is located near the center of the short matrix of the transformation coefficients (shaded area in the image). If the origin of the FN of the two-dimensional Fourier transform matrix is located in the upper-left corner, then the image signal energy will be concentrated on the four corners of the coefficient matrix. This is determined by the nature of the two-dimensional Fourier transform itself. At the same time, it is shown that the energy concentration in low frequency region.


2, after the transformation of the image at the original point before the four corners are low-frequency, the brightest, the middle part of the translation after the low-frequency, the brightest, the brightness of large low-frequency energy (large angle).


from the computer processing precision is not difficult to understand, a signal length of n, a maximum of n/2+1 a different frequency, and more frequency than the computer can handle the accuracy range)


X[] Array is divided into two kinds, one is to represent the different frequency amplitude values of cosine wave: Re x[], and the other is to represent the sine wave of different frequency amplitude values: Im X[],re is real (real) meaning, Im is imaginary (Imagine) meaning, Using the representation of complex numbers to represent the positive cosine wave, but here we do not consider the other functions of the complex number, only to remember is a combination method, the purpose is to facilitate the expression (we will know later, the complex form of Fourier transform length is n, not n/2+1).


Using MATLAB to realize fast Fourier transform


FFT is a fast algorithm for discrete Fourier transform, which can transform a signal into frequency domain. Some signals are difficult to see in the time domain, but if you change to the frequency domain, it is easy to see the features. This is why a lot of signal analysis uses the FFT transform. In addition, the FFT can extract the spectrum of a signal, which is often used in spectral analysis.
Although many people know what the FFT is, what can be done, how to do it, but do not know what the result after the FFT, how to decide how many points to use to do the FFT.
Now, according to the actual experience, the specific physical meaning of the FFT result is stated. can be converted by FFT. N sampling points, after the FFT, you can get the FFT results of n points. In order to facilitate the FFT operation, usually n takes 2 of the entire number of times.  
    assumes that the sampling frequency is FS, the signal frequency f, and the sample count is N. Then the result of the FFT is a complex number of n points. Each point corresponds to a frequency point. The modulus of this point is the amplitude characteristic under the frequency value. How does it relate to the magnitude of the original signal? Assuming the peak of the original signal is a, the modulus of each point of the FFT result (except for the first point DC component) is n/twice times the value of a. And the first point is the DC component, its modulus is the DC component of the N times . And the phase of each point is the phase of the signal at that frequency. The first point represents the DC component (that is, 0Hz), and the last point N of the next point (in fact, this point does not exist, here is the hypothetical n+1 point, also can be seen as the first point to do two halves, the other half to the end) is the sampling frequency of FS, which is N-1 by the average divided into equal parts, The frequency of each point increases in turn. For example, the frequency represented by a point n is: fn= (n-1) *fs/n. As can be seen from the above formula, FN can distinguish the frequency of fs/n, if the sampling frequency of FS is 1024Hz, sampling point is 1024 points, you can distinguish to 1Hz. 1024hz sampling rate sampling 1024 points, just 1 seconds, that is, sampling 1 seconds of time signal and do FFT, the result can be analyzed to 1Hz, if sampling 2 seconds of time signal and do FFT, The result can be analyzed to 0.5Hz.

Assuming that the FFT after a certain point n is represented by complex A+bi, then the modulus of this complex is an= root a*a+b*b, the phase is pn=atan2 (b,a). Based on the above results, it is possible to calculate the expression of the corresponding signal of N point (n≠1, and N<=N/2): an/(N/2) *cos (2*PI*FN*T+PN), i.e. 2*an/n*cos (2*PI*FN*T+PN). For the n=1 point signal, is the DC component, the amplitude is a1/n. because of the symmetry of the FFT results, we usually only use the results of the first half, which is less than half the sample frequency.



< Span style= "color: #ff0000;" > < Span style= "color: #000099;" >


Figure 1 FFT results


We can see that there are relatively large values around 1th, 51st and 76th. We will take a closer look at the data near these three points:
1 points: 512+0i
2 points: -2.6195e-14-1.4162e-13i
3 points: -2.8586e-14-1.1898e-13i
50 points: -6.2076e-13-2.1713e-12i
51 Points: 332.55-192i
52 Points: -1.6707e-12-1.5241e-12i
75 Points: -2.2199e-13-1.0076e-12i
76 points: 3.4315E-12 + 192i
77 Points: -3.0263E-14 +7.5609e-13i
Obviously, 1 points, 51 points, 76 points of the value is relatively large, near the point value is very small, can be considered as 0, that is, at those frequency points of the signal amplitude of 0. Next, we calculate the amplitude values of each point. The modulo values of these three points are calculated separately and the results are as follows:
1 points: 512
51 Points: 384
76 Points: 192
According to the formula, the DC component can be calculated as: the amplitude of the 512/n=512/256=2;50hz signal is: 384/(N/2) =384/(256/2) =3;75hz signal amplitude of 192/(N/2) =192/(256/2) = 1.5. It can be seen that the amplitude from the spectrum analysis is correct.
The phase information is then computed. There is no phase in the DC signal, no need to control it. First calculate the phase of the 50Hz signal, atan2 (-192, 332.55) =-0.5236, the result is radians, the conversion angle is 180* ( -0.5236)/pi=-30.0001. Then calculate the phase of the 75Hz signal, atan2 (192, 3.4315E-12) =1.5708 radians, conversion angle is 180*1.5708/pi=90.0002. It can be seen that the phase is also true. Based on the FFT results and the above analysis, we can write the expression of the signal, which is the signal we started to provide.


Summary: Assuming that the sampling frequency is Fs, the sample number is N, after doing the FFT, a certain point N (n starting from 1) is represented by: fn= (n-1) *fs/n; the modulus of the point divided by N/2 is the amplitude of the signal at the expected frequency (divided by N for the DC signal) The phase of the point is the phase of the signal at the expected frequency. The calculation of the phase is calculated using the function atan2 (b,a). ATAN2 (b,a) is the angular value of the coordinate (a, b) point, ranging from-pi to pi. To be accurate to xhz, a signal with a sampling length of 1/x seconds is required and FFT is done. To increase the frequency resolution, you need to increase the number of sampling points, which is unrealistic in some practical applications, it is necessary to complete the analysis in a short period of time. The method to solve this problem has frequency subdivision method, the relatively simple method is to sample a short time signal, and then add a certain number of 0 in the back, so that its length to meet the required points, and then do the FFT, which can improve the frequency resolution to a certain extent. The specific frequency subdivision method can refer to relevant literatures.




PS: Here is an explanation of the previous hypothesis that the Peak value of the original signal is a, then the modulus of each point (except the first point DC component) of the FFT result is n/twice times of a. The first point is the DC component, and its modulus is n times the DC component. this sentence should only be valid for the Sin,cos function. If the time domain is x (n) =1,0<=n<=6, the other n is 0, and the 16-point FFT obviously does not meet this condition.


For the Cos function, take his example to see S (N) =2+3*cos (2*pi*50*n-pi*30/180) +1.5*cos (2*pi*75*n+pi*90/180) sampling the signal at 256Hz sampling rate, a total of 256 points sampled. According to our analysis above, fn= (n-1) *fs/n, we can know, every two points between the spacing is 1Hz, the nth point frequency is n-1. Our signal has 3 frequencies: 0Hz, 50Hz, 75Hz, should be at the 1th Point, 51st Point, 76th Point Peak, the other points should be close to 0. What is the actual situation?

A more DFT formula:


Because the sampling frequency is 256hz,

So x (n) =s (n/256) =2+3*cos (2*pi*50*n/256-pi*30/180) +1.5*cos (2*pi*75*n/256+pi*90/180)

Bring X (n) in, simplifying:


Finally, using the orthogonal principle, when k=0, the following two items are equal to 0,x (0) =2*256=512;

when K=50, the first and third items are 0, the middle is not 0,x (() =3*1/2*256*e (-J*Π/6), modulo value | X (|=384);

When k=75, in the same vein, modulo value | X (75) |=192;

(matlab subscript is starting from 1, so the value of K is deferred one bit, that is, k=1,51,76) This is consistent with the results of the experiment.

The physical meaning of FFT results

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.