Detecting maximum and minimum of signal
Mostra commenti meno recenti
Hey guys,
I'd like to write some code which finds the mean stress and stress amplitude for each block of a signal whose amplitude changes from one constant value to another (pictured below).

In order to do this, I need the maximum and minimum values for each block of the signal. The only problem is that my program should be able to read any signal with multiple blocks of constant amplitude so the method needs to be general and not just for the example below.
Any help would be greatly appreciated :)
Risposta accettata
Più risposte (2)
Jan
il 9 Gen 2013
2 voti
Start with finding the local extrema, e.g. by:
- http://www.mathworks.com/matlabcentral/fileexchange/30490-1d-non-derivative-peak-finder
- http://www.mathworks.com/matlabcentral/fileexchange/33555-find-zeros-local-maximums-loacal-minimums
- http://www.mathworks.com/matlabcentral/fileexchange/26581-peakseek
- ... search in the FileExchange for more
Then locating the blocks should be easy, when you can define a threshold value to identify a switch.
Image Analyst
il 9 Gen 2013
Modificato: Image Analyst
il 9 Gen 2013
How about:
minValue = min(theBlock(:));
maxValue = max(theBlock(:));
You only asked about finding the min and max value. You didn't ask about locating the blocks themselves, so presumably you already have a way of doing that. If not, I posted a method for that about a month or two ago involving conv() and thresholding I think.
You said your " program should be able to read any signal". I'm not sure what this means, but perhaps you need to get the Data Acquisition Toolbox if you need to read from an instrument, or perhaps fread(), dlmread(), importdata() or something like that if you need to read it from a file. If you have some other definition of read, let's hear it.
Categorie
Scopri di più su Signal Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!