FFT is one of sevel methods to compute discrete Fourier transform

Example with input signal of 256 length:

y = fft(x)

x: 256 values sampled at fs Hz

y: 256 values where y[i] is value at frequency i * fs / 256

- Use y[0 to 128] because the second half is the same if x is real
- Use abs(y[i]) because y[i] is complex
- RDFT (real discrete fourier transform) is FFT optimized for case when x is real
- Before FFT, multiplying each element of x by signal.get_window(('tukey', 0.25), 256) extracts frequencies better in my experience (this is default in scipy.spectrogram)

Power Spectral Density (V^2/Hz) where x (V) and fs (Hz)

d = psd(y)

d[0] = 0

d[1 to 127] = abs(y[i])^2 / (fs * 128)

d[128] = abs(y[i])^2 / (fs * 256)