如何评估信号?

时间:2019-05-27 01:45:50

标签: matlab matlab-figure

我需要获得近似信号的导数的近似值,对导数求平方并阈值化并确定峰之间的距离。

请帮助会很有帮助

我要做的是为图形(信号)生成代码

file='20190526_124514.mp4';
vidObj = VideoReader(file);
display('%%%%%%%%%%%%%%%%%%%%');
disp(file);
display('Video');
vidFrame=vidObj.FrameRate;
vidW=vidObj.Width;
vidH=vidObj.Height;
k=1;
data=[];
t=[];
while hasFrame(vidObj)
    frame = readFrame(vidObj);
    t(k)=vidObj.CurrentTime;
    d1=double(squeeze(frame(:,:,1)));
    d2=double(squeeze(frame(:,:,2)));
    d3=double(squeeze(frame(:,:,3)));
    data(:,:,k)=d1.^2+d2.^2+d3.^2;
    k=k+1;
end
NumFrame=k-1;
display('Completed !!');
display(['number of frames=' num2str(NumFrame)]);
display(['dimensions per frame ' num2str(vidW) 'x' num2str(vidH)]);
display(['frames per second =' num2str(vidFrame)]);
Y=reshape(data,vidW*vidH,NumFrame);
ym=mean(Y,1);
PPG=ym-mean(ym);
plot(t,PPG,'LineWidth',2); grid on; xlabel('Tiempo (seg)'); ylabel('PPG');
graph(signal):

enter image description here

0 个答案:

没有答案