EE 123 Notes

Discrete Fourier Transform (DFT)
X[k]=n=0N1x[n]ej2πNkn\fbox{$\displaystyle \hspace{20pt} X[k] = \sum^{N-1}_{n=0} x[n]e^{-j\frac{2\pi}{N}kn} \hspace{20pt}$}
Inverse Discrete Fourier Transform (IDFT)

x[n]=1Nk=0N1X[k]ej2πNkn\fbox{$\displaystyle \hspace{20pt} x[n] = \frac{1}{N}\sum^{N-1}_{k=0} X[k]e^{j\frac{2\pi}{N}kn} \hspace{20pt}$}

R.O.C Rules
  1. For a causal system, the ROC extends outwards.
  2. For a non-causal system, the ROC extends inwards.
  3. For two-sided system, the ROC can extend inwards or outwards from every pole.
  4. The ROC cannot contain any poles.
  5. The system is stable if the unit circle is included in the ROC.
  6. For Y(z)=H(z)X(z)Y(z) = H(z) \cdot X(z), the ROC is intersection of H(z)H(z) and X(z)X(z), but if any pole is removed by a zero during division/partial fraction, the ROC can expand.
Z-Transform
X(z)=n=x[n]znz=rejω\fbox{\hspace{20pt}$\displaystyle \begin{aligned} X(z) &= \sum^{\infty}_{n=-\infty} x[n]z^{-n} \\ z &= re^{j\omega} \end{aligned}$\hspace{20pt}}
Inf. Geometric Sum (For Z-transform)
k=0ark=a1r\sum^{\infin}_{k=0}ar^k = \frac{a}{1-r}


a=first term of summation, k=0a=\text{first term of summation, k=0}
r=the stuff that is being poweredr= \text{the stuff that is being powered}
r must be<1 to use geometric seriesr \text{ must be} < 1 \text{ to use geometric series}

Finite Geometric Sum
Sn=a1(1rn1r)S_n = a_1 \bigg( \frac{1-r^n}{1-r} \bigg)
FFT Python

Compute the one-dimensional discrete Fourier Transform

np.fft.fft(a, n)

a = numpy array
n = optional, length of output
(if n > length of input, it becomes zero padding)

Compute the two-dimensional discrete Fourier Transform

np.fft.fft2(a, n)

a = 2D numpy array
n = optional, length of output

Shift the zero-frequency component to the center of the spectrum

np.fft.fftshift(a)

a = numpy array

Compute the 2-dimensional inverse discrete Fourier Transform

np.fft.ifft2(a)

a = numpy array

The inverse of fftshift. (Unshifting from center)

np.fft.ifftshift(a)

a = numpy array

Return the Discrete Fourier Transform sample frequencies (Usually used for x-axis label)

np.fft.fftfreq(n)

n = integer, window length

Short-time Fourier transform
(Librosa is an audio library)

librosa.stft(a, n, h)

a = numpy array
n = integer, window length
h = stride length

Returns frequencies of a FFT

librosa.fft_frequencies(sr, n_fft)

sr = audio sampling rate
n_fft = integer, window length

Inverse short-time Fourier transform

librosa.istft(m, h, l)

m = numpy array/matrix
h = stride length
l = optional, length of output

2 Channel Filter Bank
Ching Yuen