Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A vibration sensor reads every s for s, which is readings. The signal holds a Hz wave of amplitude and an Hz wave of amplitude . How far apart are the frequencies of the FFT, and which frequency is the strongest?
np.fft.rfftfreq(n, d) gives frequencies apart, and the tallest bar of np.abs(np.fft.rfft(y)) is the main frequency. A reading rate can show frequencies up to ; above that a wave aliases to . curve_fit returns popt and pcov, and the errors are np.sqrt(np.diag(pcov)).
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Step 1. The spacing. The record lasts s, so the frequencies are Hz apart.
Step 2. The two waves. Hz and Hz are both multiples of Hz, so each lands exactly on a bar.
Step 3. The strongest. The Hz wave has the larger amplitude, against , so its bar is the tallest.
Answer: Hz apart, and the strongest frequency is Hz.
Log in to join the discussion.
Loading…