6 Generating Amplitude Modulated Signal Using 10-bit DAC
The DAC can be used to generate amplitude modulated signal. In this case, the DAC uses the voltage reference from the VREFA pin as modulation waveform (information signal), while it is configured to generate sine wave for the carrier signal.
VREF.DAC0REF = VREF_REFSEL_VREFA_gc;
Therefore, the amplitude of the carrier signal will vary according to the signal that needs to be modulated.
Based on the carrier wave frequency (SIGNAL_FREQ), the core will use a fixed number of samples (N_SAMPLES) to build the signal as described in “Generating Sine Wave Signal Using 10-Bit DAC”. The resulting sample rate will be:
The resulting modulated signal will be available on the DAC output external pin (PD6).
In this example, a 50 Hz sine wave is used as the carrier signal and the modulated signal is a 2 Hz sine wave from a signal generator.