Extracting data from a signal
Show older comments
my signal is a single column vector (I have attached an image how the signal looks like), I want to extract data from this vector from whenever the signal starts rising until it reaches the peak for each iteration and saving corresponding data from each iteration in a new separate column vector. Any suggestions?
2 Comments
Adam Danz
on 9 Mar 2020
Which one of these images (if any) indicate when the signal starts to rise?

In the first image, there are many tiny spike where the signal technically isn't monotonically rising.
Rahim Yousefi
on 9 Mar 2020
Accepted Answer
More Answers (1)
Hank
on 9 Mar 2020
Adam, I think the crosshairs in the first image are where the derivative becomes positive: the signal starts to rise. I would use this fact to cut the data programatically. First smooth the data and then take the derivative. The continguous regions where the derivative is positive are the regions you're looking for.
sig = load('signal'); % load
sig = sig(:); % column vector
sigsmooth = smooth(sig,100); % boxcar 100 smoothing
dsig = [0; diff(sig)]; % derivative, padded with 0 so the length doesn't change.
dsigrising = dsig>0; % this vector is true in the regions you want data.
Clustering the rising regions is not something I know how to do programatically, but maybe this could make the boundaries distinct enought that you could do it by hand.
Categories
Find more on Beamforming and Direction of Arrival Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



