Changing Coefficients During Runtime - 2022.2 English

Vitis Tutorials: AI Engine (XD100)

Document ID
XD100
Release Date
2022-12-01
Version
2022.2 English

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

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

The frequency response with a 20MHz passband is shown below.

Fig. 3

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

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

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 that 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 shown below (use check2.jl).

Fig. 5

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

In the second half, the coefficients are for a 20MHz filter, thus, both 2MHz and 18MHz 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 a Vitis design from scratch.