What FFT descriptors should be used as feature to implement classification or clustering algorithm?

谁都会走 提交于 2019-12-02 17:46:23

Generally you should extract just a small number of "Features" out of the complete FFT spectrum.

First: Use the log power spec. Complex numbers and Phase are useless in these circumstances, because they depend on where you start/stop your data acquisiton (among many other things)

Second: you will see a "Noise Level" e.g. most values are below a certain threshold, ignore all these values.

Third: If you are lucky, e.g. your data has some harmonic content (cycles, repetitions) you will see a few prominent Peaks.

If there are clear peaks, it is even easier to detect the noise: Everything between the peaks should be considered noise.

Now you may search for the two, three largest peaks and use their location and probably widths as "Features" for further classification.

Location is the x-value of the peak i.e. the 'frequency'. It says something how "fast" your cycles are in the input data.

If your cycles don't have constant frequency during the measuring intervall (or you use a window before caclculating the FFT), the peak will be broader than one bin. So this widths of the peak says something about the 'stability' of your cycles.

Based on this: Two patterns are similar if the biggest peaks of both hava a similar frequency and a similar widths, and so on.


EDIT

Very intersiting to see a logarithmic power spectrum of one of your examples.

Now its clear that your input contains a single harmonic (periodic, oscillating) component with a frequency (repetition rate, cycle-duration) of about f0=0.04. (This is relative frquency, proprtional to the your sampling frequency, the inverse of the time beetween individual measurment points)

Its is not a pute sine-wave, but some "interesting" waveform. Such waveforms produce peaks at 1*f0, 2*f0, 3*f0 and so on. (So using an FFT for further analysis turns out to be very good idea)

At this point you should produce spectra of several measurements and see what makes a similar measurement and how differ different measurements. What are the "important" features to distinguish your mesurements? Thinks to look out for:

  • Absolute amplitude: Height of the prominent (leftmost, highest) peaks.
  • Pitch (Main cycle rate, speed of changes): this is position of first peak, distance between consecutive peaks.
  • Exact Waveform: Relative amplitude of the first few peaks.

If your most important feature is absoulute amplitude, you're better off with calculating the RMS (root mean square) level of our input signal.

If pitch is important, you're better off with calculationg the ACF (auto-correlation function) of your input signal.

Don't focus on the leftmost peaks, these come from the high frequency components in your input and tend to vary as much as the noise floor.

Windows

For a high quality analyis it is importnat to apply a window to the input data before applying the FFT. This reduces the infulens of the "jump" between the end of your input vector ant the beginning of your input vector, because the FFT considers the input as a single cycle.

There are several popular windows which mark different choices of an unavoidable trade-off: Precision of a single peak vs. level of sidelobes:

You chose a "rectangular window" (equivalent to no window at all, just start/stop your measurement). This gives excellent precission of your peaks which now have a width of just one sample. Your sidelobes (the small peaks left and right of your main peaks) are at -21dB, very tolerable given your input data. In your case this is an excellent choice.

A Hanning window is a single cosine wave. It makes your peaks slightly broader but reduces side-lobe levels.

The Hammimg-Window (cosine-wave, slightly raised above 0.0) produces even broader peaks, but supresses side-lobes by -42 dB. This is a good choice if you expect further weak (but important) components between your main peaks or generally if you have complicated signals like speech, music and so on.


Edit: Scaling

Correct scaling of a spectrum is a complicated thing, because the values of the FFT lines depend on may things like sampling rate, lenght of FFT, window, and even implementation details of the FFT algorithm (there exist several different accepted conventions).

After all, the FFT should show the underlying conservation of energy. The RMS of the input signal should be the same as the RMS (Energy) of the spectrum.

On the other hand: if used for classification it is enough to maintain relative amplitudes. As long as the paramaters mentioned above do not change, the result can be used for classification without further scaling.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!