Code Example - 2025.1 English

Vitis Libraries

Release Date
2025-06-04
Version
2025.1 English

The following code example shows how the DDS/Mixer graph class can be used within a user super-graph to use an instance configured as a mixer.

#include <adf.h>
#include "dds_mixer_graph.hpp"

namespace dds_example {
#define DDS_DATA_TYPE cint16
#define DDS_INPUT_WINDOW_VSIZE 1024
#define MIXER_MODE 1
#define DDS_NITER 4
#define USE_PHASE_RELOAD 0
using namespace adf;

class test_dds : public graph {
   public:
    port<input> in;
    port<output> out;
    static constexpr unsigned int phaseInc = 0xD6555555;
    static constexpr unsigned int initialPhaseOffset = 0;
    test_dds() {
        xf::dsp::aie::mixer::dds_mixer::dds_mixer_graph<DDS_DATA_TYPE, DDS_INPUT_WINDOW_VSIZE, MIXER_MODE> mixer(
            phaseInc, initialPhaseOffset);

        connect<>(in, mixer.in1[0]);
        connect<>(mixer.out[0], out);
        kernel* kernels = mixer.getKernels();
        runtime<ratio>(*kernels) = 0.5;
    };
};
};