Implementation of FFT Algorithm Based on TMS320LF2407

Publisher:温暖阳光Latest update time:2011-08-16 Keywords:TMS320LF2407 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Principle of Fast Fourier Transform

The Fourier transform of a non-periodic continuous-time signal x(t) can be expressed as

The calculated value is the continuous spectrum of the signal x(t). However, in the actual control system, what can be obtained is the discrete sampling value x(nT) of the continuous signal x(t). Therefore, it is necessary to use the discrete signal x(nT) to calculate the spectrum of the signal x(t).

The DFT of a finite-length discrete signal x(n), n=0, 1, ..., N-1 is defined as:

It can be seen that DFT needs to calculate about N2 multiplications and N2 additions. When N is large, this amount of calculation is very large. Using the symmetry and periodicity of WN, the N-point DFT is decomposed into two N/2-point DFTs. In this way, the total amount of calculation of the two N/2-point DFTs is only half of the original amount, that is, (N/2)2+(N/2)2=N2/2. In this way, the decomposition can be continued, and N/2 can be decomposed into N/4-point DFTs, etc. For N=2m points, the DFT can be decomposed into 2-point DFTs, so that its calculation amount can be reduced to (N/2)log2N multiplications and Nlog2N additions. Figure 1 shows the relationship between the amount of calculation required and the number of calculation points of FFT and DFT. The superiority of the FFT algorithm can be clearly seen from the figure .

Relationship between the amount of computation and the number of calculation points of FFT and DFT

Decompose x(n) into the sum of two sequences of even and odd numbers, that is

The lengths of x1(n) and x2(n) are both N/2, x1(n) is an even sequence, and x2(n) is an odd sequence, then

Where X1(k) and X2(k) are the N/2 point DFTs of x1(n) and x2(n) respectively. Since both X1(k) and X2(k) have a period of N/2 and WN k+N/2=-WN k, X(k) can be expressed as:

The operation of the above formula can be represented by Figure 2, and its shape is called butterfly operation. Similarly, after m-1 decompositions, the N-point DFT is finally decomposed into N/2 two-point DFTs. Figure 3 shows the decomposition process of 8-point FFT.


8-point FFT decomposition flow chart

The principle of FFT algorithm is to achieve large-scale transformation through many small and easier transformations, which reduces the operation requirements and improves the operation speed. FFT is not an approximate operation of DFT, they are completely equivalent.

2 Implementation of Fast Fourier Algorithm on TMS320LF2407

According to the characteristics of the FFT algorithm, the processor must complete the multiplication and accumulation work within one instruction cycle, because complex number operations require multiple table lookups and multiplications to be realized. The second is indirect addressing, which can realize the increase/decrease of one variable address, which is convenient for various table lookup methods. Thirdly, the input sequence x(n) of the FFT transform is arranged in the so-called reverse order of the code bits, and the processor must have the ability of reverse indirect addressing. The DSP controller is specially designed with a unique reverse indirect addressing, and can complete the multiplication and accumulation operations within one instruction cycle. Therefore, for the analysis and processing of digital signals, DSP has an absolute advantage over other processors. This article uses TI's C2000 series TMS320LF2407 chip to implement the FFT algorithm.

TMS320LF2407 fixed-point DSP is a DSP designed for industrial control, motor control and digital signal processing. It has single-cycle multiplication and addition instructions, FFT reverse indirect addressing function, and the highest running speed is 40MIPS. In order to make full use of the unique reverse indirect addressing function of DSP chip, the FFT algorithm program is written in assembly language, and the main program is written in C language, so the program has good compatibility and scalability.

TMS320LF2407 implements FFT algorithm program flow chart

The main program flow chart is shown in Figure 4. System initialization mainly completes the necessary settings of DSP system control and status registers, wait state generator control registers, interrupt registers, etc.

The sampling function of this program is: x=sin(20πt), and the sampling frequency is 640Hz.

The input data waveform is shown in Figure 5. In general, we only care about the amplitude spectrum of the signal in the frequency domain. The calculation of the amplitude spectrum |X(k)|2 is: X(k)=XR(k)+jX(k), |X(k)2|=|Xr(k)|2+|Xi(k)|2. The signal amplitude spectrum |X(k)|2 of the FFT calculation result is shown in Figure 6.


The input signal frequency is 10Hz. According to the formula f=kfs/N, f is the frequency of the original signal, k indicates the position where the peak occurs, fS is the sampling frequency, and N is the number of calculation points. From the amplitude spectrum, we can see that the peak appears at k=1, so f=1×640/64=10, which is consistent with the actual frequency of the original signal, indicating that the calculation result is correct.

3 Application of Fast Fourier Transform (FFT)

FFT is widely used in production practice and scientific research. Figure 7 shows a typical application of FFT. The following is a brief introduction to the application areas of FFT.

Typical Application Scenarios of FFT

(1) Spectrum analysis. Spectrum analysis of the main body or components of various rotating machinery, motors, machine tools, etc. under actual operating conditions can provide design data and verify design results, or find the source of earthquakes and diagnose faults to ensure the safe operation of equipment. In sonar systems, in order to find ocean surface ships or submarines, it is necessary to perform spectrum analysis on noise signals to provide useful information and determine the speed, direction, position, size, etc. of the ship.

(2) Filtering. Filtering is the most widely used application of FFT. It makes it very simple to filter the frequency components of a waveform. For example, after performing FFT on the sampled signal, removing the unnecessary frequency components and then performing inverse FFT, the desired signal after filtering is obtained.

(3) Harmonic analysis of power monitoring systems. Harmonic analysis of power monitoring systems requires FFT calculation of sampled data, which is then redrawn through an LCD screen or other human-machine interface to help technicians understand the quality of power.

4 Conclusion

Experiments have shown that this program runs well in the TMS320LF2407 fixed-point DSP, with fast speed and reliable calculation results. It can meet the requirements of accuracy and real-time in general signal processing and industrial control, and has high academic value and good application prospects. Secondly, mastering FFT and learning to think about problems in both the spatial domain and the frequency domain can often allow us to use simple methods to solve complex problems.

Keywords:TMS320LF2407 Reference address:Implementation of FFT Algorithm Based on TMS320LF2407

Previous article:Design of RS422 communication for dual DSP system of an optoelectronic tracking product
Next article:Implementation of Embedded Synchronous Controller Based on DSP and FPGA

Recommended ReadingLatest update time:2024-11-16 21:00

Analysis of ECG Monitoring System Based on TMS320LF2407A DSP
  With the development of society and the improvement of people's living standards, people pay more and more attention to health, but with the improvement of living standards, the incidence of cardiovascular diseases continues to rise. Especially in recent years, with the aggravation of social aging, cardiovascular di
[Embedded]
Analysis of ECG Monitoring System Based on TMS320LF2407A DSP
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号