Plot pulse oximetry waveform 1_1 that has been provided by your instructor. Wave
ID: 2082064 • Letter: P
Question
Plot pulse oximetry waveform 1_1 that has been provided by your instructor. Waveform characteristics are documented in the associated header1_1.txt ascii file. Take the first beat of the waveform
1.(plot using matlab), and
2.calculate its frequency response. What do you
3.estimate is the bandwidth of this signal?
4.Filter the waveform with a second-order Butterworth filter with a corner frequency that is equivalent to your chosen bandwidth.
5.Filter the waveform with a secondorder Butterworth filter with a corner frequency that is half of your chosen bandwidth.
6.Plot the original waveform and your two filtered waveforms in one figure.
7.Comment on how the results were affected by your choice of bandwidth.
*the data in the link below
https://drive.google.com/file/d/0B5XbMRBYve_LSjhZaER0RERCNGc/view?usp=sharing
Explanation / Answer
% WAVEFORM
clc;
close all;
clear all;
S = load('waveform1_1_HW_1.txt');
%t = 1:1:length(S);
figure
subplot(4,1,1);
plot(S);
YS = fft(S);
subplot(4,1,2);
plot(abs(YS));
Y = conv(S,butter_bsf(50,450));
subplot(4,1,3);
plot(Y);
Y = conv(S,butter_bsf(25,225));
subplot(4,1,4);
plot(Y);
% butter_bsf.m
function h = butter_bsf(wp,ws);
rp = 1;
rs = 10;
fs = 2000;
w1 = 2*wp/fs;
w2 = 2*ws/fs;
[n] = buttord(w1,w2,rp,rs);
wn = [w1 w2];
[b,a] = butter(n,wn,'stop');
w = 0:0.01:pi;
[h,om] = freqz(b,a,w);
m = 20*log10(abs(h));
an = angle(h);
% subplot(2,1,1);
% plot(om/pi,m);
% subplot(2,1,1);
% plot(om/pi,m);
% title('Magnitude Response');
% ylabel('Gain in dB ---->');
% xlabel('Normalised Frequency ---->');
% grid on;
% subplot(2,1,2);
% plot(om/pi,an);
% title('Phase Response');
% xlabel('Normalised Frequency ---->');
% ylabel('Phase in radians ---->');
% grid on;
end