Design of digital audio equalizer based on DSP

Publisher:来来去去来来Latest update time:2012-07-02 Source: 现代电子技术 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract Audio equalizer is one of the important tools for adjusting the timbre in audio system. This paper proposes a design of digital audio equalizer based on ADSP-BF533 hardware platform, and its audio processing algorithm includes spectrum analysis and equalization algorithm. Tests show that the system can achieve ideal audio equalization effect, and users can select and customize various sound effects.
Keywords Audio equalizer; Spectrum analysis; ADSP-BF533

Equalizer is an electronic device that can adjust the amplification of various frequency components of electrical signals respectively. By adjusting the parameters of the audio equalizer, the defects of the speaker and the sound field can be compensated, and it plays a role in compensating and modifying various sound sources. The
analog inductor audio equalizer constructed by discrete devices and operational amplifiers has many unfavorable factors due to the influence of the performance of the discrete devices themselves, which makes the audio equalizer at a disadvantage in the competition. This paper proposes a method for designing a digital audio equalizer on the ADSP-BF533 hardware system. The spectrum analysis algorithm uses FFT, and its program design can call the real-time signal processing library function of DSP. The design algorithm of the equalizer adopts the design method of FIR filter. FIR filter has a strict linear phase, and the equalized audio will not produce phase distortion. The system has great advantages over analog audio equalizers, with flexible design, high calculation accuracy, fast processing speed, and meets the requirements of real-time signal processing.

1 Hardware Design of Digital Audio Equalizer
The hardware platform uses ADSP-BF533 (DSP) as the digital signal processing core, AD1836A as the audio acquisition and playback unit, and LCD display module and buttons to realize human-interface interaction. The system principle is shown in Figure 1.

a.JPG


The analog audio signal is converted to digital by AD1836A, and then digitally equalized by DSP before being sent to AD1836A for digital-to-analog conversion to achieve audio signal equalization. Users can change the software processing flow or parameters in DSP through LCD display module and buttons to complete the control of digital audio equalizer.
1.1 Main processor ADSP-BF533
ADSP-BF533 processor is a member of ADSP Blackfin series. Its structure adopts Micro Signal Architecture and has a simple RISC instruction set structure. The internal instruction processing adopts pipeline technology, and integrates multiplication and accumulation unit (MAC) and arithmetic logic unit (ALU). Its highest core frequency can reach 600 MHz.
BF533 integrates a wealth of peripheral interfaces. In the digital audio equalizer, SPORT0 is used to complete the data transmission of digital audio, SPI is used to configure the working mode of AD1836A, and the programmable flag (PF) is used to connect with LCD and buttons.
1.2 Audio Encoder AD1836A
AD1836A is a high-performance single-chip encoder that can provide 3 stereo DACs and 2 stereo ADCs. DSP configures AD1836A with a sampling rate of 48 kHz and a data word width of 24 bits through SPI, and transmits data through SPORT and AD1836A. Its serial data port can use the popular I2S serial mode.
1.3 LCD Display Module Design
LCD uses MSP-G240128DYSY dot matrix liquid crystal display module. The drive control system of this liquid crystal display module consists of liquid crystal display controller T6963C and its peripheral circuits, row driver group, column driver group and liquid crystal drive bias voltage circuit. BF533 realizes the reading and writing of T6963C 8-bit data bus and control line through PF interface. Among them, PF0~PF7 are used as data lines, and PF12~PF14 are used as control lines. Figure 2 shows the interface mode between BF533 and LCD.

b.JPG



2 Software Design of Digital Audio Equalizer
The software flow is shown in Figure 3. First, a series of initializations are performed on BF533 to set the system in a certain working state. After the initialization is completed, the user controls the audio signal processing by selecting the menu items on the LCD through the buttons.

c.JPG


2.1 Spectral analysis algorithm of audio signal
Adding spectral analysis to audio signal processing can more intuitively see the gain adjustment effect on different frequency bands, which facilitates adjustment and analysis. The spectrum characteristic curve can be obtained by discrete Fourier transform, as shown in formula (1).
d.JPG
In the formula, x(n) is the audio signal sampling sequence; e.JPG is the rotation factor; N is the DFT transformation interval length; X(k) can be used to describe the spectrum of its audio signal.
In actual operation, AD1836A sends 4 24-bit sampling data to the SPORT0 receiving buffer through SPORT0 each time, and generates a receiving interrupt. The received data in the interrupt service program is sent to the set buffer. When the receiving counter reaches N, the sampling data is FFT-ed, and the calculated amplitude-frequency characteristic curve is displayed in real time on the LCD. [page]

2.2 Equalizer algorithm for audio signals
The function of the equalizer is to boost or attenuate a certain frequency component of the signal. The equalizer that only adjusts the low-frequency or high-frequency gain is controlled by the shelving filter. The low-frequency adjustment is achieved by the low-pass shelving filter, and the high-frequency adjustment is achieved by the high-pass shelving filter. Its frequency response is shown in Figure 4.

f.JPG


In most applications, low-pass and high-pass filters try to completely remove a portion of the spectrum. However, a shelving filter only pushes or attenuates a portion of the spectrum, leaving the rest unaffected. At this time, a peak filter or bandpass filter needs to be designed, and its frequency response is shown in Figure 5.

g.JPG


These three filters form the simplest equalization system. This system is to design a graphic equalizer, which is simple to operate and easy to control. It consists of a series of peak filters with fixed center frequencies. The design block diagram of the graphic equalizer is shown in Figure 6.

h.JPG


According to the above ideas, in fact, only the filter in the equalizer needs to be designed. According to the superposition of linear systems, the above filters can be connected in parallel to form a system function. This system function requires linear phase to restore the sound signal without distortion, and the linear phase FIR digital filter just meets the above conditions. The system designs a 9-band equalizer, initializes the AD1836A to a sampling rate of fs = 48 kHz, defines the normalized frequency λ = f/fs, and gives the parameters of each frequency band of the equalizer as shown in Table 1.

i.JPG [page]

The ideal filter transfer function is designed q.jpg , and its amplitude-frequency characteristics are shown in Figure 7, where gain1~gain9 are the gains of 9 frequency bands, and the adjustable gain range of each frequency band is -12~12 dB.

j.JPG


It can be seen from the figure that the transfer function of the equalizer is composed of a low-pass filter in parallel with a series of band-pass filters, so q.jpg it can be written as follows
k.JPG
: hd(n) is windowed h(n)=hd(n)w(n), and then h(n) and x(n) are convolved to obtain the output sequence y(n), thus completing the filtering operation.

3 System test
System test includes two aspects. The first is the spectrum analysis test, which is used to check whether the spectrum analysis performed by the system meets the engineering requirements; the other is the equalizer test, which checks the gain adjustment effect of the equalizer on each frequency band and the equalization effect on the entire audio range. The test method can be implemented through the plot function of VisualDSP++, the development software of BF533.
3.1 Spectral analysis test
The input signal is sampled at 48 kHz, and the data is placed in a buffer of length 256 to prepare for spectrum analysis. The frequency range of the sound signal is 20 Hz to 20 kHz, and the spectrum analysis test results of its 20 Hz and 20 kHz sine signals are as follows.

l.JPG


Figures 8 and 9 are the 256-point sampling signals and spectrum diagrams of 20 Hz and 20 kHz, respectively. The spectrums of Figures 8(a) and 9(a) are the spectrums of the actual signals, and Figures 8(b) and 9(b) are the spectrums obtained by FFT. It can be seen that the algorithm can better reflect the spectrum characteristics of the original signal. As can be seen from the figure, the algorithm meets the needs of spectrum analysis.

m.JPG [page]

3.2 Equalizer test
The equalizer can be regarded as a linear time-invariant system, whose system function q.jpg is the discrete time Fourier transform of the unit impulse response h(n), so q.jpg the amplitude-frequency characteristic reflects the equalization effect of the equalizer.
(1) Equalizer gain test. The signal source generates a 20 Hz to 20 kHz sine sweep signal, and the change of the signal amplitude is observed from the oscilloscope to test whether the amplitude-frequency characteristic curve of the system meets the requirements. The adjustable range of each frequency band of the 9-band equalizer is -12 to 12 dB. After testing, when the input peak-to-peak value of a 1 V sine signal is set to 0 dB, the output signal peak-to-peak value is 540 mV; when the gain of the required frequency band is -12 dB, the output signal peak-to-peak value is 140 mV; when the gain of the required frequency band is 12 dB, the output signal peak-to-peak value is 2.18 V. It can be seen that the gain of the equalizer meets the requirements. Figures 10 and 11 are the gain test spectrum of the three frequency bands of the equalizer: low, medium and high.

o.JPG

p.JPG


(2) Equalizer sound effect test. The system can provide 7 sound effects for users to choose from, including POP, ROCK, DANCE, COUNTRY, JAZZ, CLASSIC and BRUCE. They all amplify or attenuate different frequency bands of the audio signal to achieve different sound quality effects. The gain of each frequency band of each sound effect is shown in Table 2.

n.JPG


The equalizer designed according to the above parameters has a system function amplitude-frequency characteristic curve under several sound effects as shown in Figure 12.

4 Conclusion This paper
introduces a method for designing a digital audio equalizer based on ADSP-BF533, that is, using digital signal processing to achieve equalization of audio signals. This paper proposes an algorithm for designing an equalizer using FIR filters, and uses LCD and buttons to achieve external control. This method meets the requirements of real-time processing and equalization of audio signals.

Reference address:Design of digital audio equalizer based on DSP

Previous article:Analog technology and digital technology complement each other in digital equipment
Next article:Design of Network Video Compression System Based on Blackfin

Latest Embedded 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号