A Design Scheme of FM Audio Spectrum Analyzer Based on MSP430

Publisher:BoldDreamerLatest update time:2014-02-26 Source: OFweek 电子工程网Keywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  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.

Keywords:MSP430 Reference address:A Design Scheme of FM Audio Spectrum Analyzer Based on MSP430

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

Design considerations for high voltage motor control systems
  In modern robot design, any movement of the head, neck, and limbs requires the support of various motors, such as traditional rotary motors, stepper motors, linear motors, and other special motors. However, the drive and control requirements of these motors are different. How to achieve precise control solutions for
[Microcontroller]
Design considerations for high voltage motor control systems
Highly robust broken glass detector solution based on low-cost single-chip microprocessor
     introduction      A broken glass detector (GBD) is mainly used to detect broken glass in doors and windows of residential homes or commercial buildings. GBD can also be classified as a monitoring device to improve the security of home or commercial environments and prevent illegal entry. GBD can work independent
[Microcontroller]
Highly robust broken glass detector solution based on low-cost single-chip microprocessor
Research on WDT in MSP430 microcontroller
Introduction   Software reliability has always been a critical issue. Anyone who uses software may experience the problem of a computer freezing or a program running away, and this situation also exists in embedded systems. Due to the limited anti-interference ability of microcontrollers, instrumentation at industrial
[Microcontroller]
AD9850 Driver--MSP430 Version
I was busy drawing boards, working on op amps and filtering some time ago, and rarely updated the program. I found that MSP430 was not very easy to use, especially the Timer. However, it was also related to my use of an internal crystal oscillator. Before generating a sine wave, it was too troublesome to use MSP430 to
[Microcontroller]
How to use C language to write high-quality code for MSP430
Microprocessors are generally used in specific environments and for specific purposes. Considering cost, power consumption and size, they are generally required to save resources as much as possible. In addition, since microprocessor hardware generally does not support operations on signed numbers and floating-point nu
[Microcontroller]
Development of intracranial hemorrhage detection equipment based on MSP430
1 Introduction In China, there are many patients with traumatic craniocerebral injury who are in urgent need of emergency treatment. However, a considerable number of patients with intracranial hemorrhage have delayed the rescue and treatment due to the failure to make timely diagnosis. As a result, brain h
[Medical Electronics]
Development of intracranial hemorrhage detection equipment based on MSP430
Design of intelligent remote control based on ultra-low power single chip MSP430F413
introduction At present, most of the common wireless remote controls on the market are four-key and twelve-key, mainly used in car anti-theft systems, home anti-theft systems and remote control toys. These applications are simple, practical and low-cost. However, for some projects that require a distance of mor
[Microcontroller]
Design of intelligent remote control based on ultra-low power single chip MSP430F413
Two wake-up methods for MSP430 power saving mode
1 Introduction to MSP430 power saving mode MSP430 is famous for its low power consumption. It can connect two external clock sources - XIN and XT2IN. There is also an internal DC0 oscillator, which can generate an internal clock of up to 8 MHz. Generally, the frequency of XT2IN is high frequency, which is selected a
[Microcontroller]
Two wake-up methods for MSP430 power saving mode
Latest Power Management 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号