There seems to be a sinusoidal like trend in my PPG signal. I believe this is due to respiration. I would like to detect the PPG peaks(maxima) in this signal after removing the trend or even better detect the peaks without removing the trends. Please help to provide a sample code as I am kind of new to signal processing for bio-signals.
clear all;clc;readData = csvread('p3_sit.csv',0,0);ppg_head = readData(:,1).';fs = 960; rec_time_minutes = (length(ppg_head)-1)/60000 %recording time calculation
wn=10/(fs/2); %lowpass 10Hz for ppg
[b,a] = butter(8,wn); ppg_head_data = filter(b,a,ppg_head);N1 = length(ppg_head_data);t1 = [0:N1-1]/fs;%{comment here %}
figure(1)plot(t1,ppg_head_data);xlabel('second');ylabel('Volts');title('PPG Head Signal')
Best Answer