Share this

Design and Implementation of IIR Filter for DES5402PP

2026-04-06 04:52:04 · · #1
0 Introduction In many practical DSP systems, the input signal can be voice signal, modulated telephone signal, encoded digital signal, compressed image signal, or analog signal output from various sensors. This requires the DSP to convert between digital and analog signals through A/D and D/A conversion, so that the DSP can process analog signals and convert digital signals into sound, light, and electrical signals that are easy for human-computer interaction. DES5402PP is an experimental development board that uses TI's TMS320C5402 as the core processor. The TLC320AC01 it provides can perform this function well. 1 MATLAB Design of IIR Filter Although the algorithm of IIR filter is more complex than that of FIR filter and is not causal stable, IIR filter also has many advantages. It can make full use of the design results of analog filter and the workload is relatively small. Under the same design specifications, it can obtain better performance with a lower order. It uses fewer storage units, so for hardware, it can provide better out-of-band attenuation characteristics under the same clock rate and storage space [1]. The low-pass IIR Chebyshev filter has 256 sampling points at a sampling frequency of 600Hz. The input is a composite signal of two sinusoidal signals with frequencies of 100Hz and 300Hz. With a cutoff frequency of 200Hz, it is expected that the 100Hz signal will be retained, while the 300Hz signal will be largely filtered out. According to the system design flow, the coefficients of the IIR filter are first obtained in MATLAB. This mainly involves three steps: generating the test signal for the system; calling the filter function in MATLAB to obtain the filter coefficients; and calling the `filter` function to perform filtering and output the filtered signal. After verifying the filter's performance, the filter coefficients are written into an `.inc` file and included in the DSP assembly program using the `.include` statement. The TMS320C5402 is a 16-bit fixed-point, 100MIPS, 16×16-bit RAM, 4K×16-bit ROM, programmable, low-power, and high-performance DSP manufactured by TI. It provides various types of serial ports that can communicate in full-duplex mode. Its serial port signals are compatible with many industrial standard serial devices and can be directly connected. When the serial port is reset, the serial port clock can be turned off or on by the DSP, and the serial port can be allowed to run in low power mode [2]. The buffered serial port is an enhanced standard serial port that adds an automatic buffer unit (ABU) to the standard serial port. It allows data transmission of 8, 10, 12, 16, 20, 24 or 32 bits. Since the ABU is an additional logic circuit, it allows the serial port unit to directly read and write data to the internal independent memory of the C5402 without the involvement of the CPU, thereby making the BSP transmission speed faster. Table 1 shows the operation steps for BSP sending and receiving data initialization. Table 1 Initialization steps for BSP transmission and reception [img=546,272]http://cms.cn50hz.com/files/RemoteFiles/20090204/859116001.jpg[/img] 3 Features of AC01 [3][4] The TLC320AC01 is also a chip produced by TI that integrates A/D and D/A, and communicates with DSP or other devices through a serial port. The maximum sampling frequency of AC01 is 25kHz, its data precision is 16 bits, and it is powered by a single 5V power supply. After C5402 is connected to AC01, only one buffer channel serial port can be used to realize data acquisition and output at the same time, thereby saving the hardware overhead of DSP. Therefore, the connection between DSP and AC01 has been widely used in signal processing. The experimental system DES5402PP uses AC01 as an analog signal interface, with two AC01s, which work in "master" and "slave" modes respectively. The synthesized input signal is generated using the "Master AC01," and the "Slave AC01" converts this signal into a filtered data signal and inputs it to the DSP chip. The DSP can also control parameters such as the sampling frequency, gain, low-pass filter cutoff frequency, and high-pass filter cutoff frequency of the AC01 by reading and writing its registers. The nine control registers of the AC01 are shown in Table 2. Table 2: Data Memory Functions of TLC320AC01 [img=546,125]http://cms.cn50hz.com/files/RemoteFiles/20090204/859116002.jpg[/img] Before the AC01 can operate normally, it must be correctly initialized. The initialization operation mainly involves configuring the various data memories of the AC01. The sampling frequency Fs = MCLK/2AB, where MCLK is the DSP's operating frequency, and A and B are the contents of registers A and B, respectively. Since the experimental sampling frequency is set to 600Hz, the contents of registers A and B are set to 5 and 4, respectively. That is: [img=258,80]http://cms.cn50hz.com/files/RemoteFiles/20090204/859116003.jpg[/img] 4 Connection method of C5402 and AC01 4.1 Hardware connection of C5402 and AC01 In master/slave mode, the DSP can be directly connected to two AC01 without other devices. The hardware connection is shown in Figure 1: [img=396,325]http://cms.cn50hz.com/files/RemoteFiles/20090204/859116004.gif[/img] Figure 1 Connection between Master/Slave TLC320AC01 and TMS320C5402 4.2 Software Connection between C5402 and AC01 First, write 256 data points (i.e., the discrete representation of the test signal composed of three sine signals) into the data storage space of C5402. Then, send the data to "Master AC01" through the buffered serial port. Use the D/A channel of "Master AC01" to generate an analog signal as the input signal of the IIR filter. Since the signal output channel of DES5402PP is connected to the input channel in the experiment, that is, the output of "Master AC01" is used as the input of "Slave AC01", and the DOUT port of "Slave AC01" is connected to the DR terminal of the DSP chip. In addition, in serial communication, since the data clock and frame synchronization signal are generated by AC01, C5402 will use an external clock and frame synchronization signal. Before using the serial port, it needs to be initialized, including the serial port transmit and receive interrupt settings and the serial port register initialization. The main code is as follows: [img=352,198]http://cms.cn50hz.com/files/RemoteFiles/20090204/859116005.jpg[/img] At the same time, the interrupt vector table needs to be modified to correctly respond to the serial port receive and transmit interrupt requests. The transmit interrupt generates the test signal and completes the initialization of AC01. In fact, the implementation of signal filtering refers to reading data from A/D, calling the filtering program, and then outputting the data to D/A. 5 Experimental process and result analysis The experimental program mainly includes the following steps: (1) Initialize the DSP registers, buffered serial port and timer to ensure that the correct clock signal of AC01 can be provided. After completing this step, the CLKR and FSR pins of the DSP can be checked to see the continuously output signal. (2) Initialize AC01 through the buffered serial port of the DSP, correctly set the sampling rate control register of AC01 (R1 in Table 2), and set its sampling frequency. After completing this step, the DOUT pin of AC01 can be checked to find that there is a continuously output signal. (3) Set the interrupt of the DSP and read the data from the buffered serial port. This step can be checked through the CCS environment to see if the read data is correct. If it is correct, send the sampled data to the filtering program for filtering, and after obtaining the result, send it directly to the D/A unit output of AC01. Otherwise, return to step (1). The waveforms before and after filtering are shown in Figure 2 and Figure 3. It can be seen that compared with Figure (a) before filtering, the time domain and frequency domain waveforms of Figure (b) are significantly improved, and the 300Hz signal is basically filtered out. [img=536,132]http://cms.cn50hz.com/files/RemoteFiles/20090204/859116006.jpg[/img] (a) Signal waveform before filtering (b) Signal waveform after filtering Figure 2 Time-domain waveforms of the signal before and after filtering [img=529,135]http://cms.cn50hz.com/files/RemoteFiles/20090204/859116007.jpg[/img] (a) Signal frequency before filtering (b) Signal frequency after filtering Figure 3 Frequency-domain waveforms of the signal before and after filtering In Figure 2(b), it can be seen that only a sinusoidal signal of one frequency remains. From the frequency domain perspective, in Figure 3(b), the high-frequency part has been basically weakened, while the low frequency also suffers a small loss. By increasing the order of the filter or setting the cutoff frequency slightly lower, the low-frequency signal can be preserved to a greater extent while the high-frequency signal is eliminated. 6 Conclusion Filters are essential in signal and information processing, including filtering, detection, and prediction. Digital filters are the most widely used method in digital signal processing. In the design of IIR digital filters, the design results of analog filters can be utilized or typical filter types can be directly adopted, reducing workload. During signal input and output, A/D and D/A conversions are often required, which can be easily implemented using the TLC320AC01 analog interface circuit. Furthermore, DSP chips themselves have parallel hardware multipliers, pipelined structures, and fast on-chip RAM resources, making filtering operations easy to implement. The program is also highly portable; different performance filters only require modification of the filter parameters. The author's innovation lies in designing and implementing an IIR filter based on the DES5402PP development board by inputting a set of two sinusoidal mixed signals of different frequencies. The article also introduces the operation of the serial port and the TLC320AC01, provides the connection method with the DSP, and demonstrates its implementation through programming. Regardless of whether the signal being processed is analog or digital, the system can use the TLC320AC01 to perform signal form matching and conversion, completing the signal filtering process. Since the highest sampling frequency of TLC320AC01 is 25kHz (higher than the voice sampling frequency of 8kHz), this system can also be used for audio signal filtering. References: [1] Qi Haibing, Ping Guanjun, Tao Wenchao. Design and implementation of infinite impulse response filter [J]. Microcomputer Information, 2006, 10-2: 84-85. [2] Wang Anmin, Chen Mingxin, Zhu Ming. Practical technology of TMS320C54xxDSP [M]. Beijing: Tsinghua University Press, 2007: 48-204. [3] Texas Instruments. TLC320AC01C Data Manual. [4] Texas Instruments. InteRFacing TMS320C54x DSPs to TLC320AC01/02 Analog Interface circuits.
Read next

CATDOLL 136CM Vivian (Customer Photos)

Height: 136cm Weight: 23.3kg Shoulder Width: 31cm Bust/Waist/Hip: 60/54/68cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22