T5-AI Acoustic Performance Testing

Last Updated on : 2025-08-22 06:06:02download

This topic provides a step-by-step guide for conducting acoustic performance testing on the T5-AI Voice Box using a Windows system.

Environment setup

Install Python

Go to the official Python website and install v3.8.0 or later.

T5-AI Acoustic Performance Testing

Set system environment variables

  1. In the Windows system, choose System Properties > Advanced and click Environment Variables.

  2. In the section of System Variables, select Path and click Edit.

  3. In the Edit environment variable window, click New. Then, add the paths to python.exe and pip.exe to the environment variables.
    Example paths (replace Username with your actual username):

    • C:\Users\Username\AppData\Local\Programs\Python\Python38\
    • C:\Users\Username\AppData\Local\Programs\Python\Python38\Scripts\
    T5-AI Acoustic Performance Testing

Python installation package

  • Playback/recording (audio_uart_dump.py) installation package:

    python -m pip install --upgrade pip
    pip install pyserial
    
  • Signal analytics (audio_test.py) installation package:

    pip install numpy
    pip install soundfile
    pip install scipy
    pip install matplotlib
    

Install audio analytics software Audacity

Download it from the official Audacity website.

Preparation before testing

DUT firmware

The newly released T5 software supports acoustic testing. The compiled firmware can be used as adapted firmware for the device under test (DUT), for example: tuyaos_demo_ai_toy_QIO_evb1.0.5.bin.

Tool and wiring

Tool: USB to UART converter, used for the communication between PC and DUT via commands.

T5-AI Acoustic Performance Testing

Wiring: Connect the serial port board to the product’s RX0, TX0, and GND.

T5-AI Acoustic Performance Testing

Python script

Refer to the following scripts:

Testing

Start testing

Open the Windows command prompt, go to the audio_uart_dump.py folder, and run the Python script.

d:
cd D:\Test\T5AI-EVB
python audio_uart_dump.py

Example:

C:\Users\gerui>d:
D:\>cd D:\Test\AI_Audio_Test\T5AI\Audio_Test_0804
D:\Test\AI_Audio_Test\T5AI\Audio_Test_0804>python audio_uart_dump.py

Available serial ports:
1. COM17 - Silicon Labs CP210x USB to UART Bridge (COM17)

Select serial port number: 1
Enabled serial port: COM17, baud rate: 2M

Supported commands:
start       - Start recording
stop        - Stop recording
reset       - Reset recording
dump 0      - Dump the microphone channel to dump_mic.pcm
dump 1      - Dump the reference channel to dump_ref.pcm
dump 2      - Dump the AEC channel to dump_aec.pcm
bg 0        - White noise
bg 1        - 1K-0dB (bg 1 1000)
bg 2        - Sweep frequency constantly
bg 3        - Sweep discrete frequency
bg 4        - Minimum single frequency
volume 50   - Set the volume to 50%
micgain 50  - default micgain=70
quit        - Quit the program
>

Testing commands

Command description

Command Description
start Start recording
stop Stop recording
reset Reset recording
dump 0 Dump the microphone channel to dump_mic.pcm
dump 1 Dump the reference channel to dump_ref.pcm
dump 2 Dump AEC channel to dump_aec.pcm
bg 0 Play white noise
bg 1 Play 1 KHz/0 dB (format: bg 1 1000)
bg 2 Play sweep frequency continuously
bg 3 Play sweep discrete frequency
bg 4 Play minimum single frequency signal
volume 50 Set volume to 50%
quit Quit the program

Example:

  • bg 1 500: Play a 500 Hz sine wave signal.
  • volume 70: Set the volume to 70%.

Audio signals

Command Description
bg 0 Play white noise at the level of -3 dB for 5 seconds.
bg 1 1 KHz sine wave signal at the level of 0 dB for 5 seconds.
bg 2 Sweep frequency constantly (7500 Hz to 100 Hz) at the level of -3 dB for 10 seconds.
bg 3 Sweep discrete frequency (7500 Hz to 50 Hz) at the level of -6 dB for 7 seconds.
bg 4 1 KHz signal at the level of -90 dB for 5 seconds, used to test the device’s noise floor.

bg 3 has 21 default frequencies. The following table shows the frequencies and durations:

Frequency 1000 7500 5800 4500 3500 2750 2150 1700 1300 1000 785
Duration 0.5 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
Frequency 600 475 370 285 255 175 135 100 80 65 50
Duration 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.5 0.5 0.5

bg 3 corresponds to the file Sweep_7500-50Hz-21pt.xlsx.

Acoustic performance testing and analytics

Amplifier output test

Output power, frequency response, noise floor, and total harmonic distortion (THD) tests:

Generate test signals via audio_uart_dump.py, and measure amplifier output signals using an audio analyzer or oscilloscope.

Microphone test

Amplitude, noise floor, frequency response, and THD tests:
In an anechoic chamber, broadcast test signals via an artificial mouth. Record and export the microphone channel audio using audio_uart_dump.py. Then, analyze the audio files in Audacity.

Reference test

Amplitude, noise floor, frequency response, and THD tests:
The DUT plays and records the audio itself. Use audio_uart_dump.py to generate a test signal, record the audio, and dump it as an audio file for the reference channel. Then, analyze the audio files in Audacity.

Import audio files to Audacity

  1. In Audacity, choose File > Import > Raw Data.

    T5-AI Acoustic Performance Testing

  2. In the Import Raw Data window, configure as shown below:

    T5-AI Acoustic Performance Testing

(Optional) Analyze audio signals using audio_test.py

Open the Windows command prompt, go to the audio_test.py folder, and run the Python script. Example:

d:
cd D:\Test\T5AI-EVB\audio_test
python audio_test.py --mic1 test_1k_mic.pcm --ref  test_1k_ref.pcm --test_case 1k_single

Description of audio_test.py:

  • Command:

    python audio_test.py --mic1 dump_mic.pcm --ref dump_ref.pcm --test_case 1k_single
    
  • Parameters:

    Parameter Description
    mic1 Testing audio file
    ref Reference audio file
    test_case Test cases, including 1k_single, white_noise, and silence
  • Each file is associated with specific test items.

    File Test item
    1K single frequency thdt and dc_offset
    White noise dc_offset, coherence, clip_detect, and delay_stability
    Mute noise_floor
  • Description of test items:

    Parameter Description
    dc_offset Direct current (DC) offset (pass/fail)
    coherence Correlation between microphone and reference (Closer to 1 is better)
    noise_floor Noise floor
    clip_detect Audio clipping detection
    thd THD (Pass/fail)
    delay_stability Audio delay stability

Example:

C:\Users\gerui>d:

D:\>cd D:\Test\AI_Audio_Test\T5AI\Audio_Test_0804

D:\Test\AI_Audio_Test\T5AI\Audio_Test_0804>python audio_test.py --mic1 dump_mic.pcm --ref dump_ref.pcm --test_case 1k_single
Start testing
DC offset
dc offset: Pass
dc offset: Pass
Mic1: -0.000052, Ref: -0.000042

Total harmonic distortion (THD)
THD: Pass
THD: Pass
Mic1: 0.0059, Ref: 0.0017
End of test