Before modulation, you need to make sure that the sampling rate (in samples per second) of the source signal is greater than twice the carrier frequency (in hertz). Otherwise, you will end up with aliasing.
- Create a column vector containing a cosine wave at the desired carrier frequency.
- Multiply the source signal by the cosine wave and store the result in another column vector.
- The result is the amplitude modulated version of the source signal.