Physical Meaning of FFT results

Source: Internet
Author: User
Tags modulus

I am working on an audio processing project recently. I have never learned FFT before. I only know that there is such a thing. Recently, I found that there were so many and most basic problems, even the input and output of FFT do not know anything. I finally found such information on the Internet and had to save it. You are also welcome to share it.

 

[Original] physical meaning of FFT results

FFT is a fast algorithm for Discrete Fourier transformation. It can transform a signal.
To the frequency domain. Some signals are difficult to see in the time domain, but such
After being transformed to the frequency domain, it is easy to see the features. This is a lot of signals.
Analyze the causes of FFT conversion. In addition, FFT can convert the spectrum of a signal
Extracted, which is often used in spectrum analysis.

Although many people know what FFT is, what it can be used for, and how to do it
But I don't know what the result after FFT means and how to decide to use it.
Number of points for FFT.

Now, the circle describes the physical meaning of the FFT result based on actual experience.
A analog signal is converted into a digital signal after ADC sampling. Sampling
The theorem tells us that the sampling frequency is twice the signal frequency.
Not here.

After sampling the digital signal, you can perform the FFT transformation. N sampling points,
After FFT, we can get the FFT result of N points. For convenience of FFT
Operation. N is usually the integer power of 2.

Assume that the sampling frequency is FS, the signal frequency is f, and the number of sampling points is N. So FFT
The result is a plural number of N points. Each vertex corresponds to a frequency.
Point. The modulo value of this point is the amplitude characteristic of this frequency value. Detailed and original
What is the relationship between the signal amplitude? If the peak value of the original signal is A, then the FFT
The modulus of each vertex (except the first vertex DC component) is.
N/2 times. The first point is the DC component, and its module value is the DC component.
N times. The phase of each vertex is the phase of the signal at this frequency.
The first vertex represents the DC component (0Hz), and the next vertex N is
Point (in fact, this point does not exist. Here is the n + 1 point
It can be seen that the first point is divided into two halves, and the other half is moved to the end .)
Sampling frequency fs, Which is evenly divided into N equal portions by the N-1 points in the middle, the frequency of each point
In turn. For example, the frequency of a point N is: fn = (n-1) * fs/n.
From the formula above, we can see that FN can distinguish the frequency as FS/n. If
If the sampling frequency fs is 1024Hz and the number of sampling points is 1024, the sampling frequency is 1Hz.
The sampling rate of 1024Hz is points, which is exactly 1 second. That is to say, sampling is 1 second.
Time Signal and FFT, the result can be analyzed to 1Hz, IF Sampling 2 seconds
Then, the result can be analyzed to 0.5Hz. If you want to increase the frequency
Resolution, you must increase the number of sampling points, that is, the sampling time. Frequency Resolution and
The sampling time is the reciprocal relationship.
Assume that point N after FFT is represented by the plural A + bi, then the modulo of the plural is
An = root a * A + B * B, and the phase is Pn = atan2 (B, ). Based on the above results,
The expression of the signal corresponding to N points (n = 1, and n <= n/2) can be calculated as follows:
An/(n/2) * Cos (2 * pI * fN * t + PN ), 2 * an/N * Cos (2 * pI * fN * t + PN ).
For a signal with n = 1 point, it is a DC component and its amplitude is A1/n.
Because of the symmetry of the FFT result, we usually only use the result of the first half,
That is, the result is less than half the sampling frequency.

Well, after talking about it for a long time, the formula is also dizzy, and the following circle uses an actual
Signal.

Suppose we have a signal, which contains 2 v dc components, the frequency is 50Hz,
An AC signal with a phase of-30 degrees and a amplitude of 3 V, and a frequency of 75Hz,
An AC signal with a phase of 90 degrees and a amplitude of 1.5v. The mathematical expression is as follows:

S = 2 + 3 * Cos (2 * pI * 50 * t-Pi * 30/180) + 1.5 * Cos (2 * pI * 75 * t + pI * 90/180)

In the formula, cos parameters are radians, So-30 degrees and 90 degrees must be converted to radians respectively.
We sample this signal at a sampling rate of 256Hz, with a total sampling rate of points.
According to the above analysis, FN = (n-1) * fs/N, we can know that every two
The spacing between points is 1Hz, and the frequency of the nth point is n-1. Our signal
There are three frequencies: 0Hz, 50Hz, and 75Hz, which should be at 1st, 51st,
The peak value appears on the 76th points, and the other points should be close to 0. What is the actual situation?
Let's take a look at the modulo value of the FFT result.

Figure 1 FFT result
We can see that there are
A relatively large value. Let's take a closer look at the data near these three points:
: 512 + 0i
2:-2.6195e-14-1.4162e-13i
3:-2.8586e-14-1.1898e-13i

50:-6.2076e-13-2.1713e-12i
51: 332.55-192i
52:-1.6707e-12-1.5241e-12i

75:-2.2199e-13-1.0076e-12i
76: 3.4315e-12 + 192i
77:-3.0263e-14 + 7.5609e-13i

Obviously, the values at, and are relatively large, and the values near it are
It can be considered as 0, that is, the signal amplitude at those frequency points is 0.
Then, we calculate the amplitude value of each point. Calculate the modulo values of these three points respectively,
The result is as follows:
1: 512
51: 384
76: 192
According to the formula, the DC component is calculated as follows: 512/N = 512/256 = 2;
50Hz signal range: 384/(n/2) = 384/(256/2) = 3; 75Hz signal
The range is 192/(n/2) = 192/(256/2) = 1.5. Visible, analyzed from the spectrum
The range is correct.
Then calculate the phase information. There is no phase for the DC signal.
It. First calculate the phase of the 50Hz signal, atan2 (-192,332.55) =-0.5236,
The result is a radian. The conversion angle is 180 * (-0.5236)/PI =-30.0001. Again
Calculate the phase of the 75Hz signal, atan2 (192, 3.4315e-12) = 1.5708 radian,
The conversion angle is 180*1.5708/PI = 90.0002. It can be seen that the phase is also correct.
Based on the FFT result and the above analysis and calculation, we can write the signal expression.
It is the signal we start to provide.

Conclusion: assume that the sampling frequency is FS and the number of sampling points is N. After FFT
A point of n (n starts from 1) indicates the frequency: fn = (n-1) * fs/N; the modulo VALUE OF THE POINT
Dividing by n/2 is the amplitude of the signal at the expected frequency (for the DC signal is divided
N); the phase at this point is the phase of the signal at the expected frequency. Phase Calculation
The function atan2 (B, A) can be used for calculation. Atan2 (B, A) is the angle of the coordinate (A, B ).
Degree value, ranging from-pi to pi. To be accurate to xhz, the sampling length must be 1/X seconds.
And perform FFT. To increase the frequency resolution, you need to increase the number of sampling points,
This is unrealistic in some practical applications and needs to be completed in a short period of time.
Analysis. The frequency subdivision method is used to solve this problem. The simplest method is
Sample a short period of time signal, and then add a certain number of 0 in the back to make the length
The number of required points is reached, and then FFT is performed, which can improve the frequency resolution to a certain extent.
For more information about the frequency subdivision method, see the relevant literature.

[Appendix: MATLAB program used for this test data]
Close all; % Close all images first
ADC = 2; % DC component Amplitude
A1 = 3; % frequency F1 Signal Amplitude
A2 = 1.5; % frequency F2 Signal Amplitude
F1 = 50; % signal 1 frequency (HZ)
F2 = 75; % Signal 2 frequency (HZ)
FS = 256; % sampling frequency (HZ)
P1 =-30; % signal 1 phase (degree)
P2 = 90; % signal phase (degree)
N = 256; % number of sampling points
T = [0: 1/Fs: N/fs]; % sampling time

% Signal
S = ADC + A1 * Cos (2 * pI * F1 * t + pI * P1/180) + A2 * Cos (2 * pI * F2 * t + pI * P2/180 );
% Display original signal
Plot (s );
Title ('original sign ');

Figure;
Y = FFT (S, N); % for FFT Conversion
Ayy = (ABS (y); % modulo
Plot (Ayy (1: N); % displays the original FFT modulus result
Title ('fft modulus value ');

Figure;
Ayy = Ayy/(n/2); % is converted to the actual RANGE
Ayy (1) = Ayy (1)/2;
F = ([1: N]-1) * fs/N; % is converted to the actual frequency value.
Plot (f (1: n/2), Ayy (1: n/2); % display the converted FFT modulus result
Title ('amplitude-Frequency Curve Graph ');

Figure;
Pyy = [1: n/2];
For I = "1: n/2"
Pyy (I) = phase (Y (I); % calculate the phase
Pyy (I) = pyy (I) * 180/PI; % converts to angle
End;
Plot (f (1: n/2), pyy (1: n/2); % display PHASE DIAGRAM
Title ('Phase-Frequency Curve Graph ');

This article is an article about the circle's participation in the end blog competition. I hope you can support it.
Circle, click "TOP" in the upper left corner to vote for the circle. Thank you.

(By computer00 @ 2008-05-15)

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.