-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is not always obvious there is a peak frequency, what to do about those trials? #40
Comments
One thing to try: smooth the spectrum more. Edit: this has been done. |
We could calculate the median (basically the 50% area mark). In fact, I think that is what I've often reported in the past for such an analysis. |
This function actually calculates a box plot type values of a given curve: https://dynamicisttoolkit.readthedocs.io/en/latest/dtk.html#dtk.process.curve_area_stats |
Here is an example of calculating a box plot from the area under the frequency spectrum: >>> freq, amp, _, _ = tr.calculate_frequency_spectrum("SeatBotacc_ver", 400, smooth=True)
>>> from dtk.process import curve_area_stats
>>> curve_area_stats(freq, np.atleast_2d(amp).T)
{'2p': array([3.44238281]),
'lq': array([8.66699219]),
'median': array([27.19726562]),
'uq': array([83.203125]),
'98p': array([182.39746094])}
>>> fig, ax = plt.subplots()
>>> ax.bxp([{'med': 27.197, 'q1': 8.67, 'q3': 83.20, 'whislo': 3.44, 'whishi': 182.40}], vert=False, showfliers=False)
{'whiskers': [<matplotlib.lines.Line2D at 0x7dbb0fe35a90>,
<matplotlib.lines.Line2D at 0x7dbb0fe35bd0>],
'caps': [<matplotlib.lines.Line2D at 0x7dbb0fe35d10>,
<matplotlib.lines.Line2D at 0x7dbb0fe35e50>],
'boxes': [<matplotlib.lines.Line2D at 0x7dbb0fe35810>],
'medians': [<matplotlib.lines.Line2D at 0x7dbb0fe35f90>],
'fliers': [],
'means': []}
>>> plt.show() |
Riender suggested finding multiple peaks for some trials (this could help https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html). |
From Riender:
|
I've switched to ISO weighted spectrums so this changes the frequency spectrum plots and thus the peak frequency and bandwidth. Need to review new plots. |
|
The reasoning is that the first peaks likely correspond to the same mechanical cause and that following peaks may be harmonics.
Frequency spectrums have units, raw FFT will be (physical unit)/Hz. I've normalazid wrt to Hz so we get the unit of the signal. This has a good explanation if you want to read about it: https://docs.scipy.org/doc/scipy-1.15.0/tutorial/signal.html#continuous-time-sine-signal I present that "Amplitude Spectrum" shown on that page.
This is explained in the paper and my prior presentations. I choose 80% of the area under the smoothed spectrum. It is just a way to show where most (being 80%) of the power is in the frequency spectrum. I will change the name later.
For the January 31st deadline, I don't intend to dig in fine detail about the peak analysis. |
For the Jan 31 report, I just said we sometimes pick the second peak. Still needs addressing for the journal submission. |
For example, session 006 klinkers:
There are basically two dominate frequencies with similar amplitude peaks.
Session 007 klinkers is similar:
Session 007 tarmac:
The text was updated successfully, but these errors were encountered: