How to find the valley of a PPG signal? It is getting confused with the dicrotic notch
11 views (last 30 days)
Show older comments
I used the following code:
[~,index]=findpeaks(PP,'MinPeakDistance',200);
invertedP = - PP;
%findpeaks(invertedP);
[~, indexes] = findpeaks(invertedP,'MinPeakProminence',3,'MinPeakDistance',200);
figure;
plot(PP); hold on; plot(indexes,PP(indexes),'rv','MarkerFaceColor','g');plot(index,PP(index),'rv','MarkerFaceColor','r');
0 Comments
Accepted Answer
Star Strider
on 6 Nov 2022
It would help to have the data, existing code, (and a more thorough description of the desired result).
In some instances, it is necessary to set two different threshold criteria (for 'MinPeakProminence' or 'MinPeakHeight' or others) and then use the appropriate set operations (such as setdiff) to return only the ones you want.
8 Comments
Star Strider
on 4 Jan 2023
I do not understand what you want to do.
I do not see any specific dicrotic notches (that would concern me if I knew the corresponding blood pressures), only the individual pulse diastolic minima. The EKG R-deflection (that I added to the plot) approximately corresponds to the diastolic minimum, as I would expect.
There appears to be a periodic baseline variation in the PPG signal that should be straightforward to eliminate with a highpass or bandpass filter.
LD = load(websave('0009_8min.mat','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1251227/0009_8min.mat.mat'))
Fs = LD.param.samplingrate.pleth; % Sampling Frequency
EKG = LD.signal.ecg.y;
L = numel(EKG);
tv = linspace(0, L-1, L)/Fs; % Time Vector
% remove first trough:
ppg = LD.signal.pleth.y;
ppg(1:10) = [];
% indentify all peaks
[all_peak_value,all_peak_location]= findpeaks(ppg);
% identify all troughs in data
[all_trough_value,all_trough_location]= findpeaks(-ppg);
all_trough_value = -all_trough_value;
% identify main peak (i.e. ones lower than 5)
[main_trough_value,main_trough_location]= findpeaks(ppg,'MinPeakProminence',5);
counter = 0;
for i = 1:length(main_trough_location)
%c=[];
start=main_trough_location(i)-100;
ending=main_trough_location(i);
%c= (all_trough_location>start & all_trough_location<ending);
%c1=c(end);
[r,c] = find(all_trough_location>start & all_trough_location<ending);
end
figure
plot(tv(11:end), ppg,'r')
hold on
plot(tv(all_trough_location),all_trough_value,'ko')
plot(tv, EKG) % Add EKG Plot
xlim([0 6.5])
.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!