Skip to main content

Module spectral

Module spectral 

Source
Expand description

Spectral methods — FFT-based PDE solving for periodic domains.

Functions§

dft
1D Discrete Fourier Transform (naive O(n²) — for correctness; production uses FFT).
idft
1D Inverse DFT.
power_spectrum
Power spectrum (magnitude² of DFT coefficients).
spectral_heat_step
Solve the 1D heat equation spectrally: u_t = α * u_xx on periodic domain [0, L].