On Tuesday, 3 April 2012 20:31:13 UTC+1, Amir Karami Sichani wrote:
> I have a PPG signal and trying to do threshold process and finally detect the peaks, I have included my code below and wandering if any one could please help me to find it out my problem? Thanks
>
>
>
>
>
>
>
> y=filtfilt(Num,1,ir_raw);
>
> y1=filtfilt(Num,1,RD_RAW);
>
> subplot(211);
>
> plot([y y1]);
>
> title('Filtered PPG');
>
> legend('infrared filtering','red filterring');
>
> subplot(212);
>
> w=ones(100,1)*0.001;
>
> thr=conv(abs(y1),w,'same')*10.5;
>
> thr1=conv(abs(y),w,'same')*10.5;
>
> ind=y1>thr;
>
> start=find(diff(ind)==1);
>
> End=find(diff(ind)==-1);
>
> plot(y);
>
> hold
>
> plot(thr,'r');
>
> plot(y1);
>
> hold on
>
> plot(start,'dk');
>
> plot(End,'dr');
>
>
>
> for i=1:length(start);
>
>
>
> [p,v]=max(y1(start(i):End(i)));
>
> if
>
> pk(1,i)=p+start(i)-1;
>
>
>
>
>
> if
>
> pk_val(1,i)=v+start(i)+1;
>
>
>
>
>
>
>
>
>
> end
Hi Amir,
Did you ever find a solution to this? I am brand new to MatLab and and have been tasked with trying to make sense out of a PPG signal. My PPG plot has various cycles, and each has positive and negative peaks at different amplitudes. I need to sample the values at each point and construct an average cycle out of all the cycles such that the amplitude at each point of the final curve is the arithmetic average value of all the values at that point of the curves.
I thought that I would be able to use your Peak Detector script to find the peaks but am running into some error messages. Furthermore, I am not even sure if this is the right script to be using!
Do you have any ideas as to how this can be done?
> I have a PPG signal and trying to do threshold process and finally detect the peaks, I have included my code below and wandering if any one could please help me to find it out my problem? Thanks
>
>
>
>
>
>
>
> y=filtfilt(Num,1,ir_raw);
>
> y1=filtfilt(Num,1,RD_RAW);
>
> subplot(211);
>
> plot([y y1]);
>
> title('Filtered PPG');
>
> legend('infrared filtering','red filterring');
>
> subplot(212);
>
> w=ones(100,1)*0.001;
>
> thr=conv(abs(y1),w,'same')*10.5;
>
> thr1=conv(abs(y),w,'same')*10.5;
>
> ind=y1>thr;
>
> start=find(diff(ind)==1);
>
> End=find(diff(ind)==-1);
>
> plot(y);
>
> hold
>
> plot(thr,'r');
>
> plot(y1);
>
> hold on
>
> plot(start,'dk');
>
> plot(End,'dr');
>
>
>
> for i=1:length(start);
>
>
>
> [p,v]=max(y1(start(i):End(i)));
>
> if
>
> pk(1,i)=p+start(i)-1;
>
>
>
>
>
> if
>
> pk_val(1,i)=v+start(i)+1;
>
>
>
>
>
>
>
>
>
> end
Hi Amir,
Did you ever find a solution to this? I am brand new to MatLab and and have been tasked with trying to make sense out of a PPG signal. My PPG plot has various cycles, and each has positive and negative peaks at different amplitudes. I need to sample the values at each point and construct an average cycle out of all the cycles such that the amplitude at each point of the final curve is the arithmetic average value of all the values at that point of the curves.
I thought that I would be able to use your Peak Detector script to find the peaks but am running into some error messages. Furthermore, I am not even sure if this is the right script to be using!
Do you have any ideas as to how this can be done?