Changing Coefficients During Runtime - 2023.2 English

Vitis Tutorials: AI Engine (XD100)

Document ID
XD100
Release Date
2024-03-05
Version
2023.2 English

We set first_set to false in aie_iir_1b.jl as follows to generate another set of coefficients for an LPF with a passband of 20 MHz.

first_set = false;	# true: 1st set; false: 2nd set
...

The frequency response with a 20MHz passband is as follows:

Fig. 3

Move the generated *.h (coefficient files) to src and impresponse_b.dat to data.

We use two_freqs.jl to generate an input signal (two_freqs.dat) with two frequencies (f1 = 2 MHz, f2 = 18 MHz) to test the functionality of coefficient switching. The time and frequency domain plots of the signal are as follows:

Fig. 4

Move the generated two_freqs.dat to data.

In the testbench (tb.cpp), we uncomment #define RTP_SWITCH to include the second set of coefficients.

Note: A wait() statement is required to allow the specified number of iterations to complete before loading the new set of coefficients.

The output of the AI Engines is as follows (use check2.jl):

Fig. 5

The first half of the plot used coefficients for a 10 MHz filter. Thus, only the noisy 2 MHz component passed and the 18 MHz component was significantly attenuated.

In the second half, the coefficients are for a 20 MHz filter. Thus, both 2 MHz and 18 MHz components are seen at the output.

The complete design is included in the data and src directories. Refer to the aie_exp/Part1 tutorial if you are unfamiliar with building an AMD Vitis™ design from scratch.