I understand that rfft duplicates centerline, irfft should remove it, i suppose. Im using onesided=False instead, but unless im mistaken theres a few code lines that must be missing
Due to the conjugate symmetry, input do not need to contain the full complex frequency values. Roughly half of the values will be sufficient, as is the case when input is given by rfft() with rfft(signal, onesided=True) . In such case, set the onesided argument of this method to True . Moreover, the original signal shape information can sometimes be lost, optionally set signal_sizes to be the size of the original signal (without the batch dimensions if in batched mode) to recover it with correct shape.