Onepredict / onebone

An Open Source Signal Processing Library for Sensor Signals about vibration, current, etc.
MIT License
18 stars 3 forks source link

docs: `positive_fft` example 수정 #62

Closed Kangwhi-Kim closed 2 years ago

Kangwhi-Kim commented 2 years ago
N = 400 # array length
fs = 800 # Sampling frequency
T = 1 / fs # Sample interval time
x = np.linspace(0.0, N * T, N, endpoint=False) # time
y = 3 * np.sin(50.0 * 2.0 * np.pi * x) + 2 * np.sin(80.0 * 2.0 * np.pi * x)
signal = y
f, x_mag = positive_fft(signal, fs, hann = False, normalization = False, axis = -1)
freq = np.around(f[np.where(x_mag > 1)])
freq

Fs -> fs, axix -> axis , false -> False, mag -> x_mag