After FFT I've set to zero some frequencies and I'd like to enhance the amplitude in order to recover the leak.
I'd like to do a normalization in order to avoid distortion.
I've done in this way but the new signal is between 0 and 1 and so the result is incorrect:
maximum_data = np.max(fftdata) minimum_data = np.min(fftdata) maximum_abs = np.max(fftabs) minimum_abs = np.min(fftabs) normalization_factor = ((2**16)/2)-1 for i in range(len(fftdata)): fftdata[i] = ((fftdata[i] - minimum_data)/(maximum_data - minimum_data))*normalization_factor fftabs[i] = ((fftabs[i] - minimum_abs)/(maximum_abs - minimum_abs))*normalization_factor
How can I resolve the problem? What is the correct formula?