Clear Filters
Clear Filters

How to find the valley of a PPG signal? It is getting confused with the dicrotic notch

11 views (last 30 days)
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');

Accepted Answer

Star Strider
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
Anupama V
Anupama V on 4 Jan 2023
In the attached code,all starts of the peak is getting detected. From this how to filter out dicrotic notch and valley? I am attaching my signal below.
LD = load('C:\Users\ANU\Desktop\TBME2013-PPGRR-Benchmark_R3\data\0009_8min.mat.mat')
% 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(ppg,'r')
hold on
plot(all_trough_location,all_trough_value,'ko')
Star Strider
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'))
LD = struct with fields:
SFresults: [1×1 struct] labels: [1×1 struct] meta: [1×1 struct] param: [1×1 struct] reference: [1×1 struct] signal: [1×1 struct]
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])
.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!