1. Introduction
In actual radio and television transmission work, the entry test of new transmitters and the daily indicator test of transmitters all involve audio testing. The audio spectrum analyzer designed in this article measures the spectrum of audio signals from the perspective of signal source, thereby determining the size of each frequency component and providing a reference for various audio indicators of FM radio.
In this paper, the design of an audio spectrum analyzer based on the MSP430 processor is proposed. Guided by the relevant theoretical knowledge of digital signal processing , the advantages of the MSP430 processor are used to design and improve the audio spectrum, and finally the display is realized on the TFT LCD HD66772.
2. Spectrum Analyzer Design Principle
Since the data processed in the digital system are obtained through sampling, the obtained data must be discrete. For discrete data, discrete Fourier transform is applied for processing.
Fast Fourier transform is a fast algorithm for discrete Fourier transform. It can also be used to calculate the inverse transform of discrete Fourier transform. It has been widely used in digital spectrum analyzers. For a complex sequence of length N 0 1 1 , , , N ? xx L x , the discrete Fourier transform formula is:
Therefore, the operation of a sequence is decomposed into the form of the sum of two operations, ( ) 1 X k and ( ) 2 X k. The decomposition can be continued and finally decomposed into two-point FFT operations. If you want the output after the FFT operation to be arranged in natural order, the input sequence needs to be arranged in reverse order.
Figure 1 is a diagram of the operation of an 8-point FFT.
After FFT operation, a time domain signal can be transformed into frequency domain. Some signals are difficult to see any characteristics in the time domain, but if they are transformed into the frequency domain, it is easy to see the characteristics. This is the general principle of spectrum analyzer. 3. Design and implementation of spectrum analyzer
This article introduces a design of a digital audio spectrum analyzer based on FFT. The audio signal is sampled by ADC. After the ADC sampling is completed, the data is arranged in reverse order and FFT operation is performed. The result is displayed on TFT LCD. The block diagram of the system is shown in Figure 2.
3.1 Audio Spectrum Analyzer Hardware Implementation
In order to realize the system function, a 16-bit processor MSP430 is used to efficiently process the input data stream. MSP430 has its own ADC12 module. The sampling data of ADC12 is calculated and the spectrum is displayed through a 65K color LCD. The hardware system diagram of this system is shown in Figure 3.
The power module provides power for the entire system. The system can also respond to user key events and perform corresponding processing. The serial port module is reserved for system expansion.
3.2 System Software Design of Audio Spectrum Analyzer
After the system is powered on, the system is first initialized System_Init() to initialize the watchdog, system clock, timer, I/O port, ADC and other modules. Next, ADC12 samples the continuous analog signal to obtain a discrete digital signal, which is read by the processor and processed accordingly. If the sampling frequency is too high and the number of sampling points is too large, a large amount of valuable processor memory will be occupied and the data processing speed will be reduced; if the sampling frequency is too low, the sampled data will be distorted and the original continuous signal cannot be restored. Therefore, the sampling frequency must be set according to the frequency range of the signal, and at the same time, the requirements of the sampling theorem must be met.
When the sampling frequency is constant, increasing the number of sampling points can improve the frequency resolution, but the data storage space and the amount of calculation will also increase accordingly. Generally, the number of sampling points can be selected according to actual needs, usually set to an integer power of 2 to facilitate subsequent FFT spectrum analysis. The number of sampling points in this system is N=16. The ADC12 sampling flow chart is shown in Figure 4.
The FFT data processing after sampling is another key and difficult point of the system. On the one hand, in order to obtain the forward FFT, the code bits of the original natural sequence need to be arranged in reverse order; on the other hand, in order to reduce the floating-point operation time of the processor, the rotation factor kN W is calculated by table lookup. Figure 5 is a reverse order flowchart of FFT operation.
If the cosine and sine are calculated in advance as global variables, the calculated kN W can be directly called for addition and subtraction, which reduces a lot of floating point operation time and obtains fast system response at the cost of sacrificing a little memory. Table 1 is the cosine and sine table compiled when N=16.
Figure 6 shows the flow chart of FFT operation. The whole FFT program is contained in an iterative process. The last layer of calculation is always 2-FFT butterfly operation. The following is the main program segment of butterfly operation and FFT calculation:
After the data is processed by FFT, the last step is to display the data intuitively. Here we use TFT LCD HD66772.
Combined with the operation timing diagram of HD66772, the reading and writing of the LCD can be programmed by using instructions to read and write. The connection between MSP430F149 and the LCD HD66772 module is divided into a control bus and a data bus. To correctly display information on the LCD screen, two basic operations must be performed on the LCD: first, write the instruction code; second, write the display data. 4. System debugging and operation
Because the main clock of MSP430F149 uses 8MHz crystal oscillator, although the execution time of a single instruction of the system is only 0.125μs, the actual refresh frequency of the LCD is lower than 25Hz due to the influence of FFT operation, ADC12 sampling frequency and LCD writing time, which produces a serious flickering feeling. In order to increase the refresh frequency, the solid bar graph is changed to hollow lines, and a solid line is written every two hollow thin lines. In this way, the writing time of the LCD is reduced by 2/3, which can ensure the accuracy of the displayed results without sacrificing the system's writing time to the GRAM of the HD66772 LCD. The problem of signal flickering is solved. Figure 7 is the spectrum diagram of the TFT LCD display after the audio signal is input.
Figure 7 divides the input audio signal of 30Hz-15KHz into 16 equal parts in the frequency domain, and each column represents a frequency bandwidth of 1KHz. From the figure, we can see that the energy of general audio signals is concentrated in the low frequency band, and the audio energy becomes weaker and weaker as the frequency increases. This is why FM radio uses weighted technology to improve the signal-to-noise ratio.
4. Conclusion
This solution samples the input audio signal through ADC. After ADC sampling is completed, the data is arranged in reverse order and FFT operation is performed, and the result is displayed through TFT LCD. Due to the processing power of the processor used, it is not possible to achieve a very high sampling frequency and a very fine frequency resolution. To improve the frequency resolution of the system, it is necessary to increase the number of sampling points. With the help of the powerful processing power of the PC, the sampled data can be transmitted to the PC through the reserved serial port, and the FFT operation and display can be completed on the PC. This is the way of virtual instrument, and the application prospect in actual work is also very large.
Previous article:Design of ARM matrix keyboard and its linux driver implementation
Next article:Summary of Common IGBT and MOSFET Device Isolation Drive Technologies
Recommended ReadingLatest update time:2024-11-16 16:47
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- oled multi-chip calling program
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- SparkRoad Review (7) - FPGA Serial Port Test
- Disable AD auto-start JLink
- Seeking guidance - stc microcontroller remote upgrade program
- Problems with creating sheet symbols for multi-page schematics
- Zigbee Z-Stack 3.0.1 Modify channels using broadcasting
- SHT31 Review + My Review Summary
- Using AT89S series microcontroller
- 【McQueen Trial】Use IPAD to program McQueen's car
- The STM32 FFT library calculates the amplitude normally, but the phase is different each time. Has anyone encountered this problem?
- EEWORLD University----UCD3138 Analog Front End (AFE) Module