FFT-Python icon indicating copy to clipboard operation
FFT-Python copied to clipboard

Part one of the tutorial - amplitude goes down to 87.84 when changing frequency to 3.25 [Hertz]

Open haimivan opened this issue 5 years ago • 0 comments

Hi,

in the first part of the tutorial: if I change the frequency from 3.0 [Hertz] to 3.25:

t = np.linspace(0, 2*np.pi, 1000, endpoint=True)
f = 3.250 # Frequency in Hz
A = 100.0 # Amplitude in Unit
s = A * np.sin(2*np.pi*f*t) # Signal

I get a maximum amplitude different than 100 in the fft regime:

Yhann = np.fft.fft(hann*s)
print("(2.0*np.abs(Yhann[:N])/N).max():", (2.0 * np.abs(Yhann[:N]) / N).max())

(2.0*np.abs(Yhann[:N])/N).max(): 87.83995835994367

This probably is due to leaking, isn't it?

Apart from adjusting the sampling frequency: how else could I correct that (I have heard of using the sinc() function but am unsure how this should be performed)?

haimivan avatar Apr 04 '19 10:04 haimivan