**ClassicAlgorithmStudy Series: 10. A thorough understanding of Fourier transform algorithm and**

Author: July, dznlong February 22, 2011

Recommended reading:**The scientist and engineer's Guide to Digital Signal Processing**, By Steven W. Smith, Ph. D.**Book address**:Http://www.dspguide.com/pdfbook.htm.

------------

A thorough understanding of the Fourier transform algorithm

Preface

Part 1, DFT

Chapter 1: Evolution of Fourier Transformation

Chapter 2 real number form discrete Fourier transform (real DFT)

**A thorough understanding of the Fourier transform algorithm**

Chapter 3, plural

Chapter 4. complex form discrete Fourier Transformation

Preliminary review, in the previous article:**10. A thorough understanding of the Fourier Transform Algorithm and**Let's talk about the origins of Fourier transformation and the real number form discrete Fourier Transformation (real DFT,

In this article, we will focus on two problems, namely, the complex number and the discrete Fourier transformation of the complex number form.

**Chapter 3, plural**

The plural number extends the concept of a number that we can generally understand. The plural number contains the real number and the imaginary number, the expression represented by two variables can be expressed by a variable (complex variable) in the form of a complex number, making processing more natural and convenient.

We know that the result of Fourier transformation is composed of two parts. The complex form can shorten the transformation expression, this allows us to process a variable separately (which we can know more precisely in the subsequent description), and the fast Fourier transformation is based on the complex form, therefore, almost all the descriptions of Fourier transformation form are in the form of plural.

However, the concept of the plural is more than what we can understand in our daily life. It is more difficult to understand the plural. Therefore, before understanding the complex Fourier transformation, we should first review the knowledge about the plural, this is very important for later understanding.

**I. Proposal of plural numbers**

Here, let's take a look at a physical experiment: throw a ball from a certain point, and then calculate the height of the Ball Based on the initial speed and time. This method can be calculated based on the following formula:

H indicates the height, G indicates the acceleration of gravity (9.8 m/s2), V indicates the initial speed, and t indicates the time. Now, if we know the height and need to calculate the time required for this height, we can calculate it using the following formula:

After calculation, we can know that when the height is 3 meters, there are two time points to reach this height: when the ball is up, the time is 0.38 seconds, the time when the ball moves downward is 1.62 seconds. But if the height is equal to 10, what is the result? Based on the formula above, we can find that there is an open square operation on the negative number. We know this is definitely unrealistic.

The first time I used this unusual formula was the Italian mathematician Girolamo Cardano (1501-1576). Two centuries later, the German great mathematician Carl Friedrich Gause (1777-1855) the concept of plural is proposed, paving the way for later application. He expressed the plural as follows: the plural is composed of real and imaginary, negative 1 of the root number in the imaginary number is represented by I (Here we use J, Because I represents the meaning of current in Electric Power ).

We can represent the X coordinate as the real number, and the Y coordinate as the virtual number, then the vector of each point in the coordinate can be expressed by the plural number, for example:

The three vectors ABC in can be expressed as the following formula:

A = 2 + 4.7

B =-4-1.5j

C = 3-7j

In this way, it is convenient to use a symbol to combine two arrays that were originally hard to associate. What is inconvenient is that we need to identify which is a real number and which is a virtual number, we generally use re () and IM () to represent the real number and virtual number, such:

Re a = 2 Im a = 6

Re B =-4 im B =-1.5

Re c = 3 Im c =-7

You can also perform addition, subtraction, multiplication, and Division operations between multiple numbers:

Here is a special note that J2 is equal to-1. In the fourth formula above, the numerator and denominator are multiplied by C-DJ at the same time, so that J in the denominator can be eliminated.

The plural also conforms to the exchange law, combination law, and allocation Law in the algebraic operation:

A B = B

(A + B) + C = a + (B + C)

A (B + C) = AB + AC

** ****2. Polar representation of the plural number**

As mentioned above, Cartesian coordinates are used to represent the plural. In fact, polar coordinates are more commonly used, for example:

M in is the magnproduct, which indicates the distance from the origin point to the coordinate point. θ is the phase angle, which indicates the angle from the square of the X axis to a certain vector, the following four formulas are the calculation methods:

We can also convert polar coordinates to Cartesian coordinates using the following formula:

**A + JB = m (COS θ + J sin θ)**

In the above equation, the left side is the Cartesian expression, and the right side is the polar expression.

There is also a more important equation-Euler's equation (Euler, Switzerland's famous mathematician, Leonhard Euler, 1707-1783 ):

**Ejx = Cos x + J SiN x**

This equation can be proved from the following series Transformation:

The two formulas on the right of the preceding table are the Taylor series of COS (X) and sin (x) respectively.

In this way, we can express the expression of the plural number as an index:

**A + JB = m ejθ (this is the two expressions of the plural number)**

The exponential form is the pillar of mathematical methods in digital signal processing. Perhaps it is because the multiplication and division operations of the plural form are extremely simple:

** ****Iii. Plural is a tool in Mathematical Analysis**

Why use the plural number? In fact, it is just a tool, just like the relationship between a nail and a hammer. The plural is like the hammer, which is used as a tool. We implement the complex form of the problem table to be solved (because some problems are more convenient to perform operations in the form of the plural), and then perform operations on the plural, finally, convert it back to get the results we need.

There are two ways to use the plural, one is to use the plural for simple replacement, such as the vector expression method mentioned above and the Real-domain DFT discussed in the previous section, the other is a more advanced method: Mathematical equivalence. Fourier transformation in the plural form uses the mathematical equivalent method, but we will not discuss this method here, here we will first look at the problem of replacing with a plural number.

The basic idea of replacing with the plural is to convert the physical problem to be analyzed into the form of the plural, where simply adding a plural symbol J, when the original physical problem is returned, the J symbol is removed.

One thing to understand is that not all problems can be expressed in the plural. it must be determined whether the analysis using the plural is applicable, an example shows that the expression of replacing the original problem with the plural is obviously incorrect: Assume that a box of apples is $5 and a box of oranges is $10, so we represented it as 5 + 10j. One week you bought 6 boxes of apples and 2 boxes of oranges, And we represented it as 6 + 2j, finally, the total cost is calculated as (5 + 10j) (6 + 2j) = 10 + 70j. The result is that the cost of buying an apple is 10 USD, and the cost of buying an orange is 70 USD, this result is obviously wrong, so the form of the plural is not suitable for solving this problem.

** ****4. Expression of positive cosine using the plural**

For m cos (ω T + PHI) and a cos (ω t) + B sin (ω t) expressions, it can be expressed in the plural, which can be very concise, the Cartesian form can be converted as follows:

In the preceding formula, cosine amplitude A is transformed to generate a, and the opposite number of sine amplitude B is transformed to generate B: A <=> A, B <=>-B, however, it should be noted that this is not an equation, but a replacement form.

The polar form can be converted as follows:

In the above formula, m <=> M, θ <=> Phi.

Here, the imaginary part adopts a negative number to be consistent with the expression of the complex Fourier transformation. For this replacement method to represent the positive cosine, there is no benefit to the symbol transformation, however, the replacement is always replaced to maintain the formal consistency with the more advanced equivalent transformations.

In discrete signal processing, it is a common technique to use the plural form to represent the positive cosine wave, this is because the results obtained by using the complex numbers are consistent with the original positive cosine calculation results. However, we must be careful with the complex numbers operations, such as addition, subtraction, multiplication, and division, some operations cannot be used, such as adding two sine signals and adding them in the form of plural. The result obtained is the same as that obtained before replacement, however, if two sine signals are multiplied, the result is different in the plural form. Fortunately, we have strictly defined the operating conditions in the form of positive cosine and plural:

1. The frequencies of all positive cosine values involved in the calculation must be the same;

2. the operation must be linear. For example, two sine signals can be added or subtracted, but multiplication or division is not allowed. systems such as signal amplification, attenuation, and high/low pass filtering are linear, such as square, shortening, and restriction are not linear. Remember that convolution and Fourier analysis can be performed only through linear operations.

Is an example of a Phase Transformation (we convert a sine or cosine wave into a plural form called a phase transformation, Phasor transform, A continuous signal wave is generated by a linear processing system to generate another signal wave. From the calculation process, we can see that the complex form makes the calculation change very simple:

In the second chapter, the real-number form Fourier transformation we described is also a replacement form of the complex transformation, but note that it is not a complex-number Fourier transformation, but a replacement method. In the next chapter, that is, chapter 4, we will know that the complex Fourier transformation is a more advanced transformation, rather than a simple replacement form.

**Chapter 4. complex form discrete Fourier Transformation**

The discrete Fourier transformation in the form of the plural uses the method of the plural skillfully, making the Fourier transformation more natural and concise. It is not simply using the replacement method to use the plural, the problem is completely analyzed from the perspective of the plural number, which is totally different from the real DFT.

**1. Represent the positive cosine function in the form of a plural number.**

through the Euler's equation, the positive cosine function can be expressed as a complex number:

CoS (X) = 1/2 e j (-x) + 1/2 ejx

sin (x) = J (1/2 e j (-x)-1/2 ejx)

From this equation, we can see that after the positive cosine function is expressed as a complex number, they become a positive cosine wave composed of positive and negative frequencies. On the contrary, A positive cosine wave composed of positive and negative frequencies can be expressed in the form of a plural number.

We know that in the real Fourier transformation, its spectrum is 0 ~ π (0 ~ N/2), but cannot represent-π ~ 0 spectrum, it is foreseeable that if the positive cosine is expressed as a plural form, the negative frequency can be included.

**2. Think of the variables before and after the transformation as the form of the plural**

In the plural form, Fourier transformation treats the original signal X [N] as a signal expressed in the plural form. The real part indicates the original signal value, and the imaginary part is 0, the transformation result X [k] is also in the form of a plural number, but the imaginary part here has a value.

Here we need to look at the original signal from the plural point of view, which is the key to understanding the Fourier transformation of the complex form (if you have learned the complex variable function, it may be better understood, consider X [N] As a plural variable, and then perform the same transformation for the plural variable as the real number ).

**Iii. Correlation Algorithm for the plural (positive Fourier transformation)**

We can know from the real Fourier transformation that we can multiply the original signal by a signal in the form of an orthogonal function, and then calculate the sum, finally, we can obtain the component of the orthogonal function signal contained in the original signal.

Now our original signal is changed to a complex number. Of course we want to obtain the signal component of the complex number. Can we multiply it by an orthogonal function in the form of a complex number? The answer is yes. The positive cosine function is an orthogonal function. After it becomes a complex number in the following form, it is still an orthogonal function (this can be easily proved by the definition of an orthogonal function ):

Cos x + J SiN x, Cos x-J SiN x ,......

Here we use the second sub-statement above for correlation summation. Why is the second sub-statement used ?, We will later know that the sine function is a negative sine function after the transformation in the virtual number. Here we add a negative number to make the final result a positive sine wave, based on this, we can easily obtain the plural form.**DFT positive transformation equation**:

This formula can easily obtain the Euler's transform formula:

In fact, we only use the Euler's transform type for the convenience of expression. We still use the positive cosine expression many times when solving the problem.

For the equation above, we need to clarify the following aspects (which is also different from the real DFT ):

1. X [k] and X [N] are all plural, but the imaginary part of X [N] is composed of 0, and the real part represents the original signal;

2. The value range of K is 0 ~ N-1 (can also reach 0 ~ 2 π), where 0 ~ N/2 (or 0 ~ π) is the positive frequency part,

N/2 ~ N-1 (π ~ 2 π) is the negative frequency part. Because of the symmetry of the positive cosine function, we take-π ~ 0 indicates π ~ 2π, which is convenient for computing.

3. J is an inseparable component, just like a variable in an equation, which cannot be removed at will. After removal, the meaning is completely different, however, we know that J is only a symbol in the real DFT, removing J, and the meaning of the entire equation remains unchanged;

4. It is a continuous signal spectrum, but the discrete spectrum is similar, so it does not affect our analysis of the problem:

The above spectrum map places the negative frequency to the left to cater to our thinking habits, but in reality

Now we usually move it to the back of the positive spectrum.

It can be seen that the positive cosine wave (used to form the positive cosine wave of the original signal) in the time domain is divided into two parts of the positive and negative frequencies in the spectrum of the complex DFT, based on the above formula, the proportional coefficient is 1/N (or 1/2 π), rather than 2/N, because the spectrum is now extended to 2 π, however, after adding the positive and negative frequencies, we get 2/n again and return it to the form of real-number DFT. This can be seen more clearly in the subsequent descriptions.

Because the complex DFT generates a complete spectrum, each point in the original signal is composed of positive and negative frequencies. Therefore, the bandwidth of each point in the spectrum is the same, the values are 1/n. Compared with the real-number DFT, the bandwidth at both ends is half less than the bandwidth at other points. The spectrum characteristics of the complex DFT are cyclical:-n/2 ~ 0 and n/2 ~ The N-1 is the same, the real domain spectrum is symmetric (representing the cosine wave spectrum), the imaginary domain spectrum is odd symmetry (representing the sine wave spectrum ).

**Iv. Inverse Fourier Transformation**

Assume that we have obtained the spectrum X [k] in the form of a plural number, and now we want to restore it to the original signal X [N] in the form of a plural number. of course, we should multiply X [k] by a plural number, then sum it, and finally obtain the original signal X [N]. the complex number multiplied by X [k] first reminds us of the complex number for correlation calculation:

Cos (2 π kN/N)-J Si (2 π kN/N ),

However, the negative number is actually used to convert the sine function into a positive symbol during Inverse Fourier transformation. Because of the special operation of the virtual number J, so that it should be a positive sine function to a negative sine function (we will see this point from the subsequent derivation), so the negative number here is only to correct the effect of the symbol, in reverse DFT, we can remove the negative number, so we get thisInverse DFT transformation equation:

**X [N] = x [k] (COS (2 π kN/n) + J sin (2 π kN/n ))**

When we analyze this formula, we will find that this formula is the same as the real Fourier transformation. First, let's change X [k:

X [k] = Re x [k] + J im X [k]

In this way, we can perform another transformation on X [N], for example:

X [N] = (RE x [k] + J im X [k]) (COS (2 π kN/n) + J sin (2 π kN/n ))

= (RE x [k] cos (2 π kN/n) + J im X [k] cos (2 π kN/N) + J re X [k] sin (2 π kN/N)-im X [k] sin (2 π kN/n ))

= (RE x [k] (COS (2 π kN/n) + J sin (2 π kN/n) + ------------------- (1)

Im X [k] (-sin (2 π kN/n) + J cos (2 π kN/n) ------------- (2)

In this case, we divide the original equation into two parts. The first part is to multiply the spectrum in the real domain, and the second part is to multiply the spectrum in the virtual domain. Based on the spectrum graph, we can know that, re x [k] is an even symmetric variable, and Im X [k] is an odd symmetric variable, that is

Re x [k] = Re x [-K]

Im X [k] =-im X [-K]

But the range of K is 0 ~ N-1, 0 ~ N/2 indicates the positive frequency, n/2 ~ N-1 represents the negative frequency, in order to express convenience we put n/2 ~ The N-1 is represented by-K, so that in the summation process from 0 to the N-1 for (1) and (2) There are n/2 pairs of K and-K respectively and, for formula (1:

Re x [k] (COS (2 π kN/n) + J sin (2 π kN/n )) + RE x [-K] (COS (-2 π kN/n) + J sin (-2 π kN/n ))

Based on the even symmetry and the property of trigonometric functions, the above formula is simplified:

Re x [k] (COS (2 π kN/n) + J sin (2 π kN/n) + RE x [k] (COS (2 π kN/N) -J sin (2 π kN/n ))

The final result of this Sub-statement is:

2 RE x [k] cos (2 π kN/N ).

Considering that there is a proportional coefficient 1/N in the RE x [k] equation, multiply 1/N by 2. Isn't this the same as the formula in the real DFT?

For the formula (2), we can also obtain the following result using the same method:

-2 Im X [k] sin (2 π kN/N)

Note that there is a negative symbol in front of the above formula, which is caused by the particularity of the virtual number transformation. Of course, we certainly cannot add the sine function of the negative symbol to the cosine. Fortunately, we used cos (2 π kN/N)-J sin (2 π kN/n) for correlation calculation. The obtained im X [k] has a negative symbol, in this way, the normal string function does not have a negative symbol in the final result, this is why negative symbols are used in the imaginary part of correlation calculation (I think this may be a weakness in the complex form of DFT, which makes people feel like a piece of work ).

From the above analysis, we can see that the result of the real Fourier transformation and the complex Fourier transformation is the same in the inverse transformation, but it is just the same thing. This article is complete. (July, dznlong)

**I am July and have allArticleContent and materials are copyrighted.**

You must indicate the author and the source, and notify me of the reprinting. May February 22, 2011.