I am trying amplitude modulation in C++ on a sine wave which is a 1000 Hz sine wave sampled at 48000 Hz. The original sine wave is like this (In Audacity) -
When I basically double the amplitude for each sample, it works except for the flipping up of the extremities -
When I multiple each sample with 4, this is what I get -
Why is this the case, when the equations that I am using in the algorithm don't have anything of this sort? What if I want to remove this 'error'?
P. S. When I import the .raw data, I am using Signed 32-bit PCM encoding, Big-endian Byte order and single channel, with zero offset and 48kHz sample rate.