Julia Script - 2023.2 English

Vitis Tutorials: AI Engine

Document ID
Release Date
2023.2 English

aie_iir_1b.jl is a Julia script which can design and generate the required SIMD coefficients for an arbitrary IIR filter.

In its pristine state, the user parameters are as follows:

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

if first_set
    fp = 10.0e6         	# passband frequency
    coeff_file_suffix = "a"	# file suffix to distinguish different coefficient sets
                        	# with the same architecture
    fp = 20.0e6         	# passband frequency
    coeff_file_suffix = "b" 	# 2nd set of coefficients
end # if first_set

fs = 100.0e6            # sampling frequency
p = 6                   # no. of poles
rp = 0.1                # passband ripple (dB)
rs = 80.0               # stopband attenuation (dB)
N = 256                 # no. of samples for impulse response
show_plots = true       # display plots?
write_cmatrix = true    # write C matrix to files?
write_impulse = true    # write impulse response?

Start Julia and run the script using the following commands:

julia> cd("{specify_path_to_aie_iir_1b.jl}")
julia> include("aie_iir_1b.jl")

This plots the filter characteristics and generates three coefficient files (C[1~3]a.h), as there are six poles in the filter.

Fig. 1

The kernel code remains the same, but the ADF graph and testbench must be slightly modified to accommodate the additional sections.

Move the generated *.dat files into the data directory and the generated *.h files (coefficient files) into the src directory.