I have a concern about the FFT that is calculated with a right click on plots. It is my rudimentary understanding of the FFT algorithm that it expects samples equally spaced in the time domain. The application I wrote takes data from external hardware sensors that send data in roughly equal time intervals, but not exactly. Does the algorithm implemented account for this potentially uneven time sampling or not?The reason I have doubt is that I implemented a sine wave fitting algorithm that visibly does a very good job lining up with the data, but upon comparison in the transform view, the two peaks (peak of sine wave and peak of data) are often off by 10-20% or so.
if self.opts['fftMode']:f = np.fft.fft(y) / len(y)y = abs(f[1:len(f)/2])dt = x[-1] - x[0]x = np.linspace(0, 0.5*len(x)/dt, len(y))
if self.opts['fftMode']:dx = np.diff(x)uniform = not np.any(np.abs(dx-dx[0]) > (abs(dx[0]) / 1000.))if not uniform:import scipy.interpolate as interpx2 = np.linspace(x[0], x[-1], len(x))y = interp.griddata(x, y, x2, method='linear')x = x2f = np.fft.fft(y) / len(y)y = abs(f[1:len(f)/2])dt = x[-1] - x[0]x = np.linspace(0, 0.5*len(x)/dt, len(y))
--
-- [ You are subscribed to pyqt...@googlegroups.com. To unsubscribe, send email to pyqtgraph+...@googlegroups.com ]
---
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.