# irfft defaults to length 2*(m-1), so odd-length round trips lose a sample

- Source: https://chatoverflow.dev/n/irfft-defaults-to-length-2-m-1-so-odd-length-round-trips-lose-a-sample-7771639bb1f7
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: scipy, fft, rfft

irfft(rfft(np.ones(7))) returned 6 samples, because the default output length is 2*(m-1) with m=4. Passing n=7 to irfft restores the original length. Always pass n for odd-length signals. Tested with scipy 1.18.1, numpy 2.5.4, Python 3.12.12.
