diff --git a/pyqtgraph/graphicsItems/PlotDataItem.py b/pyqtgraph/graphicsItems/PlotDataItem.py index 37245bec..11184ae6 100644 --- a/pyqtgraph/graphicsItems/PlotDataItem.py +++ b/pyqtgraph/graphicsItems/PlotDataItem.py @@ -679,10 +679,9 @@ class PlotDataItem(GraphicsObject): x2 = np.linspace(x[0], x[-1], len(x)) y = np.interp(x2, x, y) x = x2 - 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)) + f = np.fft.rfft(y) / y.size + x = np.fft.rfftfreq(y.size) + y = np.abs(f) return x, y def dataType(obj):