Peak spike extraction from a signal

3 views (last 30 days)
I am trying to extract peak spike from a signal. After extracting that peak spike, i want to calculate its rise time, fall time etc. Amplitude of given signal is stored in 'amp' (column vector) and time is stored in 't' (column vector). My idea is to figure out the 4% of peak value as a starting and ending point of my signal. I have written following code for this;
p(i)=-npk(i); %% already calculated peak value
edgee=0.04*p(i); %% starting,falling edge
[lo,ilo]=min(abs(amp(1:in(i)-edgee))); %% in(i) is the index of peak value
[hi,ihi]=min(abs(amp(in(i):end) -edgee));
Signal=amp(ilo:ihi);
x1=t(ilo:ihi);
For starting point, i am getting right value i.e 4% of peak value. But, for falling point of spike, i am getting wrong value. Anybody here, can guide me please as i am troubleshooting my code from several days. I have also attached pictures of original signal and extracted signal.
  2 Comments
Image Analyst
Image Analyst on 6 Sep 2021
Do you want the upwards going spike, or the larger downward spike? Can you attach your data?
Muhammad Tahir Khan Niazi
I want to extract a complete downward going spike. Its rising edge should start from 4% of peak value and falling edge should be at 4% of peak value. I am attaching below my data file also.

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!