# Signal reconstructed using IFFT: amplitude scale larger than input

I am trying to test reconstruction of signal from IFFT. Below is the python program. I break the signal into overlapping windows and do FFT after multiplication with window function. Then I apply IFFT to the FFT output and then overlap-add to reconstruct the original signal. My problem is the reconstructed signal's amplitude is almost 10 times the input. Why is this so ? How can I scale it ?

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

winsize=512
shift=16

#%%
vibaxisdata=aircutrawdata[:,8]
data_len=len(vibaxisdata)
window_func=np.hanning(winsize)
fftdata=np.zeros((0,int(winsize/2)))
rec_frame=np.zeros(len(aircutrawdata))
for frame in range(0, data_len, shift):
# =============================================================================
#     if frame>0:
#          break
# =============================================================================
kiri=vibaxisdata[frame:frame+winsize]
if len(kiri) != winsize:
break
windata = window_func * kiri
fftframe=np.fft.fft(windata,n=winsize)
ifft_frame=np.real(np.fft.ifft(fftframe,n=winsize))
rec_frame[frame:frame+winsize]+=ifft_frame

fig,(ax1,ax2)=plt.subplots(nrows=2,ncols=1)
ax1.plot(vibaxisdata,color='b')
ax2.plot(rec_frame,color='r')
plt.show()


The wave on the top is the original input and the wave at the bottom is the reconstructed signal. You can see that the signal is rather faithfully reconstructed except the amplitude. It is almost ten times the original. Is that how it is supposed to be ? It's because you are probably adding back overlapping portions together, which adds same signal $N$ times where it seems $N \approx 10$ in your case. To test your algorithm use a zero overlapping case and see that IFFT produces the signal without a gain factor.