I am doing a video analysis.
The resulting array of final results looks something like this:
signal = Columns 1 through 7 73960 73960 73960 73960 68102 68102 68102 Columns 8 through 14 68102 19187 19187 19187 19187 14664 14664 Columns 15 through 21 14664 14664 13715 13715 13715 13715 30832 Columns 22 through 28 30832 30832 30832 53031 53031 53031 53031 Columns 29 through 35 56897 56897 56897 16104 16104 16104 16104 Columns 36 through 42 15188 15188 15188 15188 13973 13973 13973
Note: the actual array I get is usually 600 +
Therefore, when I draw this, I get a very bad looking graph, so I want to filter this array and keep only the maximum and minimum peaks **, maximum and minimum maximums, so that the graph has more pleasant waves
Is there any way to do this with MATLAB?
If not, can I do this with excel? as i usually save this array in excel sheet like this
0.1 68102 0.15 19187 0.2 14664 0.25 13715 0.3 30832 0.35 53031 0.4 56897 0.45 16104 0.5 15188 0.55 13973 0.6 21437 0.65 66950 0.7 65356 0.75 22562 0.8 14154 0.85 13938 0.9 20692 0.95 72823 1 69975 1.05 15328 1.1 14494 1.15 13681 1.2 14205 1.25 65278 1.3 63055 1.35 16999 1.4 14050 1.45 14245
In which the 1st column is the time (y axis) and the second column is the amplitude (x axis)
I use this formula to calculate local maxima (thanks brettdj from stackoverflow.com)
=SUMPRODUCT(--(B2:B149>B1:B148),--(B2:B149>B3:B150))
And this formula for calculating local minima
=SUMPRODUCT(--(B2:B149<B1:B148),--(B2:B149<B3:B150))
But I need to filter the array only for local maxima and local minima so that I can get a nice curve without noise.
Zalaboza
source share