When creating a DSP design, one of the most important parameters to consider is the spectrum. In Simulink the spectrum can be easily displayed using a spectrum scope.
Right-click the canvas and type
spectrum
.Connect the spectrum scope at the output of the last filter (the Channel Filter):
Set the Stop Time of the simulation to inf.
Run the simulation. The spectrum scope should display similar to the following:
Now add a block coming from a standard templated C++ kernel which source is in the directory aiecode_src
. This function will be a frequency shift operation that will be placed after the downsampling chain.
Select the block AIE Kernel from the User-defined Functions section of the AI Engine Library and place it in the canvas:
Double-click the block, a GUI will display. Populate it with the following data:
Kernel header file:
aiecode_src / FreqShift.h
Kernel function:
FreqShift
Kernel source file:
aiecode_src / FreqShift.cpp
Click Import. A new GUI displays. FRAME_LENGTH is the template parameter. Its value is
256
because at this stage this is the size of the data frames. The input and output ports have also the same size:256
samples. Click OK.
Place this new block between the ‘AIE FIR Channel’ and ‘To Fixed Size’ blocks. Grab the ‘FreqShift’ block from the Reference Chain Simulink design and place it after the ChannelFilter Simulink block. Your design should now look as follows: