introduction
The musical fountain is a combination of modern technology and art. It uses fountains to express the beauty of music, which is pleasing to the eye. At present, many units have launched their own musical fountains, which have achieved good results. However, looking at these sound control products, some use the time domain changes of music to control the fountain, and some divide the music into several frequency bands to control the flower pattern of the fountain, and most of them use low frequency, medium frequency and high frequency bands for control. The disadvantage is that none of them can show the music well in the frequency domain, so it cannot well reflect the connotation of music. In response to these problems, this design proposes a new method to control the changes of the fountain, and to show the spectrum of music in real time by the height of the fountain water column.
Overall Design
First, the audio signal is preprocessed by amplification, filtering, sampling and A/D conversion. After the DSP performs Fourier transform on the audio signal, the spectrum of the audio signal can be obtained, that is, the intensity of the sound signal corresponding to each frequency. Through the frequency conversion control system, the spectrum diagram can be expressed as a fountain water column. The height of the water column reflects the amplitude of the audio signal in a linear proportion. Assuming that the number of samples of the audio signal each time is n, the overall structure of the system is shown in Figure (1).
Figure 1 Overall design block diagram
Specific design
Introduction to Chips and Functional Modules
TLV320AIC23 (AIC23 for short) is a high-performance multimedia digital voice codec. Its internal ADC and DAC conversion modules have complete digital filters. There are 11 16-bit registers inside, and the control interface has SPI and I2C working modes. The data transmission width can be 16, 20, 24 and 32 bits, and the sampling frequency range supports from 8kHz to 96kHz. When the ADC acquisition reaches 96kHz, the noise is 90-dBA, which can save audio signals with high fidelity. When the DAC conversion reaches 96kHz, the noise is 100-dBA, which can play back high-quality digital audio.
TMS320C6713 is a high-speed digital signal processor (DSP) produced by TI. It adopts advanced very long instruction word (VLIW) structure, can execute 8 32b instructions per clock cycle, the highest clock frequency can reach 300MHz, and the minimum instruction cycle is 3.3ns. The chip has rich on-chip memory resources and a variety of on-chip peripherals. The maximum external total memory address space is 512MB, the data width is 32b, and it can support SBRAM, SDRAM, SRAM, FALSH and EPROM.
TMS320C6713 has two multi-channel buffered serial ports (McBSP), which can be easily used to complete the control and communication of AIC23.
Hardware Hookup
Connection between TMS320C6713 and TLV320AIC23
The two multi-channel buffered serial ports of TMS320C6713 are configured in I2C mode and SPI mode respectively. McBSP0 is used as the data transmission port, and McBSP1 is used as the control port to write control words to AIC23. The hardware connection diagram of TMS320C6713 and AIC23 is shown in Figure 2.
Figure 2 Hardware connection between TMS320C6713 and TLV320AIC23
Design of frequency conversion control system
The frequency conversion control system is composed of a frequency conversion controller, a frequency conversion distributor and a frequency converter. For a control system with less than 8 channels, the frequency conversion control system can adopt the control method shown in Figure 3.
Figure 3 Frequency conversion control system
The music signal processed by DSP is automatically converted into the 4~20mA DC current signal required by the frequency converter. The output DC current signal is linearly related to the input music signal, so that the height of the fountain changes with the size of the music signal.
For the control of more than 8 channels of multi-channel fountains, the requirements can be met by expanding the functions of the music fountain controller and the frequency conversion demonstrator. DSP is the control center of the frequency conversion music fountain control system, and will be expanded to 4 channels in the future, namely 4 channels, 8 channels, 12 channels, 16 channels, and so on. Each channel controls a frequency conversion speed regulator, converting the music signal into a 4~20mA DC current signal that the frequency conversion speed regulator can accept, to drive the frequency conversion speed regulator, so that the spray height of the fountain changes with the size of the music signal.
Software Implementation
Presidential Software Design
First, initialize the McBSP0 and McBSP1 ports, configure AIC23, and then start the A/D conversion of AIC23, sample the analog audio signal input by the microphone, and then perform Fourier transform on the sampled audio signal. The overall flow chart is shown in Figure 4. The formula of discrete Fourier transform (DFT) is shown in Formula 1. In order to perform fast Fourier transform, the time extraction (DIT) radix 2FFT algorithm is adopted.
Figure 4 Overall flow chart
Perform FFT transformation on the N-point audio signal. From Formula 1, we know that the corresponding frequency domain is also N points. Let the frequency corresponding to the k-th point in the frequency domain be fk, and its calculation formula is shown in Formula 2. Among them, fs is the sampling frequency of the audio signal, f'k is the normalized frequency, and the calculation formula of f'k is shown in Formula 3. Therefore, from Formula 2 and Formula 3, we can get the actual frequency value corresponding to each sampling point on the spectrum diagram.
Audio data collection
1. Sampling frequency
According to the sampling theorem, the sampling frequency should be at least twice the sampling sound frequency. Since the human ear can sense frequencies of approximately 20Hz~20kHz, in theory, the best sampling frequency is 40kHz. In practice, due to equipment reasons, the sampling frequency is generally 10% higher, that is, 44kHz. Since AIC23 supports 44.1kHz, the sampling frequency in this design is 44.1kHz.
2. Sample size
The sample size determines the difference between the lowest and highest amplitudes of the sound that can be recorded, and represents the quantization size of the sample. The intensity of the sound is proportional to the amplitude of the sound. Like the frequency, the human ear's ability to perceive the intensity of the sound is not a linear relationship, but a logarithmic relationship, which is often expressed in dB (decibel). The definition of dB is: 20log(A1/A2), A1, A2 are the two amplitudes of the sound.
When the size is 8 bits, the ratio of the maximum and minimum amplitudes of the sound is 256, then: 20log(256)=48dB, when the size is 16 bits, then the ratio of the maximum and minimum amplitudes of the sound is 65536, then: 20log(65536)=96dB. At this time, the maximum sound intensity is close to the limit of the human ear. In this design, the sample size is 16 bits.
3. Implementation of data collection
The program design steps are as follows:
a) Initialize multi-channel buffered serial ports 0 and 1.
The initialization of the multi-channel buffered serial port is completed by configuring its registers. Serial port 0 is configured in mode, and the registers of serial port 0 are configured as follows: serial port configuration control register SPCR = 0xC30003; interface control register PCR = 0x03; receiving control register RCR = 0x0140; sending control register XCR = 0x0140. Serial port 1 is configured in SPI mode, and the registers of serial port 1 are configured as follows: serial port configuration control register SPCR = 0xC51000; interface control register PCR = 0xa0a; receiving control register RCR = 0; sending control register XCR = 0x10040.
b)Configure TLV320AIC23
AIC23 has 11 16-bit registers inside. In these 16-bit control words, B[15-9] is the register address, and B[8-0] is the data to be written into the register. The values written into these 11 registers for this design are as follows: Left channel input control = 0x17; Right channel input control = 0x17; Left headphone channel control = 0x7f; Right headphone channel control = 0x7f;
c) Start the conversion, perform A/D conversion, and store the converted data in the internal memory of the DSP, using 128 points each time.
Examples
Figure 5 is the spectrum waveform of the audio signal simulated in the DSP software environment CCS2.0, and Figure 6 is the time domain waveform of the audio signal. The number of samples per time is 128, the sampling frequency is set to 44.1kHz, and the sample size is 16 bits.
Figure 5 Audio signal spectrum
Figure 6 Audio signal time domain waveform
Conclusion
This paper presents a new design of a musical fountain, and proposes a method to display the spectrum of the music signal by changing the height of the fountain water column. It uses the advantages of DSP and audio codec chips in audio signal processing and applies them well to the music fountain system. The software programming and hardware system design of the interface between TMS320C6713 and audio codecAIC23 are elaborated in detail. This solution has achieved good results when running the simulator in the Code Composer Studio (CCS2.0) environment for software and hardware joint debugging, which proves the success of the design and the feasibility of the solution. This solution can not only be used as the front-end control system design of the music fountain, but also as a model of a portable audio signal spectrum analyzer if an LCD display and some control circuits are added.
Previous article:Design of data communication between OMA-L137 and ADS1178 based on CPLD
Next article:Multi-IP Core Integration Method for Cryptographic Algorithms in Security Chips
Recommended ReadingLatest update time:2024-11-16 18:04
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
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
- In addition to the cost of electronic components, what other costs are there in hardware product development?
- Questions about the power supply of the communication system
- [Shanghai Hangxin ACM32F070 development board] The second part lights up the LCD screen and operates the touch button functions, serial port, ADC.
- EEWORLD University ---- TE Smart City
- Develop IoT in 10 minutes - Smoke sensor monitoring (Wifi version)
- Hearing aid chips
- Installation of TI C2000 Embedded Code Support Package in Matlab
- TI's AWR1243 radar learning record
- RIGOL FPGA Technology Talent Recruitment Call
- 5G system special business applications