finding the duration of signal peak period
조회 수: 2 (최근 30일)
이전 댓글 표시
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 ?
댓글 수: 0
답변 (2개)
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
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
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
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!