finding the duration of signal peak period

조회 수: 2 (최근 30일)
sarmad m
sarmad m 2017년 3월 15일
답변: Brian Mabe 2017년 6월 5일
HI below image represents data from video frames and has 4 peaks, the (x-axis) is the frame numbers, (y-axis) is the data values . how the duration of each peak can be found in seconds ?

답변 (2개)

Star Strider
Star Strider 2017년 3월 15일
편집: Star Strider 2017년 3월 15일
Use the findpeaks function on the negative of your signal, and experiment with the name-value pair options, such as 'WidthReference'. Then have it return all 4 outputs:
[pks,locs,w,p] = findpeaks(-data, ... );
  댓글 수: 9
sarmad m
sarmad m 2017년 3월 20일
In my example , the video type is .avi, 30fps and 4 seconds the output features are here : Data
is sampling rate =4/(1/30)=121.21 ?
is this correct ?
[pks_smoothed,locs_smoothed,widths_smoothed,proms_smoothed] = findpeaks(AV,121.21,'MinPeakProminence',0.05);
how time vector can be used in this case ?
Star Strider
Star Strider 2017년 3월 20일
I am not certain what your data actually represent. The ‘units’ of your peak locations and widths will be in terms of whatever you specify. If you specify nothing, they will be in terms of indices of your data vector. If your x-axis is time, ‘locs_smoothed’ and ‘widths_smoothed’ would be in units of time. The ‘proms_smoothed’ units will be in whatever your y-axis is.
If each plotted data point in your plot is some point (or a point representing some data in the full frame) in what I assume is your video, and those are presented at 30 fps, then your sampling frequency, ‘Fs’, is 30 Hz. The number of frames you have is not important with respect to your sampling frequency.
If the x-axis in your plot are indices, you can substitute your time vector directly to get it and all values derived from it in units of time.

댓글을 달려면 로그인하십시오.


Brian Mabe
Brian Mabe 2017년 6월 5일
I am having a similar problem with the following: I need to calculation the duration and number of peaks in the data plotted by the given code:
clear clc load Time_X.txt load Turbid_Y.txt x=Time_X; y=Turbid_Y; t=[x,y]; i=1; a=0; b=0; while b==0 if t(i,2)>=0 if y(i)>=55 a=a+1; % disp(y(i)) value(a)=y(i); end i=i+1; end if i==14513 b=1; end
end
scatter(x,y,'.') hold on plot([0 31], [55 55]) xlim([0 31]); ylim([0 190]); if y>55 disp('y') end

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by