USB-based EQ test method and system
Through the USB-based EQ testing method, audio data is directly written on the chip end and the EQ configuration is modified in real time, which solves the problems of poor real-time performance and noise interference of the EQ test system in the prior art, and achieves efficient and accurate EQ testing.
Patent Information
- Application Number
- CN202510464137.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, the EQ test system has poor real-time performance, low testing efficiency, and is susceptible to external noise interference, resulting in inaccurate test results.
Using USB-based EQ testing method, audio and configuration data are transmitted to the chip to be tested through USB cable, and directly written to SRAM for testing, reducing signal interference, and modifying the EQ configuration in real time to adapt to sweep wave tests at different sampling rates.
It improves the accuracy and efficiency of EQ testing, reduces external interference, supports plug-and-play functions, and improves data transmission speed and convenience of analysis.
Smart Images

Figure CN120281897A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an audio signal processing technology, and more particularly to a USB-based EQ test method and system. Background Art
[0002] In the current field of audio and video processing technology, audio and video processing chips generally integrate an EQ equalization module, which provides users with a rich variety of equalization effect options to meet different auditory needs. To better meet the needs of users, the performance detection of EQ is crucial.
[0003] In the prior art, the test method for EQ performance, such as Figure 1 as shown, uses a PC software to generate a sweep wave file and store it in an SD card. Subsequently, the SD card is connected to the SD card interface of the chip; the EQ verification program in the chip is run to set the EQ parameters, and the sweep wave file data is read from the SD card and stored in the SRAM, and then the data is sent to the DAC module of the chip for playback; at the same time, the data played by the DAC is sent back to the PC software through an audio cable for FFT analysis, and finally the verification result of the EQ is obtained.
[0004] The test method for EQ performance in the prior art has the following technical problems. First, the EQ test system with the above structure cannot meet the real-time requirement. For example, to test sweep waves at different sampling rates, it is necessary to continuously replace the files in the SD card and re-run the EQ verification program in the chip, resulting in low overall EQ test efficiency and poor real-time performance. Second, using an SD card to read and write audio data has additional signal flips (such as the CLK of the SD card), which will inevitably introduce uncontrollable noise signals to the DAC of the chip, leading to incorrect EQ test results. Third, using an audio cable to connect to the PC to receive the analog signal output by the DAC of the chip depends heavily on the sampling accuracy of the ADC of the PC. If the accuracy is low, the signal cannot be accurately restored, and unnecessary signal interference will be introduced; at the same time, the audio cable is also vulnerable to external electromagnetic interference, which will also introduce noise signals, resulting in inaccurate EQ test results.
[0005] To solve the above technical problems, the present invention proposes a USB-based EQ test method and system. Summary of the Invention
[0006] The object of the present invention is to provide a USB-based EQ test method and system, which can perform EQ tests on audio and video chips and improve the test efficiency and test accuracy.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] A USB-based EQ testing method includes a chip end and a testing end. The testing end transmits data through a USB cable to the USB of the chip under test. The data includes audio data and configuration data. The USB of the chip under test receives the audio data in real time and writes the received audio data into the SRAM1 of the chip under test. The USB of the chip under test receives the configuration data in real time and writes the configuration data into the configuration parameter execution unit of the chip under test.
[0009] Run the EQ verification program in the chip under test, read the audio data from the SRMA1 of the chip under test, and parse the configuration data transmitted by the USB of the chip under test to obtain the EQ configuration.
[0010] Send the audio data to the DAC of the chip under test for playback. The DAC writes the played audio data into the SRAM0 of the chip under test. The SRAM0 of the chip under test transmits the audio data back to the testing end through the USB of the chip under test.
[0011] The testing end performs FFT analysis and EQ index analysis to finally obtain the verification result of EQ.
[0012] The EQ verification program in the chip no longer reads audio data from the SD card, but reads it from the SRAM written by the USB. This can reduce signal interference caused by additional signal flips. Build an EQ testing system with less external interference, thus significantly improving the testing accuracy. The EQ configuration of the EQ verification program in the chip is no longer fixed to a single configuration, but parses the configuration data transmitted by the USB and obtains the EQ configuration from it. This can modify the EQ configuration in real time to adapt to the swept-frequency wave test of different sampling rates, and can switch the swept-frequency wave files of different sampling rates for EQ testing at any time, thereby improving the overall testing rate.
[0013] The testing end writes a program that integrates functions such as audio data generation, FFT analysis, EQ index analysis, and USB data reading and writing. Subsequent developers only need to modify the sampling rate and EQ parameters in this program. For example, use the pyusb library in python for usb communication; use the numpy and Scipy libraries for FFT analysis and EQ index analysis, improving the convenience, accuracy, and efficiency of the analysis.
[0014] The testing end can obtain the final verification result of EQ through the result of one round of testing or the results of multiple rounds of testing.
[0015] The USB on the chip under test is WINUSB. The USB on the chip under test includes 2 pairs of endpoints. The chip under test uses USB endpoint 1 to obtain the audio data, and the chip under test uses USB endpoint 2 to obtain the configuration data.
[0016] The chip under test uses USB endpoint 1 to obtain the audio data, including querying whether the audio data FIFO is empty. If not, continue to query. If so, request the test end to send REQ_TX. The USB of the chip under test writes the audio data into SRAM1, and the audio data is sent to the DAC for playback. After playback and writing into SRAM0, an interrupt is generated immediately, requesting the test end to receive REQ_RX. The USB of the chip under test transmits the audio data to the test end. The DAC no longer directly transmits the signal to the test end through the audio cable, but directly writes the original signal data into the SRAM in the chip, and finally transmits the data back to the test end through the USB. This can reduce the interference caused by the audio aic cable.
[0017] The chip under test uses USB endpoint 2 to obtain the configuration data, including confirming whether the configuration information is received. If not, continue to confirm. If so, write the configuration information into the chip under test and reply with an ACK signal.
[0018] The USB of the chip under test receiving the audio data further includes: the USB communication processing module of the test end polls the signal in the USB cable. When the first request receiving signal is detected, it means that the chip under test wants to receive the audio data; the test end will send a first inquiry signal to ask whether the chip under test is ready to receive the audio data; after receiving the first inquiry signal, if the chip under test itself already has the condition to receive the audio data, it will reply with a first ACK signal; after receiving the first ACK signal, the test end sends the audio data to the chip under test, sending a preset number of bits each time; after the chip under test finishes receiving the audio data, it sends a second ACK signal to the test end, indicating that all the audio data has been received.
[0019] The USB of the chip under test receiving the configuration parameters further includes: the test end actively sends the configuration information to the chip under test. After receiving it, the chip under test replies with a second ACK signal to the test end.
[0020] The USB at the chip under test end transmits the audio signal data back to the test end. Further, the USB communication processing module at the test end polls the signals in the USB cable. When a first request-to-send signal is detected, it indicates that the chip under test end wants to send the audio data. The test end will reply with a third ACK signal, indicating that the test end is ready to receive data. After receiving the third ACK signal, the chip under test end sends the audio data to the test end, sending a preset number of bits each time. After the test end finishes receiving, it sends a fourth ACK signal to the chip under test end, indicating that all the audio data has been received.
[0021] The test end uses Python to write a verification program to perform USB data sending and receiving, FFT analysis, and EQ index analysis.
[0022] The test end sends USB data, which includes initializing the USB for communication, sending configuration data to the chip under test end. The configuration data includes the sampling rate and EQ parameters, generating a swept-frequency wave with the corresponding sampling rate, and waiting for the chip under test end to request to send the audio data. If not, it continues to wait; if so, it sends the audio data.
[0023] The test end receives USB data, which includes waiting for the chip under test end to request to receive audio data. If not, it continues to wait; if so, it receives the audio data and performs FFT analysis to obtain the spectrum.
[0024] The test end includes USB 2.0, and the chip end is connected to the USB 2.0 interface of the test end through a USB cable. USB 2.0 transmission is selected as the communication method. The USB 2.0 transmission speed is up to 480 Mbps, supports plug-and-play function, and almost all modern computers and many electronic devices support the USB interface. By adopting an efficient communication method and designing an efficient data interaction protocol, the present invention improves the efficiency of data transmission.
[0025] A USB-based EQ test system includes a chip end and a test end, including
[0026] Transmission module: The test end transmits data to the USB of the chip under test through a USB cable. The data includes audio data and configuration data. The USB of the chip under test end receives the audio data in real time and writes the received audio data into the SRAM1 of the chip under test end. The USB of the chip under test end receives the configuration data in real time and writes the configuration data into the configuration parameter execution unit of the chip under test end;
[0027] Operation module: Run the EQ verification program in the chip under test, read the audio data from SRMA1 of the chip under test, and parse the configuration data transmitted from the USB of the chip under test to obtain the EQ configuration; send the audio data to the DAC of the chip under test for playback, and the DAC directly writes the played audio data to the SRAM0 of the chip under test, and the SRAM0 of the chip under test transmits the audio data back to the test end through the USB of the chip under test;
[0028] Analysis module: The test end performs FFT analysis and EQ index analysis, and finally obtains the verification result of EQ.
[0029] Beneficial effects:
[0030] 1. The DAC no longer directly transmits the signal to the test end through the audio cable, but directly writes the original signal data to the SRAM in the chip, and finally transmits the data back to the test end through the USB. This can reduce the interference caused by the audio aic cable.
[0031] 2. The EQ verification program in the chip no longer reads the audio data from the SD card, but reads it from the SRAM written by the USB. This can reduce the signal interference caused by additional signal flips; build an EQ test system with less external interference, thus significantly improving the test accuracy.
[0032] 3. The EQ configuration of the EQ verification program in the chip is no longer fixed as a single configuration, but parses the configuration data transmitted from the USB and obtains the EQ configuration from it. This can modify the EQ configuration in real time to adapt to the sweep wave test of different sampling rates, and can switch the sweep wave files of different sampling rates for EQ test at any time, thus improving the overall test rate.
[0033] 4. Select USB2.0 transmission as the communication method. The USB2.0 transmission speed is up to 480Mbps at most, supports the plug-and-play function, and almost all modern computers and many electronic devices support the USB interface. By adopting an efficient communication method and designing an efficient data interaction protocol, the present invention improves the efficiency of data transmission.
[0034] 5. The PC end compiles a program integrating functions such as audio data generation, FFT analysis, EQ index analysis, and reading and writing USB data. Subsequent developers only need to modify the sampling rate and EQ parameters in this program. For example, use the pyusb library in python for usb communication; use the numpy and Scipy libraries for FFT analysis and EQ index analysis, improving the convenience, accuracy and efficiency of analysis. Description of the drawings
[0035] Figure 1 EQ detection system diagram in the prior art
[0036] Figure 2 EQ detection system diagram of the present invention
[0037] Figure 3 Logic diagram of the program for obtaining audio data using USB endpoint 1 at the chip end
[0038] Figure 4 Logic diagram of the program for obtaining EQ parameter configuration using USB endpoint 2 at the chip end
[0039] Figure 5 Logic diagram of the operation for the chip end to receive audio data
[0040] Figure 6 Logic diagram of the operation for the chip end to receive configuration data
[0041] Figure 7 Logic diagram of the operation for the chip end to transfer audio data back to the PC end
[0042] Figure 8 Flowchart of the verification program written in Python at the PC end for USB data transceiver, FFT analysis, and EQ index analysis Specific implementation mode
[0043] The present invention will be described in detail below with reference to the accompanying drawings.
[0044] A USB-based EQ testing method, as Figure 2 shown, includes a chip under test, a test end, the test end is the PC end, the test end transmits data to the USB of the chip under test through a USB cable, the data includes audio data and configuration data, the USB of the chip under test receives the audio data, and writes the received audio data into the SRAM1 of the chip under test, the USB of the chip under test receives the configuration data, and writes the configuration data into the configuration parameter execution unit of the chip under test;
[0045] Run the EQ verification program in the chip under test, read the audio data from the SRMA1 of the chip under test, and parse the configuration data transmitted by the USB of the chip under test to obtain EQ configuration; the EQ verification program in the chip no longer reads audio data from the SD card, but reads from the SRAM written by the USB. This can reduce signal interference caused by additional signal flips; build an EQ testing system with less external interference, thereby significantly improving the testing accuracy.
[0046] The EQ configuration of the EQ verification program in the chip is no longer fixed to a single configuration. Instead, it parses the configuration data transmitted via USB and obtains the EQ configuration from it. In this way, the EQ configuration can be modified in real time to adapt to the swept-frequency wave tests at different sampling rates, and the swept-frequency wave files at different sampling rates can be switched at any time for EQ testing, thereby improving the overall test rate.
[0047] The audio data is sent to the DAC at the chip under test for playback. The DAC directly writes the played audio data to the SRAM0 at the chip under test, and the SRAM0 at the chip under test transmits the audio data back to the PC via the USB at the chip under test.
[0048] The test terminal performs FFT analysis and EQ index analysis, and finally obtains the verification result of EQ. The test terminal writes a program that integrates functions such as audio data generation, FFT analysis, EQ index analysis, and USB data reading and writing. Subsequent developers only need to modify the sampling rate and EQ parameters in this program. For example, the pyusb library in python is used for usb communication; the numpy and Scipy libraries are used for FFT analysis and EQ index analysis, which improves the convenience, accuracy, and efficiency of the analysis.
[0049] The USB at the chip under test is WINUSB. The USB at the chip under test includes 2 pairs of endpoints. The chip under test uses USB endpoint 1 to obtain audio data, and the chip under test uses USB endpoint 2 to obtain configuration data.
[0050] As Figure 3 shown, the chip under test uses USB endpoint 1 to obtain audio data, including querying whether the audio data FIFO is empty. If not, continue to query. If so, request the test terminal to send REQ_TX. The USB at the chip under test writes the audio data to SRAM1. The audio data is sent to the DAC for playback. After playback and writing to SRAM0, an interrupt is generated immediately, requesting the test terminal to receive REQ_RX. The USB at the chip under test transmits the audio data to the test terminal. The DAC no longer directly transmits the signal to the test terminal via the audio cable, but directly writes the original signal data to the SRAM in the chip, and finally transmits the data back to the test terminal via USB. In this way, the interference caused by the audio aic cable can be reduced.
[0051] As Figure 4 shown, the chip under test uses USB endpoint 2 to obtain configuration data, including confirming whether the configuration information is received. If not, continue to confirm. If so, write the configuration information to the chip under test and reply with an ACK signal.
[0052] As Figure 5As shown, the USB of the chip under test receives audio data, which further includes that the USB communication processing module of the PC polls the signals in the USB cable. When the first request to receive signal: 0x58523E3E is detected, it indicates that the chip under test wants to receive audio data; the PC will send the first inquiry signal: 0x3F4B4F3E to inquire whether the chip under test is ready to receive audio data; after receiving the first inquiry signal, if the chip under test itself has the condition to receive audio data, it will reply with the first ACK signal: 0x4B434100; after receiving the first ACK signal, the test end sends the audio data to the chip end, and the length of each send is fixed at 8192 Byte; after the chip under test finishes receiving the audio data, it sends the second ACK signal to the test end, indicating that all the audio data has been received.
[0053] As Figure 6 shown, the USB of the chip under test receives configuration parameters, which further includes: the test end actively sends configuration information to the chip under test, and after receiving it, the chip under test replies with the second ACK signal to the test end.
[0054] As Figure 7 shown, the USB of the chip under test sends the audio signal data back to the test end, which further includes that the USB communication processing module of the test end polls the signals in the USB cable. When the third request to send signal: 0x58543E3E is detected, it indicates that the chip under test wants to send the audio data; the test end will reply with a third ACK signal: 0x4B434100, indicating that the test end is ready to receive data; after receiving the third ACK signal, the chip under test sends the audio data to the test end, and the length of each send is fixed at 8192 Byte; after the test end finishes receiving, it sends the fourth ACK signal to the chip under test, indicating that all the audio data has been received.
[0055] The test end uses python to write a verification program to perform the sending and receiving of USB data, FFT analysis, and EQ index analysis.
[0056] As Figure 8 shown, the test end sends USB data, which includes initializing the USB for communication, sending configuration data to the chip under test, the configuration data including the sampling rate and EQ coefficient, generating a swept-frequency wave with the corresponding sampling rate, waiting for the chip under test to request to send the audio data, if not, then continue to wait; if so, then send the audio data;
[0057] As Figure 8As shown, the test end receives USB data, which includes: waiting for the chip under test to request to receive audio data, if not, continuing to wait, if yes, receiving the audio data, performing FFT analysis, and obtaining a spectrum.
[0058] The test end includes USB2.0, and the chip end to be tested is connected to the USB2.0 interface of the test end through a USB cable. USB2.0 transmission is selected as the communication mode. The USB2.0 transmission speed is up to 480Mbps, supports plug-and-play function, and almost all modern computers and many electronic devices support USB interfaces. The present invention improves the efficiency of data transmission by adopting an efficient communication mode and designing an efficient data interaction protocol.
[0059] A USB-based EQ test system includes a chip to be tested end and a test end, and is characterized in that:
[0060] Transmission module: the test end transmits data to the USB of the chip under test through a USB cable, the data includes audio data and configuration data, the USB of the chip under test receives the audio data in real time, and writes the received audio data into the SRAM1 of the chip under test, the USB of the chip under test receives the configuration data in real time, and writes the configuration data into the configuration parameter execution unit of the chip under test;
[0061] Running module: running the EQ verification program in the chip under test, reading the audio data from SRMA1 of the chip under test, parsing the configuration data transmitted by the USB of the chip under test, and obtaining the EQ configuration; sending the audio data to the DAC of the chip under test for playing, the DAC directly writes the played audio data to SRAM0 of the chip under test, and the SRAM0 of the chip under test transmits the audio data back to the test end through the USB of the chip under test;
[0062] Analysis module: The test end performs FFT analysis and EQ index analysis to finally obtain the EQ verification result.
[0063] The steps of the method described in conjunction with the embodiments disclosed herein may be implemented by hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0064] The specific embodiments described above further elaborate on the object, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only for the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A USB-based EQ test method, including a chip side and a test side. The test side transmits data to the USB of the chip under test through a USB cable. The data includes audio data and configuration data. The USB of the chip under test receives the audio data in real time and writes the received audio data into the SRAM1 of the chip under test. The USB of the chip under test receives the configuration data in real time and writes the configuration data into the configuration parameter execution unit of the chip under test; Run the EQ verification program in the chip under test, read the audio data from the SRMA1 of the chip under test, and parse the configuration data transmitted by the USB of the chip under test to obtain the EQ configuration; Send the audio data to the DAC of the chip under test for playback. The DAC writes the played audio data to the SRAM0 of the chip under test. The SRAM0 of the chip under test transmits the audio data back to the test side through the USB of the chip under test; The test side performs FFT analysis and EQ index analysis, and finally obtains the verification result of the EQ.
2. The EQ test method according to claim 1, wherein: The USB of the chip under test is WINUSB. The USB of the chip under test includes 2 pairs of endpoints. The chip under test uses USB endpoint 1 to obtain the audio data, and the chip under test uses USB endpoint 2 to obtain the configuration data.
3. The EQ test method according to claim 2, wherein: The chip under test uses USB endpoint 1 to obtain the audio data, including querying whether the audio data FIFO is empty. If not, continue to query. If so, request the test side to send REQ_TX. The USB of the chip under test writes the audio data into SRAM1. The audio data is sent to the DAC for playback. After playback and writing to SRAM0, an interrupt is generated immediately, requesting the test side to receive REQ_RX. The USB of the chip under test transmits the audio data to the test side.
4. The EQ test method according to claim 2, wherein: The chip under test uses USB endpoint 2 to obtain the configuration data, including confirming whether the configuration information is received. If not, continue to confirm. If so, write the configuration information into the chip under test and reply with an ACK signal.
5. The EQ test method according to claim 1, characterized in that: The USB of the chip under test receives the audio data, which further includes that the USB communication processing module of the test side polls the signals in the USB cable. When the first request to receive signal is detected, it means that the chip under test wants to receive the audio data; the test side will send a first inquiry signal to ask whether the chip under test is ready to receive the audio data; after the chip under test receives the first inquiry signal, if it has the condition to receive the audio data itself, it will reply with a first ACK signal; after the test side receives the first ACK signal, it sends the audio data to the chip under test, sending a preset number of bits each time; after the chip under test receives the audio data, it sends a second ACK signal to the test side, indicating that all the audio data has been received.
6. The EQ test method according to claim 1, characterized in that: The USB reception configuration parameters of the chip under test further include: the test end actively sends configuration information to the chip under test, and after receiving it, the chip under test sends a second ACK signal to the test end.
7. The EQ test method according to claim 1, characterized in that: The USB of the chip under test uploads the audio signal data to the test end, which further includes that the USB communication processing module of the test end polls the signals in the USB cable. When detecting the first request-to-send signal, it means that the chip under test wants to send the audio data; the test end will send a third ACK signal indicating that the test end is ready to receive data; after receiving the third ACK signal, the chip under test sends the audio data to the test end, sending a preset number of bits each time; after the test end finishes receiving, it sends a fourth ACK signal to the chip under test indicating that all the audio data has been received.
8. The EQ test method according to claim 1, wherein: The test end uses Python to write a verification program for USB data transmission and reception, FFT analysis, and EQ index analysis.
9. The EQ test method according to claim 7, characterized in that: The test end performs USB data transmission, which includes initializing the USB for communication, sending configuration data to the chip under test. The configuration data includes the sampling rate and EQ parameters, generating a swept-frequency wave with the corresponding sampling rate, and waiting for the chip under test to request to send the audio data. If not, continue to wait; if so, send the audio data. The test end performs USB data reception, which includes waiting for the chip under test to request to receive audio data. If not, continue to wait; if so, receive the audio data and perform FFT analysis to obtain the spectrum.
10. A USB-based EQ test system, including a chip end and a test end, including Transmission module: The test end transmits data to the USB of the chip under test through a USB cable. The data includes audio data and configuration data. The USB of the chip under test receives the audio data in real time and writes the received audio data into the SRAM1 of the chip under test. The USB of the chip under test receives the configuration data in real time and writes the configuration data into the configuration parameter execution unit of the chip under test. Operation module: Run the EQ verification program in the chip under test, read the audio data from the SRMA1 of the chip under test, and parse the configuration data transmitted by the USB of the chip under test to obtain the EQ configuration; send the audio data to the DAC of the chip under test for playback. The DAC directly writes the played audio data to the SRAM0 of the chip under test, and the SRAM0 of the chip under test uploads the audio data to the test end through the USB of the chip under test. Analysis module: The test end performs FFT analysis and EQ index analysis to finally obtain the verification result of the EQ.