d3 $note ((scaleP scalePattern$ (rotR 4) $(+ slow 8 "x" <~> ((0.25 ~>) generateMelodicSeed)) --$ slow 4 \n $generateMelodicSeed ))#s "[pe-gtr:8,midi]" #gain 1.2 #orbit 2 #midichan 3   d2$ note ((scaleP scalePattern $(rotR 3.5) --$ inversion \n $(+ slow 8 "x" <~> ((0.5 ~>) generateMelodicSeed)) --$ slow 2 \n $generateMelodicSeed ) - 12)#s "[pe-gtr:9,midi]" #gain 1.2 #orbit 1 #midichan 2   do cps (86/60/2) d9$ midicmd "midiClock*48" # s "midi"   d1 $note ((scaleP scalePattern$ off 4 ((+ 2 ).slow 2) $off 1 (inversion.slow 2)$ off 3 (inversion.slow 3) $off 1.5 ((+ 2).rev.slow 2)$ generateMelodicSeed ))#s "[pe-gtr:10,midi]" #gain 1 #orbit 0 #midichan 1 

# Fourier Series

Fourier’s theorem states that any periodic function can be approximated perfectly by some weighted sum of harmonic sine and cosine waves. This sum is often infinite. (see: wikipedia)

Arbitrary signals can be analyzed to determine the weights for the Fourier series that approximates them. This kind of analysis can be used to transform a [[ Time Domain]] signal into a [[Frequency Domain]] signal. This transformation is the first step in a variety of [[Spectral Processing ]] algorithms.

In calculus this is represented by the [[ Fourier Transform]]. For DSP and digital audio a variety of [[Discrete Fourier Transform (DFT) ]] algorithms exist. Some of these algorithms can operate in real time.

Since Fourier’s theorem only holds for signals that are perfectly periodic (ie. signals that repeat exactly forever) these transform algorithms often slice an input signal into “windows”. Each window is assumed to repeat forever so that the frequencies present in each window can be derived by computing the Fourier transform. This “windowing” operation is a source of error and is an example of an [[ orthogonal property ]]. The more you know about the signals what frequencies are present in a window (ie. a larger window size), the less you know about when those frequencies occurred in the time domain.