In recent years, the rapid development of electronic technology has enabled embedded systems to be used in more and more fields. The functions of embedded system platforms are becoming more and more powerful, and the complexity is also increasing. At the same time, the difficulty and requirements of their development are also increasing. In the development process, application software and system software need to be considered as a whole, and the connection between software and hardware is also closer. Therefore, the development of embedded systems is a complex process. With the substantial improvement of embedded system performance, old-fashioned GPS navigators have begun to develop in the direction of embedded. Embedded GPs navigators have become more and more portable and more powerful. Voice navigation and media functions have become a prominent highlight of embedded GPS navigators. Therefore, MP3 audio decoding and playback technology has now become a basic technology in embedded GPS navigation systems. The full name of MP3 is MPEG Audio Layer 3, which is a popular audio coding scheme. It is part of the MPEG-1 standard formulated in 1992. The MPEG standard consists of three parts: system, video and audio. Among them, the audio standard is divided into three layers. MP3, as the third layer, is the layer with the highest computational complexity and the best compression effect. Compared with the traditional CD format, its sound quality is almost the same, but the data volume is less than one tenth of that of the CD. At the same time, the portability and battery life of MP3 players are greatly improved compared with CDs. MP3 was originally used in digital audio broadcasting and digital TV accompaniment, etc. Later, as its popularity increased, it began to be widely used in other occasions, especially Internet music and portable entertainment devices; now, almost all portable voice navigation devices use MP3 as their audio media format. This article mainly introduces the decoding technology of MP3 audio files under the embedded GPS navigation system platform based on the ARM core. In order to use the self-designed solution to use the Samsung S3C2410 platform under the Windows CE. NET system, the decoding and playback functions of MP3 can be realized.
1 MP3 decoding principle
1.1 MP3 file format
MP3 files are composed of different numbers of independent frames, each containing 1152 samples. Each MP3 frame contains four parts: frame header, error check, audio data and auxiliary data. Figure 1 shows the MP3 frame structure. The last 128 bytes of an MP3 file usually contain an ID3v1 tag and additional user-customized file content, such as song name, singer, style description, etc.
1.2 MP3 decoding process
The original PCM (Pulse Code Modulation) audio data will be compressed and encoded to obtain an MP3 code stream. MP3 decoding is to restore the MP3 code stream to the original PCM data. MP3 data is in frames. Decoding should first find the position of the MP3 frame in the code stream based on the synchronization information and error check CRC module, and then determine the location of the frame header, CRC check, audio data and auxiliary data.
Figure 2 shows the MP3 decoding process, which mainly includes Huffman decoding, inverse quantization, inverse reordering, stereo decoding, aliasing elimination, IMDCT, frequency inversion compensation, sub-band synthesis filtering, etc. The role of the preprocessing in Figure 2 is to read the header data and store the required information in a structure for subsequent decoding. [page]
During Huffman decoding, the MP3 audio data will be divided into two sections (gxanule). These two sections are relatively independent during the encoding and decoding process. Each section can decode 576 PCM sample data, and the two sections can decode 1152 sample data. The first step to get the information we need from the binary 101... code stream is to decode the Huffman code. Decoding the Huffman code is a table lookup process. These 576 values represent the values on 576 frequency lines, which have different meanings in different blocks (such as). The corresponding code table can be searched according to different scale factors and frequency bands to decode 576 values.
The inverse quantization process uses different inverse quantization formulas for long blocks, short blocks, and mixed blocks based on the inverse quantization formula and frame edge information to restore the true values of 576 frequency lines. The purpose of inverse reordering is to allow the MP3 encoder to make Huffman coding more efficient by reordering certain blocks. The function of the stereo decoding part is to perform stereo decoding when the two audio channels are not encoded independently.
Aliasing elimination is performed during the decoding process to avoid aliasing between two adjacent sub-bands. The function of IMDCT is to first perform an 18-point to 36-point IMDCT transform on long blocks and a 3G-point to 12-point IMDCT transform on short blocks; secondly, different window types are used for windowing according to different block types. At the same time, the first half of these 36 values is superimposed with the second half of the previous frame. The second half of the current block is stored for superposition with the next block. Frequency inversion compensation is the frequency inversion compensation performed on the multi-filter group before entering the next step, that is, the odd time samples of the odd sub-band are inverted.
Subband synthesis filtering is to inversely transform the frequency domain signals within 32 equal frequency bandwidths into time domain signals, and then perform windowing operations to obtain 32 PCM values.
2 Hardware Design
2.1 System Hardware Design
In terms of processor selection, this system uses S3C2410 from SAMSUNG. It is a 16/32-bit reduced instruction set microcontroller based on the ARM920T core, and is a low-cost, high-efficiency microcontroller for handheld devices and general-purpose devices. The S3C2410 ARM chip is mainly used in the design of the entire system hardware, the storage device is an external SD or MMC memory card module, and an external 320x240 pixel true color TFT LCD screen is used for display. The control adopts a four-wire resistive touch screen and is supplemented by a GPIO external keyboard.
2.2 Audio Hardware Design
IIS (Inter-IC Sound) bus is a serial digital audio bus protocol proposed by Philips. It is an audio bus for multimedia applications, dedicated to data transmission between audio devices, that is, transmitting PCM audio data to a standard codec (CODEC). IIS bus only processes sound data, and other signals (such as control signals) must be transmitted separately. In order to minimize the number of pins of the circuit, IIS only uses three serial buses, namely the data line that provides time-division multiplexing function, the left and right channel selection line, and the clock signal line.
The CODEC chip is mainly responsible for the conversion between analog and digital signals. For this system, we are more concerned about converting digital PCM signals into analog signals, mainly sending the audio digital signal of the file to be played to the CODEC chip through the IIS of SC2410, and then converting it into an analog signal, and then outputting it through devices such as speakers or headphones.
According to the sampling theorem, the sampling frequency must be at least twice the signal frequency, and the IIS interface standard must be supported, because this system transmits data to the CODEC chip through the IIS bus. The CODEC of this system uses Philips' U-DA1341, which is powered by 3.0 V voltage and supplies power to the ADC and DAC respectively. The system clock frequency can be selected from 256fs, 348fs and 512fs, and the sampling frequency ranges from 16 kHz to 48 kHz. Because it uses digital sound quality control, it has a heavy bass effect and supports the IIS bus, which can ensure high-fidelity stereo output. Figure 3 shows the working principle block diagram of UDA1341.
The hardware design of the entire audio system is mainly the connection and implementation of the IIS bus interface and CODEC of S3C2410. The specific circuit is shown in Figure 4. This system uses the Philips UDA1341 audio CODEC chip based on the IIS audio bus. The CODEC supports the IIS bus data format and uses bit stream conversion technology for signal processing. It has a programmable gain amplifier (PGA) and a digital automatic gain controller (AGC).
S3C2410 has built-in IIS bus interface, which can directly connect to 8/16-bit stereo CODEC. It can also provide DMA transmission mode instead of interrupt mode for FIFO channel, so that data can be sent and received at the same time. The IIS interface has three working modes, which can be selected by setting the CON register of IIS. The hardware framework introduced in this article is mainly based on transmission and reception mode. In this mode, the IIS data line will receive and send audio data simultaneously through dual-channel DMA, and its DMA service request can be automatically completed by the FIFO read-only register.
In Figure 4, the IIS bus signal of S3C2410 is directly connected to the IIS signal of UDA1341, and the L3 interface pins L3MODE, L3CLOCK and L3DATA are respectively connected to the three general data output pins GP-B1, GPB2 and GPB3 of S3-C2410. U-DA1341 can provide two groups of audio signal input interfaces, each group includes 2 left and right channels.
3 Software Design
3.1 System platform selection
The current mainstream embedded platforms mainly include two series: Embedded Linux and Windows CE.
Linux is an operating system similar to Unix. It originated from an amateur named Linus Torvalds in Finland, but now it has become the most popular open source free operating system. Since its launch in 1991, Linux has developed into a powerful and well-designed operating system. Developed along with the advancement of network technology, Linux OS has become a strong rival to Microsoft's Windows system. The Linux system can not only run on PC platforms, but also shine in embedded systems. Many embedded platforms use Linux as their operating system. [page]
Windows CE is an open, scalable, 32-bit embedded real-time operating system developed by Microsoft. The C in CE stands for Compact, Consumer, Connectivity, and Companion; the E stands for Electronics. Unlike the desktop-oriented Windows, Microsoft rewrote the kernel of Windows CE, which gives Windows CE superior real-time performance. The API in Windows CE is a reduced WIN32 API, which is a subset of the desktop Windows system. This allows many applications developed based on Microsoft's desktop Windows to be used in Windows CE with a few changes. At the same time, on the Windows CE system platform, you can also use the programming tool language on the desktop Windows (such as VB, VC++, etc.), and use the same functions and the same interface style. Therefore, its development work is relatively easy to get started. Considering the habit of most users using the Windows series operating system for many years, the interface style of Windows CE is easier for users to accept.
In summary, this paper selects Windows CE as the system development platform and the VS series EVC as the development tool.
3.2 Software Process
Figure 5 is a software flow chart of MP3 decoding. First, read the MP3 file data into the buffer, find the ID3 information in the file (ID3 information refers to an optional embedded information in the MP3 file, used to indicate the audio type, author, etc. of the MP3, currently divided into two versions: ID3v1 and ID3v2), then find the frame synchronization header in the file, and enter the frame decoding subroutine after finding it. The specific process of frame decoding is shown in Figure 6. After decoding is completed, the decoded PCM data is put into the audio buffer for playback, and this cycle continues until the last frame.
The key coding circuit uses a diode combination logic switch array to address the controlled circuit switch, and the instruction coding circuit uses the coding chip set PT2262. Port A of PT2262 is the address code setting port, and port D is the data code setting end, which are respectively connected to the logic output of the diode combination logic switch array. The data has 6 states from 000 to 101. The RF chip used in the transmitter module circuit is MICRF1020. When there is no signal output at the data output end of the encoding chip PT2262, MICRF102 does not work and the transmission current is zero. When the control end of PT2262 is valid, the output serial pulse signal modulates and transmits MICRF102. The transmission current can be adjusted by the modulation resistor R2, thereby adjusting the transmission distance. A smaller R2 value can increase the transmission distance, and adding a diode switch array can expand the system into a multi-channel remote control transmission module.
3.2 Receiving control circuit
The receiving control system is mainly composed of a radio receiving circuit, a decoding circuit, a single-chip microcomputer circuit, and a switch circuit. The circuit schematic diagram of the receiving control system is shown in Figure 6. The main function of the receiving control system is to demodulate and decode the received signal, and send the decoded data to the single-chip microcomputer, which controls the corresponding switch to act according to the data.
4 Conclusion
This paper proposes a solution to realize MP3 audio playback in embedded GPS voice navigation system, gives the decoding steps, and completes this solution using S3C2410 core and Windows CE platform. After actual product verification, the decoder has good playback effect. All indicators can meet the requirements.
Previous article:The relationship between the ARM processor CPSR flag and the conditional
Next article:About the keyboard and VFD display interface technology of ARM7
Recommended ReadingLatest update time:2024-11-16 21:21
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!
- 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
- Fast Fourier Transform of Convolution and Correlation of Discrete Sequences
- Which textbook on switching power supplies is better?
- How to understand the entire LCD scanning cycle?
- ADC Sequencer Working Mode of DSP2812
- Challenge FreeRTOS learning + stm32 to implement shell tasks
- China Chip Recruitment. Listed on Shanghai Science and Technology Innovation Board, focusing on the research and development of IoT wireless communication chips and solutions. Salary open + stock
- FPGA Design of High-Speed Data Acquisition System
- mRNA vaccine badge
- TI - MCU - MSP430 User Guide 5 -> ICC Interrupt Controller
- Generate compensation ramp