Implementation and Application of FFT Algorithm Based on TMS320LF2407

Publisher:HeavenlyMelodyLatest update time:2009-09-27 Source: 电子技术 Keywords:TMS320LF2407 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

Fourier transform is a form of transformation that transforms a signal from the time domain to the frequency domain. It is a method often used to analyze signals in digital signal processing. Some characteristics of a signal are not always obvious in the time domain. By transforming it to the frequency domain through the Fourier algorithm, its characteristics become clear at a glance. For example, interference from the power supply system is always difficult to identify in the time domain, but discrete harmonics of 50 to 60 Hz can be clearly seen in the frequency domain.

In computer systems, data is actually processed in the form of discrete Fourier transform (DFT). Since DFT has a large amount of computation and is not suitable for embedded control systems, the fast algorithm of DFT, fast Fourier transform (FFT), is often used in practical applications. Although FFT has much less computation than DFT, it is still difficult to implement FFT multi-point and real-time operations using ordinary single-chip microcomputers. DSP (digital signal processor) has the characteristics of fast computing speed and high precision, which just meets the requirements of FFT and can solve this problem well.

1 Principle of Fast Fourier Transform

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

formula

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:

formula

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-point DFTs, they can be decomposed into 2-point DFTs, so that the amount of calculation 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.

FFT and DFT - the relationship between the amount of calculation required and the number of calculation points

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

formula

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

formula

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:

formula

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.

Butterfly Operation

8-point FFT decomposition process

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.

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.

Main program flow chart

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.

Input data waveform

The signal amplitude spectrum of the FFT calculation result |X

The input signal frequency is 10Hz. According to the formula f=kfs/N, f is the frequency of the original signal, k represents 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 and Application of FFT Algorithm Based on TMS320LF2407

Previous article:Multi-IP Core Integration Method for Cryptographic Algorithms in Security Chips
Next article:Research and design of intrusion detection system based on data mining technology

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

Design of Multi-channel Data Acquisition System Based on DSP and CPLD
Embedded systems used in real-time control systems often need to measure analog quantities. The usual method is to use MCU to generate acquisition control timing to control the analog-to-digital converter, and read the converted results through interrupts or queries. The acquisition control timing generated by MCU w
[Industrial Control]
Design of Multi-channel Data Acquisition System Based on DSP and CPLD
Fixed-point DSP chip TMS320F2812 realizes fast algorithm application
  1 Introduction to TMS320F2812   TMS320F2812 is a high-performance, multi-functional, cost-effective 32-bit fixed-point DSP chip for control from TI. The chip is compatible with the TMS320LF2407 instruction system and can work at a maximum frequency of 150MHz. It has 18k×16-bit 0-wait cycle on-chip SRAM and 128k×16
[Embedded]
Fixed-point DSP chip TMS320F2812 realizes fast algorithm application
DSP Design Based on LabVIEW
  1 Introduction   LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is an innovative software product of NI Corporation of the United States. It is also the most widely used, fastest growing and most powerful graphical software development environment. LabVIEW DSP module, which includes system tools for d
[Test Measurement]
DSP Design Based on LabVIEW
Design of a Fingerprint Recognition System Based on DSP and USB
  Universal Serial Bus (USB) is a new interface technology. It is a serial communication standard developed by Intel, Microsoft and other companies to solve the contradiction between the increasing number of peripherals and the limited motherboard slots and ports. USB has the following characteristics: (1) It has a hi
[Embedded]
Design of a Fingerprint Recognition System Based on DSP and USB
Comparison of FPGA, ARM, and DSP in digital signal processing architecture
Compare the advantages of FPGA, ARM, and DSP from the perspective of digital signal processing architecture, develop fixed-point Deep Recurrent neural networks using Theano, Python, PYNQ, and Zynq, and implement Linux UIO design on Zynq UltraScale+ MPSoC. Video Image Acquisition System Based on Xilinx FPGA Programma
[Microcontroller]
Comparison of FPGA, ARM, and DSP in digital signal processing architecture
Design of single-phase photovoltaic grid-connected control system based on DSP
Energy shortage and environmental pollution worldwide have become two major factors restricting the sustainable development of human society. It has become a top priority to vigorously develop new alternative energy sources. As a new way of producing electricity, solar power generation has shown an extremely broad d
[Power Management]
Design of single-phase photovoltaic grid-connected control system based on DSP
Multi-channel synchronous sampling of power system based on DSP and high-speed AD
Abstract: This paper introduces a system structure that uses DSP chip TMS320C6711D as the processing core and high-speed A/D chip ADS8364 to realize multi-channel synchronous sampling and analysis of power system. The hardware design of the system is introduced in detail. Through testing and use, it is shown that
[Embedded]
Multi-channel synchronous sampling of power system based on DSP and high-speed AD
In-depth analysis of DSP electromagnetic compatibility issues
   1 Introduction Since the first digital signal processor (DSP) chip came out   in the early 1980s , DSP has brought great opportunities for the development of digital signal processing with its unique stability, repeatability, large-scale integration, especially programmability and easy adaptive processing, and h
[Embedded]
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号