Код: Выделить всё
import numpy as np
import matplotlib.pyplot as plt
# sampling rate
dt = 0.01 # 0.01초 간격
# rpm raw data
data1 = np.array([735, 743, 744, 739, 734, 752, 750, 745, 739, 751, 751, 745, 740, 757, 755, 749, 743, 745, 748, 742, 736, 748, 747, 741, 734, 751, 752, 747, 740, 737, 734, 730, 722, 731, 737, 732, 723, 738, 747, 743, 734, 747, 751, 749, 738, 750, 759, 755, 746, 752, 757, 753, 744, 747, 756, 753, 743, 749, 754, 752, 742, 743, 750, 747, 738, 740, 745, 745, 734, 737, 746, 746,734, 747, 754, 752, 741, 746, 753, 753, 741, 745, 752, 751, 741, 749, 759, 758, 746, 754,761, 760, 748, 753, 761, 761, 750, 751, 756, 757])
# FFT
fft_result1 = np.fft.fft(data1)
fft_magnitude1 = np.abs(fft_result1)
N = len(data1)
freq = np.fft.fftfreq(N, d=dt)
# plot
plt.figure(figsize=(10, 6))
plt.plot(freq, fft_magnitude1, label='Signal 1')
plt.title('FFT Result')
plt.xlabel('Frequency (Hz)')
plt.ylabel('Magnitude')
plt.xlim(4, 50)
plt.ylim(0, 500)
plt.xticks(np.arange(4, 51, 2))
plt.legend()
plt.grid(True)
plt.show()
Ось x находится в [Гц] / ось Y находится в [Гц]. n/rpm]

Подробнее здесь: https://stackoverflow.com/questions/782 ... t-doesnt-w