I am writing a program to generate audio frequencies in multi-channel PCM format. This question may be more suited on an audio forum but I would like to know what is going on mathematically.
My understanding is that audio is represented as a sum of multiple fundamental frequencies at various points in time. Each fundamental frequency can be represented as amplitude versus time $amplitude=f(time)$.
I use the following formula to generate each fundamental frequency and plot it visually.
$a[t] = Sine((f*t)+p) * ma$
where t = time f = desired frequency (per second) p = phase shift (offset for delays, etc.) ma = maximum amplitude to restrict to (between 0 and 1)
The three images below use the same formula but the last two are not making a uniform sine wave as I would have expected (consider only track 01 in the images). So there is either something wrong with the formula or my understanding of fundamental frequencies in audio.
If my expectation about uniform sine waves if wrong, then Fourier Transforms wouldn't be possible would they?
Any advice would be appreciated.