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
  • I need help with number 2 . Please answer in MATLAB thank you! 1. In the lab we analyzed filtering 60 Hz power-line noi...

    I need help with number 2 . Please answer in MATLAB thank you! 1. In the lab we analyzed filtering 60 Hz power-line noise from ECG signal using a digital (signal processing) filter. Now let's try to an analog (circuit) filter approach to remove the 60 Hz line-noise. Following is an active twin-T notch filter with transfer function: (1+m)((2joRC? +1 Z(a) 2R 2R Here m is the ratio of the two feedback 2C R resistance which determines the gain and...

  • QUESTION 28 3 points Save The Siter coefficients of a second-order digital IR filter are: ao-1,a1-2, a2-2, bo-1. b1-1/2, b2 1/8. (a's are numerator coetficients and b's are the denom...

    QUESTION 28 3 points Save The Siter coefficients of a second-order digital IR filter are: ao-1,a1-2, a2-2, bo-1. b1-1/2, b2 1/8. (a's are numerator coetficients and b's are the denominator coefficients). Determine the value of the impulse response N4? QUESTION 29 6 points Save Answer An image is to be sampled with a signal-to-quantisation ratio of at least 55 dB. The image samples are non-negative. The image sample values fall within the range from 0 to 1. How many bits...

  • Question 6: We will consider a piece-wise constant 1D signal in this part. Assume the signal...

    Question 6: We will consider a piece-wise constant 1D signal in this part. Assume the signal (a function f(t)) contains S = 10 discrete sub-intervals of equal length. Each sub-interval contains 50 samples. This signal is given below in the variable signal acquired at sample locations sampling_locations (also provided below). Plot the 1D signal, create one plot with the regular plot commands and one plot with the stem command (use subplots to plot the two next to each other in...

  • QUESTION 1 Characterise the following systems as being either causal on anticausal: yn)-ePyn-1)+u...

    QUESTION 1 Characterise the following systems as being either causal on anticausal: yn)-ePyn-1)+u/n), where u/h) is the unit step and B is an arbitrary constant (B>0), Take y-1)-0. Answer with either causal or 'anticausal only QUESTION 2 For the following system: yn) -yn-1Va -x(n), for a 0.9, find y(10), assuming y(n) - o, for ns -1.Hint: find a closed form for yin) and use it to find the required output sample. (xin)-1 for n>-0) QUESTION 3 A filter has the...

  • HI GUYS CAN YOU HELP ME SOLVE THIS QUESTION ASAP PLS AND THANKS!! QUESTION 6 ONLY,...

    HI GUYS CAN YOU HELP ME SOLVE THIS QUESTION ASAP PLS AND THANKS!! QUESTION 6 ONLY, THE 15 MARK QUESTION. CAN YOU CALCULATE THE THEOREATICAL VALUES WITH THESE 3 VALUES: 10HZ, 1KHZ, 10KHZ. AND USING THIS VALUES. R = 1000Ω,C = 1µF, L = 0.23mh. not the L=44 thanks. Exercise 2 [60 marks] RLC Circuit as a Low-pass Filter L 0000 in out Figure 2. RLC circuit 2 10 marks] Derive the second order input-output model (differential equation) for the...

  • PLEASE ANSWERS TO ALL QUESTIONS NEEDED, THANKS Problem 13.10(a) Purpose: This is to help familiarize you...

    PLEASE ANSWERS TO ALL QUESTIONS NEEDED, THANKS Problem 13.10(a) Purpose: This is to help familiarize you with characteristics of electromagnetic waves. Problem: An electromagnetic wave travels in the z direction. The electric field in the wave is given by the expression E(z,t) = E0cos(kz-ωt)y. (Bold letter are vectors.) At z = 0 and t = 0, in what direction does the magnetic field point? Hints:     Remember that E crossed into B gives the direction of travel. Enter your answer,...

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