]> git.unchartedbackwaters.co.uk Git - francis/ofc.git/commitdiff
Add notes on properties of discrete Fourier transforms.
authorFrancis Russell <francis@unchartedbackwaters.co.uk>
Fri, 30 Nov 2012 22:22:50 +0000 (22:22 +0000)
committerFrancis Russell <francis@unchartedbackwaters.co.uk>
Fri, 30 Nov 2012 22:38:26 +0000 (22:38 +0000)
docs/fft.txt [new file with mode: 0644]

diff --git a/docs/fft.txt b/docs/fft.txt
new file mode 100644 (file)
index 0000000..f922e01
--- /dev/null
@@ -0,0 +1,53 @@
+FFTs and their properties
+-------------------------
+
+- Some definitions:
+
+  cos(x) =   0.5 * (e^{ix} + e^{-ix})
+
+  sin(x) =   0.5 * i(e^{-ix} - e^{ix})
+
+  i*cos(x) = 0.5 * i(e^{ix} + e^{-ix})
+
+  i*sin(x) = 0.5 * (e^{ix} - e^{-ix})
+
+  Note that division by i is equivalent to multiplication by -i.
+
+- Amplitudes of sinusoidal components (ignoring scaling factors) where
+  f_p and f_n represent the positive and negative frequency components
+  respectively:
+
+  cos(x)   -> real(f_p) + real(f_n)
+  sin(x)   -> imag(f_n) - imag(f_p)
+  i*cos(x) -> imag(f_p) + imag(f_n)
+  i*sin(x) -> real(f_p) - real(f_n)
+
+- For real input data, the first coefficient (constant) will always be
+  real.
+
+- Upsampling and downsampling may require multiplication by a scaling
+  factor to retain the same amplitude.
+
+For even numbers of points:
+
+- For real input data, the highest frequency coefficient will be real
+  since only cos can be represented.
+
+- Example coefficient layout for real data (6 samples):
+[c0, c1, c2, c3, c2, c1]
+
+- When upsampling, the central coefficient (Nyquist) becomes two
+  coefficients, each half the value of the original.
+
+- When downsampling to even, we can choose to average the positive and
+  negative frequency coefficients together to form the new Nyquist
+  coefficient. This discards the sin components and preserves the cos
+  components of both the real and imaginary signals.
+
+For odd numbers of points:
+
+- For real input data, the highest frequency component will be complex
+  valued.
+
+- Example coefficient layout for real data (5 samples):
+[c0, c1, c2, c2, c1]