Real DFT, complex DFT, FFT
FFT is a fast algorithm for calculating DFT, but it is based on complex numbers, so when real number DFT is calculated, it needs to be converted to a complex number format. The following figure shows the real number DFT and imaginary number DFT. The real number DFT will be N points in the time domain. The signal is converted into a frequency domain signal with 2 (N/2+1) points, of which the signal at one (N/2+1) point is called the real part, and the signal at the other (N/2+1) point is called It is the imaginary part, and the real part and the imaginary part are the amplitudes of the sine and cosine signals, respectively.
In comparison, the complex DFT converts 2 N-point time-domain signals into 2 N-point frequency-domain signals. In the time domain and frequency domain, one N-point signal is the real part, and the other N-point signal is the imaginary part. If you want to calculate N-point real DFT, take these N points as the real part in the time domain, and take N 0 points as the imaginary part in the time domain. Use FFT to calculate the DFT of such a complex signal to get 2 N points In the frequency domain signal, one N point is the real part and the other N point is the imaginary part. In the two N-point signals, from 0 to N/2 points are the real DFT frequency domains of N points to be calculated. For the real DFT, as mentioned in the previous chapters, its frequency domain is also a discrete periodic signal with a period of N points. It has symmetry from 0 to N/2 points and 1-N to -1 points. You can see from the picture below. The coordinates in the figure are not expressed by N but by the fraction of sampling frequency. If you don't understand, please see the previous chapters.
So if you use the inverse FFT to calculate the real time domain, you must satisfy the symmetry of the above figure.
How FFT works
The calculation of FFT can be divided into three steps: firstly, one N-point time-domain signal is divided into N 1-point time-domain signals, and then the frequency domain of these N 1-point time-domain signals is calculated to obtain N frequency domain points , And then add up these N frequency domain points in a certain order to get the spectrum we need. Each point here means a complex number, with real and imaginary parts. The signal decomposition of the first step is performed according to the following rules:
It can be seen that it is decomposed according to the bit reverse order. The second step is to calculate the frequency spectrum of each point: this step is very simple, because the value of the frequency spectrum of a point in the time domain is itself, so nothing needs to be done in this step, but you need to understand that the N points are not in the time domain at this time Signal, but frequency domain signal. The third step is to combine these N frequency domain signals. This step is the most troublesome step. It is the reverse order of the previous time-domain decomposition. Two 1-point frequency-domain signals are turned into a 2-point frequency-domain signal, and the two 2-point frequency-domain signals are turned into a 4-point frequency-domain signal. , Until the end. Here's how to turn two 4-point frequency domain signals into one 8-point frequency domain signal.
First, copy a 4-point frequency-domain signal to dilute the time-domain signal, and also copy another 4-point frequency-domain signal. However, you need to multiply the sine function before copying, so that the diluted time-domain signal is obtained. After panning, the two frequency domain signals are added together, as shown in the figure below. The purpose of doing this is to use this interleaving decomposition method in the time domain decomposition.
The following is the basic operation, called butterfly operation, which turns two 1-point complex numbers into one 2-point complex number.
The following is the flow chart of FFT operation
Operation speed comparison
If you use the relevant method to calculate DFT:
FFT can be faster
For example, using base 4 or base 8, this is not a calculation of 2 points, but a calculation of 4 or 8 points, which can increase the speed.
FFT is to DSP like transistor to electronics. They are the foundation of the field. Everyone knows how to use them, but only a few really understand their principles. This is the fact, you just need to know how to use it.
Gel Battery,Gel Cell Battery,Gel Battery For Car,Gel Type Battery
Power X (Qingdao) Energy Technology Co., Ltd. , https://www.solarpowerxx.com