This example shows amplitude modulation and demodulation of a signal. The carrier signal's amplitude varies with the content of the message signal by heterodyning the two signals together. Demodulation uses squaring and lowpass filtering to recover the message signal.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.