python - Frequency resolution issue using FFT in numpy -


i use tektronix oscilloscope perform signal acquisition. 10.000 measurement points (few signal periods) , have frequency analysis on set of data. signal 8mhz sine wave. when use either scipy or numpy same result - frequencies spreaded wide. distance between 2 values 500khz , highest frequency 2.5ghz (absurd). when want measure frequency bandwidth around 8mhz can exact values of 7.5, 8.0 , 8.5 mhz. tried change sample spacing determined (x[1]-x[0]) , got nothing better.

def calculatefft(t_val,p_val):     x = t_val #two parameters: [x,y] values     y = lambda x: p_val     com_signal = y(x) # combined signal     fft_val = abs(scipy.fft(com_signal))     freq_val = scipy.fftpack.fftfreq(len(com_signal), x[1]-x[0])     spec_val = 20*scipy.log10(fft_val)     return freq_val, spec_val 

it worth reading in more depth how dffts work should have following formulae in mind. time series n points , maximum time tmax, time resolution given dt = tmax / n

a dfft produce n points

fmax = 1 / dt

df = 1 / tmax

you seem suggest maximum frequency sufficient (so time resolution okay) frequency resolution isn't enough: need collect more data, @ same time resolution.


Comments