Decoding and playing of MP3 in embedded GPS voice navigation system

Publisher:Meiren520Latest update time:2012-12-08 Source: 维库开发网Keywords:GPS Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

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.

Keywords:GPS Reference address:Decoding and playing of MP3 in embedded GPS voice navigation system

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

Design and implementation of GPS vehicle terminal based on single chip microcomputer
The command and dispatch of police vehicles, the monitoring and safety dispatch of cash transport vehicles, the operation and management of taxis and reasonable dispatch have become increasingly important issues in the public security, banking and public transportation systems. The emergence of GPS global positionin
[Microcontroller]
Design and implementation of GPS vehicle terminal based on single chip microcomputer
Design of GPS positioning system based on MAX3100 and OLED
0 Introduction In the single-chip microcomputer application system, serial data communication usually uses the chip "8251", but because the communication baud rate of 8251 is not high, it cannot be used in the system with high crystal oscillator. This makes it impossible to use the 8251 chip to send and rec
[Security Electronics]
Design of GPS positioning system based on MAX3100 and OLED
Design of Low Noise Amplifier for GPS Receiver
Low noise amplifier (LNA) is widely used in fields such as radio astronomy, satellite reception, radar communication, etc., where the receiver sensitivity is high. Its main function is to amplify the weak signal received, reduce noise, and enable the system to demodulate the required information data. As an importan
[Analog Electronics]
Patriot GPS+Handheld Digital TV Product Solution
The first company in China to successfully develop MP5 using Freescale MX31 ARM11. The first product solution in China to support RM/RMVB network video. 1 GPS+digital TV (DVB-T or terrestrial national standard DMB-TH) product solution picture 2 The functions of GPS + digital TV (DVB-T or terre
[Analog Electronics]
Design and implementation of USB MP3 based on AVR microcontroller
  With the development of electronic technology, MP3 players are developing towards large capacity and miniaturization. However, the integrated design of the player and the memory makes it difficult to expand the capacity of MP3 to accommodate more songs. Separating the player from the memory is another direction of M
[Microcontroller]
Design and implementation of USB MP3 based on AVR microcontroller
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号