Jul-23-2022, 05:17 PM
Hi,
I have velocity data calculated from acceleration and I want to make FFT. Data seems ok (checked by function generator).
But all the time I have peak frequency double. I tried many changes but still the same. For raw data for acceleration it works well.
https://ibb.co/2t3Bc4S
Sample data:
https://www.uschovna.cz/en/zasilka/AMPMW8GUIC5FRYSR-Y2X
You can see peak at frequency 100Hz but signal generator has 50Hz.
I am sorry, it is not full working code because all code is very complex.
Any idea please? Thanks
I have velocity data calculated from acceleration and I want to make FFT. Data seems ok (checked by function generator).
But all the time I have peak frequency double. I tried many changes but still the same. For raw data for acceleration it works well.
lowcut_mm_fft = self.window1.spin_fft_mm_low.value() #10.0 highcut_mm_fft = self.window1.spin_fft_mm_high.value() #1500.0 fft_mm_order = self.window1.spin_fft_mm_ord.value() #4 fft_min_mm = self.window1.spin_fft_mm_min.value() #FFT show from Hz fft_max_mm = self.window1.spin_fft_mm_max.value() # FFT show to Hz SAMPLES = self.window1.spin1.value() #number of samples = 30000 SPS = self.window1.spin2.value() # samples per second = 30000 if self.window1.combo1.currentText() == "Hanning": okno = signal.windows.hann(SAMPLES) if self.window1.combo1.currentText() == "Hamming": okno = signal.windows.hamming(SAMPLES) if self.window1.combo1.currentText() == "Flat": okno = signal.windows.flattop(SAMPLES) if self.window1.combo1.currentText() == "None": okno = 0.5 self.velocity_fft = np.sqrt(self.velocity_fft) self.velocity_fft = butter_bandpass_filter(self.velocity_fft, lowcut_mm_fft, highcut_mm_fft, SPS, order=fft_mm_order) self.velocity_fft = self.velocity_fft * okno self.velocity_fft = self.velocity_fft * 2 yf = scipy.fft.fft(self.velocity_fft) yf = 2 / SPS * np.abs(yf) xf = fftfreq(SAMPLES, T)[:SAMPLES//2] self.canvas.axes.set_ylabel("Amplitude in mm/s") self.canvas.axes.set_xlabel("Frequency in Hz") self.canvas.axes.plot(xf[fft_min_mm:fft_max_mm ], yf[fft_min_mm:fft_max_mm ], 'b') self.canvas.axes.grid() self.canvas.axes.autoscale() self.canvas.draw()FFT image:
https://ibb.co/2t3Bc4S
Sample data:
https://www.uschovna.cz/en/zasilka/AMPMW8GUIC5FRYSR-Y2X
You can see peak at frequency 100Hz but signal generator has 50Hz.
I am sorry, it is not full working code because all code is very complex.
Any idea please? Thanks