Share this

Design and Implementation of an IIR Filter Based on DES5402PP

2026-04-06 06:20:31 · · #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 by 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 working clock can be turned off or on by the DSP, and the serial port can be allowed to run in low power mode [2]. Buffered serial port is an enhanced standard serial port that adds an automatic buffer unit (ABU) to the standard serial port. It allows 8, 10, 12, 16, 20, 24 or 32-bit data transmission. 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 C5402 without the participation of the CPU, thereby making the BSP transmission speed faster. Table 1 gives the operation steps for BSP sending and receiving data initialization. Table 1 BSP sending and receiving initialization steps 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 the 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 connecting the C5402 and AC01, data acquisition and output can be achieved simultaneously using only a single buffered serial port, thus saving DSP hardware overhead. Therefore, the connection between the DSP and AC01 is widely used in signal processing. The experimental system DES5402PP uses AC01 as the analog signal interface, with two AC01s operating in "master" and "slave" modes respectively. The "master AC01" generates the synthesized input signal, 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 AC01's sampling frequency, gain, low-pass filter cutoff frequency, and high-pass filter cutoff frequency by reading and writing the AC01's registers. The nine control registers of the AC01 are shown in Table 2. Table 2: Data Memory Functions of TLC320AC01. 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 sampling frequency is set to 600Hz in the experiment, 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][align=left] 4. Connection method between C5402 and AC01  4.1 Hardware Connection between C5402 and AC01 Figure 1 Connection between Master/Slave TLC320AC01 and TMS320C5402 4.2 Software Connection between C5402 and AC01 First, write 256 data points (i.e., a discrete representation of the test signal composed of three sine waves) into the data storage space of the C5402. Then, send the data to the "Master AC01" via the buffered serial port. The D/A channel of the "Master AC01" generates an analog signal as the input signal for the IIR filter. Since the signal output channel of the DES5402PP is connected to the input channel in the experiment, the output of the "Master AC01" serves as the input of the "Slave AC01," and the DOUT port of the "Slave AC01" is connected to the DR terminal of the DSP chip. Furthermore, in serial communication, because the data clock and frame synchronization signal are generated by AC01, the C5402 will use an external clock and frame synchronization signal. Before using the serial port, it needs to be initialized, including setting the serial port transmit/receive interrupts and initializing the serial port registers. The main code is as follows: Simultaneously, the interrupt vector table needs to be modified to correctly respond to the serial port's 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 the A/D converter, calling the filtering program, and then outputting the data to the D/A converter. 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 AC01 can provide the correct clock signal. After completing this step, the CLKR and FSR pins of the DSP can be checked to see the continuous output signal. (2) Initialize the AC01 through the buffered serial port of the DSP, correctly set the sampling rate control register of the AC01 (R1 in Table 2), and set its sampling frequency. After completing this step, the DOUT pin of the AC01 can be checked to find the continuous output signal. (3) Set the interrupt of the DSP and read the data from the buffered serial port. This step can be checked to see if the read data is correct through the CCS environment. 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 of the AC01 for output. Otherwise, return to step (1). The waveforms before and after filtering are shown in Figure 2 and Figure 3. As can be seen, compared to the unfiltered waveform (a), the time and frequency domain waveforms in waveform (b) are significantly improved, with the 300Hz signal being essentially filtered out. Figure 2: Time domain waveforms of the signal before and after filtering. Figure 3: Frequency domain waveforms of the signal before and after filtering. In Figure 2(b), only a single frequency sinusoidal signal remains. From the frequency domain perspective, in Figure 3(b), the high-frequency portion is largely weakened, while the low-frequency portion also suffers slight loss. By increasing the filter order or slightly lowering the cutoff frequency, the low-frequency signal can be retained more effectively while eliminating the high-frequency signal. 6 Conclusion Filters are used in signal and information 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 to reduce workload. In the signal input and output process, A/D and D/A conversion is often required, and the TLC320AC01 analog interface circuit can conveniently implement this conversion. Furthermore, DSP chips themselves possess parallel hardware multipliers, pipelined structures, and fast on-chip RAM, facilitating filtering operations and offering good program portability; filters with different performance levels only require parameter modifications. 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 paper also introduces the operation of the serial port and the TLC320AC01, providing connection methods with the DSP and demonstrating program implementation. Regardless of whether the signal being processed is analog or digital, the system can perform signal matching and conversion using the TLC320AC01 to complete signal filtering. Since the TLC320AC01's maximum sampling frequency is 25kHz (higher than the speech 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 CATDOLL 115CM Saki TPE

Height: 115cm Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22