Why Img2Num Uses the DFT
- Inputs are digital — images and arrays are sampled and finite; the DFT exactly models the transform we can compute on them.
- Finite memory — continuous transforms need infinite support; DFT works with finite-length vectors held in RAM.
- Efficient algorithms exist — the FFT computes the DFT quickly ( rather than ).
- Discrete manipulations match implementation — convolution via multiplication in frequency domain, frequency-domain filters (Gaussian, high/low-pass) operate on bins.
- Compatibility with image processing conventions — 2D DFT is separable: apply 1D DFT across rows then columns (or vice versa); per-channel processing is straightforward.
Practical consequences to document in the repo
- Zero-padding to reduce circular convolution effects.
- Windowing to reduce spectral leakage.
fft shift/ifft shiftto center the zero frequency for visualization.- Explain per-channel transforms for multi-channel images (RGB).