Chapter Summary

Chapter Summary

Key Points

  • 1.

    The FFT is your most important tool. np.fft.fft computes the DFT in O(NlogN)O(N \log N) operations. Use fftfreq for the frequency axis, fftshift for centered spectra, and always match the norm argument between forward and inverse transforms. Zero-padding interpolates the spectrum but does not improve resolution — resolution depends on the observation duration T=N/fsT = N/f_s.

  • 2.

    Choose the right filter type. FIR filters (firwin, remez) are always stable and can have exactly linear phase. IIR filters (butter, cheby1) achieve steeper rolloff with fewer coefficients but can be unstable and have nonlinear phase. Always use the SOS representation (output='sos') for IIR filters to avoid numerical instability from high-order polynomials.

  • 3.

    Window before you FFT. The rectangular window has only 13-13 dB sidelobe suppression. Use Hann for general-purpose analysis, Blackman for high dynamic range, or Kaiser for a configurable trade-off. Use Welch's method (scipy.signal.welch) instead of the raw periodogram for smoother PSD estimates with controlled variance.

  • 4.

    Resample with awareness. resample (FFT-based) assumes periodicity; prefer resample_poly for non-periodic signals. For smooth interpolation of irregularly-spaced data, use CubicSpline. For multi-dimensional regular grids, use RegularGridInterpolator. Always apply anti-aliasing before downsampling.

  • 5.

    Wavelets adapt where Fourier cannot. The DWT provides adaptive time-frequency resolution — short windows at high frequencies, long windows at low frequencies. Wavelet denoising with soft thresholding is near-optimal for piecewise-smooth signals. Use pywt.wavedec/waverec for the DWT and pywt.cwt for scalogram visualization.

Looking Ahead

Chapter 8 applies the optimization tools in SciPy to solve minimization, root-finding, and curve-fitting problems. Many signal processing tasks — like adaptive filtering, spectral estimation, and compressed sensing — are optimization problems in disguise. The FFT and filter design tools from this chapter will reappear as building blocks in those formulations.