How to take Average of many waves to single wave(want he averge of all waves to a single wave)

Hello Everyone, I have a doubt concerning the average of the wave from a set of waves from sinlge dataset. I need to get a single average cuurve from of all the curves of the figure. I am new to matlab and have not been able to do so for a long time. I need you to help and it would be great for me. Thanks in advance.

 Accepted Answer

Used the islocalmin function to find the minima of the waveform, then use those indices to store the wave segments in a cell array. Then use the shortest wave independent variable indices to take the mean of all of them. (This is known as an ensemble average.)
See: cutting up the signal into repeating parts for an illustrative example.

6 Comments

error:
Index in position 2 exceeds array bounds (must not exceed 1).
I am getting this error. I have .mat file.Screenshot (7).png
Vectors ‘b’ and ‘tv’ are each (4000x1) column vectors. The column addressed as ‘b(:,2)’ does not exist.
The time vector ‘tv’ in that Question was the first column of a two-column matrix, and the signal vector ‘ap’ was the second column. It is not absolutely necessary to have a time vector to use my code (although it is helpful), the signal vector ‘ap’ is all that is needed. If you do not have a time vector (and you do not want to create one from the sampling frequency and vector length), simply eliminate all references to ‘tv’ in that example.
I tried to figure it out. I dont know wheather I got the rght output or not. Actually the data is medical data of radial arterial blood pressure of one patient with many cycles in it.Screenshot (9).png
I picked up the .mat file from your other Question, and posted an Answer there.
I needed to change the code slightly from my previous Answer (to the post I referenced) to work with your data.
I am trying to do something similar with respiratory data and this is a very helpful start. Cheers.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!