Is there a way in MATLAB to automatically recognize a pattern from the plotted signals? or automatically count the number of peaks? and after that take a decision

7 visualizzazioni (ultimi 30 giorni)
i have a code which record sound and plot it, and i want a way to automaticlly recognize the plotted figure and take a decision.
  1 Commento
John D'Errico
John D'Errico il 7 Gen 2023
Computers are not super intelligent beings that can read your mind and know what you might want to do. Ok, yes they are in some movies. But not in real life. This means you need to program them to do what you want. They will do nothing automatically, unless you write the code.
So given a figure, you must have the numbers you plotted to create the figure. (Yes, you can extract the data from a MATLAB figure. But WHY? If you created the figure, you have the data already.) So use tools like findpeaks to identify the peaks. Then write the code to count the number of peaks found. That takes nothing more then using a tool like numel.
Automatically recognizing a pattern is far more complex, because it is far too vague a description. People automatically recognize things they think to be patterns all the time, and they are often proved to be completely wrong.

Accedi per commentare.

Risposte (1)

Image Analyst
Image Analyst il 7 Gen 2023
I'm not sure if there is a built-in way to do it. Some people might suggest cross correlation or normalized cross correlation and look for high signal values but that's not robust since you can get a high signal just because one signal is much higher than the other in some spot.
One way might be to use the median absolute deviation, mad, as you slide your test pattern along your reference signal.
Evidently you didn't read the Community Guidelines. If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by