0 Introduction
Due to the high cost-effectiveness of single-chip microcomputers, they are often used to replace DSP chips in data acquisition and spectrum analysis systems. In digital signal processing, discrete Fourier transform (DFT) is a commonly used transformation method, which plays an important role in various digital signal processing systems. Fast Fourier transform (FFT) is not another transformation different from discrete Fourier transform, but a fast and effective algorithm to reduce the number of DFT calculations, and they are both for transforming signals into the frequency domain and performing corresponding spectrum analysis. Although FFT is a fast calculation method, it still requires Nlog2N additions and 0.5Nlog2N multiplications to calculate the FFT of N points. When N is relatively large, its computational complexity also requires a lot of RAM. In this article, we will explore how to optimize the FFT algorithm and implement it in a single-chip microcomputer.
Although there are good chips to solve the problems of FFT operation speed and RAM capacity, the cost of single-chip microcomputer is relatively low. Therefore, it is of practical significance to discuss the implementation of FFT algorithm in single-chip microcomputer. Finally, this paper also gives the application of FFT in radar detection by single-chip microcomputer.
1 Radix 2 FFT algorithm
The output of FFT is consistent with that of DFT, but the redundant calculations have been subtracted in FFT, making it faster. For an N-point Fourier transform, the computational complexity required by DFT is N2, while the computational complexity required by FFT is N/2log2N. Therefore, when N is relatively large, using FFT for Fourier transform will greatly reduce the amount of calculation. For example, a 64-point DFT requires a computational complexity of 4096, while using FFT only requires a computational complexity of 192. In a single-chip microcomputer, when other optimization methods are used, FFT calculations take less time.
In this article, when using FFT, we are concerned with reducing the temporary memory space required to store intermediate data. When performing an FFT, the input and output data are stored in bit-reversed order. When changing between sequential and reversed order, each data point swaps with another data point in the data set by reversing the order of the sample series. For example, in a 16-point FFT, the sample stored at address 001 b will be swapped with the sample stored at position 100 b. Positions with reversed bytes are equal to positions without reversed bytes, such as 0110 b, which do not swap. The order in which the FFT is calculated is determined by whether the input or output of the FFT needs to be stored in reversed order.
2 Windowing the input data
The FFT transform can be applied to data with a finite length of time, but an assumption is made about the data set: it is periodic and repeats infinitely. When the sample data repeats in this way, the last sample (subscript [N-1]) is immediately followed by the first sample ([0]) in the next period. As shown in Figure 1, when the data is not periodic throughout the sample set, discontinuities will result when the FFT is performed on the entire sample. Because of this, the data usually needs to be windowed before the FFT transform. Windowing makes the sample set periodic and removes the discontinuity between the first sample and the last sample. Since windowing changes the input data, it will produce some noise in the frequency domain. Windowing will stretch the energy of the signal to several points. The energy distribution will weaken the peak of the signal. Most of the original content of the signal is stored in the main part. When a part leaks side lobes (as shown in Figure 2), the width of the main part and the height of the side lobes are determined by the windowing algorithm applied to the signal. Some window functions and their performance are shown in Table 1. Some equations for calculating the coefficients of the windowing function for the N-point FFT are shown in Table 2. For more information about windowing algorithms and their parameters, see [2].
3 FFT Optimization
There are many methods for optimizing FFT. The purpose of these optimization methods is to increase the calculation speed and reduce the RAM required to store data as much as possible.
As we all know, an important method for calculating FFT is the butterfly method. But each iteration of the butterfly calculation requires a complex multiplication (a total of four long integer multiplications). Long integer multiplications require a lot of processing memory to complete. But if we look closely, we will find that some of the multiplications are not needed and can be omitted. In particular, when the multiplier is zero, the result will be zero and when the multiplier is 1, the result of the multiplication will remain unchanged. The code that queries whether the sine and cosine functions are 0 or 1 can take advantage of these advantages to reduce the amount of calculation. The amount of calculation that can be saved by this optimization method is: where N is the number of points in the FFT.
4 Overall Program Design
The head is divided into three modules. That is, data acquisition module, A/D conversion module and FFT operation module. The data acquisition module mainly controls the sampling period of the A/D converter through the timer, converts the collected data into signed numbers, and can be stored in complex form. The FFT operation module runs a 256-point FFT on the data memory of the 8051 microcontroller, and calculates the amplitude or decibel representation value corresponding to 128 frequency points through a fast square root or fast logarithm operation. The specific process is shown in Figure 3.
5 Application in Telephone Video
In a meeting, when the speaker changes, we need the camera to automatically track and detect the speaker's position, which requires the use of FFT and its inverse transform to calculate the angle.
6 Conclusion
This article mainly introduces an optimization method for implementing FFT algorithm in single chip microcomputer, which can greatly reduce the amount of FFT calculation and the RAM required to store data. Therefore, it can be applied in telephone video conferencing.
Previous article:Design and implementation of reverse collision warning system based on single chip microcomputer
Next article:Clock synchronization technology between C8051F120 and RS422 information line
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- How to completely shut down Pmos
- Problems with the Linux development board
- Today at 10:00 am, Keysight Technologies' award-winning live broadcast begins | Evolution and updates of signal integrity testing
- Proteus simulation implementation of simple single-chip calculator
- 【GD32L233C-START Review】 Second Development Board Function Review
- Technologies such as RFID enhance the security of smart IoT
- I2C Pressure Sensor
- Differences between CPU and CLA in C28x+FPU architecture and error handling techniques
- The drilling marks are clear, why is there a hole missing on the PCB?
- Prize-winning quiz | TE "New Energy Application Solutions White Paper"