clear,clcload('DATA_01_TYPE01.mat')A = sig;x = A(2,1:1000) %PPG channel
y=A(3,1:1000); %x-axis acceleration
t=1:1:1000;[x,y]=butter(2,[0.4 5]);d = designfilt('bandpassiir','FilterOrder',2,'HalfPowerFrequency1',0.4,'HalfPowerFrequency2',5, 'SampleRate',1500);sos = ss2sos(x,y);N=normalize(x,y)subplot(3,1,1)plot(t,sos)title('Raw Signals')xlabel('Sampling Points')legend('PPG','Acceleration','Location','Southeast','Orientation','Horizontal')
I am trying to filter the PPG and acceleration signals using a band-pass filter from 0.4Hz to 5Hz using a 2nd order Butterworth filter. Then normalize the PPG and acceleration signals. I am not sure what I am doing wrong. I am getting errors of:
Error using butter (line 62)The cutoff frequencies must be within the interval of (0,1).Error in Butterworth_Practice (line 29)[x,y]=butter(2,[0.4 5]);
I do not even have a line 62 in my code. My lines of code range from 22-37. Thanks for your help.
Best Answer