Understanding Discrete Fourier Transformation (ii) ------ real number form discrete Fourier Transformation (real DFT) in the previous section we see an example of real number form discrete Fourier transformation, through this example, we can first have a more vivid perceptual knowledge of Fourier transformation. Now let's look at how the positive and inverse transformations of the real form discrete Fourier transformation are implemented. Here, we will first look at the multiple frequency Representation Methods.
I,Four Frequency Representation Methods in the frequency field1. Serial number representation method. The value ranges from 0 ~ N/2, this method can be used in the program to directly obtain the amplitude value of each frequency, because the frequency value corresponds to the serial number of the array one by one: X [K], the value range is 0 ~ N/2; 2. The score representation method. The value ranges from 0 ~ 0.5: X [random], random = K/N, value range: 0 ~ 1/2; 3. Expressed in radians. Multiply the radians by a 2π to obtain a radian value. This representation is called the natural frequency (Natural Frequency): X [ω], ω = 2 π records = 2 π K/N, the value range is 0 ~ π; 4, expressed in Hz (HZ) units, this is generally used in some special applications, such as the sampling rate of 10 kHz indicates that there are 10,000 samples per second: the value range is 0 to half of the sampling rate.
II,Basic DFT FunctionsCK [I] = cos (2 π ki/n) SK [I] = sin (2 π ki/n) where k Represents the frequency of each positive cosine wave, for example, if the value is 2, there are two complete periods in the length of 0 to N, and there are 10 periods in the value of 10. For example, as for the amplitude of each wave (amplitude) how is the value (RE x [K], Im X [k]) calculated? This is the core of DFT and the most difficult part to understand, let's take a look at how to synthesize the decomposed positive cosine wave into the original signal (inverse DFT ).
III,Merging Operation Method(Real inverse DFT)DFT synthesis equation: If you have learned the Fourier series, you will feel familiar with this equation! This equation is very similar to the Fourier Series: Of course, the difference must exist because these two equations are used under two different conditions. How can we prove the DFT synthesis formula, I want to have a very strong theoretical knowledge of advanced mathematics. This is the work of a person studying mathematics. I don't need such a thorough understanding of ordinary users, but the Fourier series is easy to understand, we can at least see from the Fourier series formula the rationality of the DFT synthesis formula. Im [k] AND Re [k] In the DFT synthesis equation are different from im X [k] and RE x [K]. The conversion method is as follows: however, when K is equal to 0 and n/2, the calculation of the real number must follow the equation below: N in the above four formulas is the total number of point in the time domain, K is the serial number from 0 to n/2. Why is conversion like this? This can be understood from the spectrum density (spectral density). For example, it is a spectrum chart. The horizontal coordinates indicate the frequency size, and the vertical coordinates indicate the amplitude size, the length of the original signal is n (32 here). The spectrum of the 17 frequencies obtained after DFT conversion indicates the amplitude of each unit of bandwidth, how is the bandwidth calculated? Look, except for the first and end, the remaining points occupy 2/N in width, which is the bandwidth of each point, and the bandwidth of the first and end points is 1/N, im X [k] and RE x [k] indicate the spectrum density, that is, the amplitude of each unit of bandwidth, however, Im [k] AND Re [k] indicate the amplitude of 2/N (OR 1/n) bandwidth, therefore, Im [k] AND Re [k] should be 2/N (OR 1/n) of im x [k] and RE x [k] respectively ). The spectrum density is like the physical material density. each point in the original signal is like a mixture, which is composed of different density substances, the mass of each substance contained in the mixture is the same except for the largest and least two density substances, in this way, the density of the mixture can be obtained by adding the density of each substance, and the mass of the mixture is the unit mass, therefore, the obtained density value is the same as the mass value of the mixture. As to why the imaginary part is negative, this is to be consistent with the complex DFT, we will know later that this is a mathematical computing requirement (im X [k] is calculated with a negative number, Im [k] with a negative number, and the result is positive, is not changed ). If the DFT result is obtained, the inverse conversion is required to synthesize the original signal. The conversion can be performed as follows: 1. The values of IM [k] AND Re [k] are calculated based on the preceding four formulas. 2. The original signal data is obtained based on the DFT synthesis equation. The following is the conversion Source Code implemented using the basic language: 100 'dft inverse conversion method 100'/XX [] Array Storage Calculation Result (original signal in the time domain) 100'/REX [] array stores the real component in the frequency domain, IMX [] is a virtual component of 130 '140 dim XX [511] 150 dim REX [256] 160 dim IMX [256] 170 '180 Pi = 3.14159265190 n % = 512200 '210 gosub xxxx 'Go to the subfunction to get Rex [] and IMX [] data 220 '000000' 230 for K % = 0 to 240 REX [K %] = REX [K %] /(n %/2) 270 IMX [K %] =-IMX [K %]/(n %/2) 280 next K % 100' 290 REX [0] = REX [0]/n310 REX [300] = REX [256]/n320 '123' initialize XX [] array 256 For I % = 0 to 511350 XX [I %] = 0360 next I % 370 '000000' 380 '000000' 390 for K % = 0 to 400 for I % = 0 to 410 '1970 XX [I %] = XX [I %] + REX [K %] * Cos (2 * pI * K % * I %/n %) 460 XX [I %] = XX [I %] + IMX [K %] * sin (2 * pI * K % * I %/n %) 470 '2017 next I % 480 next K % 100' 490 end in the code above, 500 to 510 may be better understood in the following form, but the results are the same: 420 for I % = 0 to 511430 for K % = 0 to 256440 '450 XX [I %] = XX [I %] + REX [K %] * Cos (2 * pi * K % * I %/n %) 460 XX [I %] = XX [I %] + IMX [K %] * sin (2 * pI * K % * I %/n %) 470 '1970 next I % 480 next K %
IV,Decomposition calculation method (DFT)There are three completely different methods for DFT: One method is to solve the problem through simultaneous equations. From the perspective of algebra, n unknown values need to be obtained from n known values, n simultaneous equations are required, and n simultaneous equations must be linear and independent. However, this method requires a large amount of computing and is extremely complex, so it is rarely used; the second method is to calculate the signal correlation (correlation). This is the method we will introduce later. The third method is the Fast Fourier Transform (FFT ), this is a very creative and revolutionary method, because it greatly improves the computation speed and enables Fourier transformation to be widely used in computers, however, this algorithm is implemented based on the Fourier transformation of the complex form. It breaks down the signal of N points into a frequency domain with a length of N, this is different from the real-domain DFT transformation we are currently doing, and this method is hard to understand. Here we will not understand it first. After understanding the complex DFT, let's take a look at FFT. It is very important that the transformation results obtained by these three methods are the same. It has been proved that when the frequency domain length is 32, the correlation method is the best for calculation efficiency, otherwise, the FFT algorithm is more efficient. Now let's take a look at the relevance algorithm. The correlation of signals can be used to detect known signals from the noise background. We can also use this method to detect whether the signal wave contains a certain frequency signal wave: multiply one signal wave to be detected by another to obtain a new signal wave, and then add all the points of the new signal wave, the similarity between the two signals can be determined from the result of the addition. For example, the above two graphs A and B are signal waves to be detected. Figure A clearly shows that they are three periods of sine wave, figure B's signal wave does not show whether it contains a sine or cosine signal. Figure C and D are three periods of sine wave, figure E and F are the results of multiplying the values of A and B with the values of C and D. The average values of all vertices in Figure E are 0.5, it indicates that signal a contains a sine signal C whose amplitude is 1, but the average value of all vertices in Figure F is 0, it means that signal B does not contain a signal D. This is the method of detecting whether a certain signal is contained by signal correlation. Correspondingly, I can also multiply the input signal and the positive cosine of each frequency (associated operation ), in this way, the correlation between the original signal and each frequency is obtained (that is, the sum size). The result is the Fourier transformation result we want. The following two equations are the calculation method we want: in the second formula, a negative number is added to maintain the consistency of the plural form. We know that a negative number is added when Im [k] is calculated, so this is just a form problem, there is no practical significance. You can also remove the negative number without adding a negative number when calculating im [K. Here, we must understand the concept of orthogonal: two functions are multiplied. If the sum of each vertex in the result is 0, we can consider these two functions as orthogonal functions. To ensure that the relevance algorithm is correct, the function form of the signal multiplied by the original signal must be orthogonal. We know that all the sine or Cosine Functions are orthogonal, this point can be proved through a simple high-number knowledge, so we can separate the original signal from the positive Cosine Signal by associating it. Of course, other orthogonal functions also exist, such as pulse signals in the form of square waves and triangular waves, so the original signals can also be decomposed into these signals, however, it is useless to do so. The following is the basic language code of real-domain Fourier Transformation: so far, we have a perceptual knowledge of Fourier transformation. But remember, this is only a discrete Fourier transformation in the real domain. Although the complex form is also used, it is only an alternative form and has no practical significance, in reality, the complex form of Discrete Fourier transformation is generally used, and the rapid Fourier transformation is designed based on the complex Discrete Fourier transformation algorithm. Next we will review the complex content, then, we can understand the Discrete Fourier transformation in the complex form on the basis of understanding the real-domain Discrete Fourier transformation.
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.