Question

(MATLAB question)

1. In the lab we analyzed filtering 60 Hz power-line noise from ECG signal using a digital (signal processing) filter. Now le
"ecg_signal.mat" converted to a .csv file yields the following data;

ecg 0.231349157 0.002, 0.241364987 0.004, -0.054873682 0.006, -0.361871187 0.008, -0.531737645 0.01 0.565952818 0.012, -0.353

This is only part of the whole .mat file. Please show how to analyze the whole signal from this snapshot.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The transfer function of the twin-T notch filter is, (1+m)(2joRC) +1) H)(2jaRC) +4(1-m)joRC+1 (a) The following is the MATLAB

m=[0.8,0.9];
C=133*10^(-9);
R=10000;
f=0:0.1:200;
w=2*pi*f;
H1=((1+m(1))*((2*i*w*R*C).^2+1))./((2*i*w*R*C).^2+4*(1-m(1))*i*w*R*C+1);
H2=((1+m(2))*((2*i*w*R*C).^2+1))./((2*i*w*R*C).^2+4*(1-m(2))*i*w*R*C+1);
figure
subplot(2,1,1)
plot(f,abs(H1))
title('Magnitude and phase for m=0.8')
xlabel('f')
ylabel('Magnitude')
subplot(2,1,2)
plot(f,angle(H1))
xlabel('f')
ylabel('Phase (rad)')

figure
subplot(2,1,1)
plot(f,abs(H2))
title('Magnitude and phase for m=0.9')
xlabel('f')
ylabel('Magnitude')
subplot(2,1,2)
plot(f,angle(H2))
xlabel('f')
ylabel('Phase (rad)')

The plots are shown below. X Figure 1 File Edit View Insert Tools Desktop Window Help Magnitude and phase for m-0.8 2 1.5 1 0

Figure 2 File Edit View Tools Desktop Window Help Insert Magnitude and phase for m-0.9 2 1.5 1 0.5 0 60 80 100 120 140 160 18

(b)

The following is the MATLAB code:

ecg_signal=load('ecg_signal.mat', '-ascii');

x=ecg_signal(:,2);

m=[0.8,0.9];

C=133*10^(-9);

R=10000;

f=0:0.1:200;

w=2*pi*f;

H2=((1+m(2))*((2*i*w*R*C).^2+1))./((2*i*w*R*C).^2+4*(1-m(2))*i*w*R*C+1);

X=fft(x);

Z=X*H2;

z=ifft(Z);

subplot(4,1,1)

N1=length(x);

t= linspace(0, 2.5, N1);

plot(t,x)

xlabel('t')

ylabel('x(t)')

subplot(4,1,2)

N2=length(x);

f= linspace(-250, 250, N2);

plot(f,fftshift(abs(X)))

xlabel('f')

ylabel('X(f)')

subplot(4,1,3)

plot(f,fftshift(abs(Z)))

xlabel('f')

ylabel('Z(f)')

subplot(4,1,4)

plot(t, (abs(z)))

xlabel('t')

ylabel('z(t)')

The plots are shown below Figure 1 File Edit View Tools Desktop Window Help Insert 1 0 1 0 0.5 2.5 1.5 10 5 250 150 100 100 1

Add a comment
Know the answer?
Add Answer to:
(MATLAB question) "ecg_signal.mat" converted to a .csv file yields the following data; This is only part of th...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT