Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A fit with curve_fit gives an amplitude of m. The first number on the diagonal of pcov is m. What is the error of the amplitude? What percent of m is it?
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 error. pcov holds squares, so m.
Step 2. The percent. %.
Step 3. Report it. The amplitude is m.
Answer: m, which is % of the amplitude.
Log in to join the discussion.
Loading…