>>> import numpy as np
>>> a = np.vstack([np.ones(11), np.arange(11)])
# We have two channels along axis 0, the signals are along axis 1
>>> a
array([[ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.],
[ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]])
>>> np.fft.irfft(np.fft.rfft(a, axis=1), axis=1)
array([[ 1.1 , 1.1 , 1.1 , 1.1 ,
1.1 , 1.1 , 1.1 , 1.1 ,
1.1 , 1.1 ],
[ 0.55 , 1.01836542, 2.51904294, 3.57565618,
4.86463721, 6.05 , 7.23536279, 8.52434382,
9.58095706, 11.08163458]])
# irfft returns an even number along axis=1, even though a was (2, 11)
# When a is even along axis 1, we get a back after the irfft.
>>> a = np.vstack([np.ones(10), np.arange(10)])
>>> np.fft.irfft(np.fft.rfft(a, axis=1), axis=1)
array([[ 1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00, 1.00000000e+00, 1.00000000e+00,
1.00000000e+00],
[ 7.10542736e-16, 1.00000000e+00, 2.00000000e+00,
3.00000000e+00, 4.00000000e+00, 5.00000000e+00,
6.00000000e+00, 7.00000000e+00, 8.00000000e+00,
9.00000000e+00]])
# It seems like you signals are along axis 0, here is an example where the signals are on axis 0
>>> a = np.vstack([np.ones(10), np.arange(10)]).T
>>> a
array([[ 1., 0.],
[ 1., 1.],
[ 1., 2.],
[ 1., 3.],
[ 1., 4.],
[ 1., 5.],
[ 1., 6.],
[ 1., 7.],
[ 1., 8.],
[ 1., 9.]])
>>> np.fft.irfft(np.fft.rfft(a, axis=0), axis=0)
array([[ 1.00000000e+00, 7.10542736e-16],
[ 1.00000000e+00, 1.00000000e+00],
[ 1.00000000e+00, 2.00000000e+00],
[ 1.00000000e+00, 3.00000000e+00],
[ 1.00000000e+00, 4.00000000e+00],
[ 1.00000000e+00, 5.00000000e+00],
[ 1.00000000e+00, 6.00000000e+00],
[ 1.00000000e+00, 7.00000000e+00],
[ 1.00000000e+00, 8.00000000e+00],
[ 1.00000000e+00, 9.00000000e+00]])