Generate a sinusoid function to data
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi there,
On beforehand, I want to say that I am a complete rookie when it comes to using Matlab.
So I'm trying to create a classification based of a set of data. The data is created by an instrument which measures N (m/s2) over time. I want the classification to be represented by an equation or function. In figure 1 I plotted the data over n.

The eventual goal is to fit the generated equation to multiple datasets.
Does anyone know if it's possible to generate a function or equation to this graph? Is it best to generate an sinusoid function? And how can I do this using Matlab?
Cheers,
Tim
0 Kommentare
Antworten (2)
Star Strider
am 3 Mai 2017
I do not know what you mean by ‘classification’. If your signal is composed of several different signals and you want a relatively straightforward way of determining what they are, the procedure most likely to give you the result you want is independent component analysis. Search the File Exchange for an appropriate approach for your data.
If you simply want to do curve-fitting of your data, it is best to begin by calculating the fft (link) of your data to determine the significant frequency components. There appear to be several in your data.
I would then use bandpass filters for each significant frequency (Chebyshev Type II design would likely be best), then fit the output of each filter using for example the procedure in Curve fitting to a sinusoidal function (link), or How to filter noise from time-frequency data and find natural frequency of a cantilever? (link). The final fitted function would be the sum of these. You can at best get an approximation.
2 Kommentare
Star Strider
am 8 Mai 2017
My pleasure.
With your clarification, independent component analysis is likely the most appropriate procedure. You would have to use it separately on each activity segment. Then a Fourier transform fft (link) if necessary would further identify the frequency components.
For references, I would begin with Independent Compononent Analysis: A Tutorial Introduction (ISBN: 9780262693158), and the File Exchange contribution PCA and ICA Package (link).
Also, the short-time Fourier transform (STFT, the spectrogram function) is used in electroencephalogram pattern classification (I published on this a couple decades ago), and the same approach could be appropriate for what you are doing. We used a linear discriminant analysis with PCA, but there are likely better and more efficient classification methods available now, including neural nets.
Greg Heath
am 8 Mai 2017
If you only have the three classes shown, it looks like they can be classified using their spectral representations via, for example, the amplitudes obtained from a fft.
It looks like a simple classifier like LINEAR, QUADRATIC or NEAREST-NEIGHBOR using spectral amplitudes will do the trick.
It doesn't seem like a neural net is necessary.
Hope this helps.
Thank you for formally accepting my answer
Greg
PS How many points in each sample?
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
