Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask MATLAB Expert

Q1 Filter function form is y = myfilter(x,b,a) where x is input, y is output and a and b are the IIR and FIR coefficients.

In the transfer function, the matrix "a" indicates the denominator coefficients and the matrix "b" is numerator coefficients.

I use command "global buffer;" to set a global variable as the shift buffer.

For a second order IIR filter, the transfer function is like:

362_IIR and FIR coefficients.png

Where w0 is stopband filter frequency, r is the stopband width.

1629_IIR and FIR coefficients1.png

The signal flow diagram is:

From the diagram, I work out the function in Matlab:
output=b(2)*buffer(1);
input=input-a(2)*buffer(1);
output=output+b(3)*buffer(2);
input=input-a(3)*buffer(2);
output=output+input*b(1);

When the output is figured out, the input is set to buffer(1) and the buffer(1) becomes buffer(2).
buffer(2)=buffer(1);
buffer(1)=input;

Q2

I use the command "load ('1104111.txt')" to load my ecg file. The signal minus 2048 to make it range from -2048mV to +2048mV.

And plot the original signal.

669_IIR and FIR coefficients2.png

To eliminate the 50Hz hum, so I make w0=2*pi*50/fs; r refers to the width of the stopband. And the closer r goes to 1, the more narrow is the stopband. I choose r=0.93.

Because it is a second order filter so the buffer contains 2 components.

To define the buffer in advance, I use the command of "global buffer;buffer=zeros(2,1);"

The coefficients a and b are:
b1=1; b2=-2*cos(w0); b3=1;
a1=1; a2=-2*r*cos(w0); a3=r^2;
b=[b1,b2,b3]; a=[a1,a2,a3];

Then a loop is used for filtering the whole signal.
op1=zeros(l,1);
for k=1:l
op1(k)=myfilter_3(ecg1(k),b,a);
end

Plot the result.

300_IIR and FIR coefficients3.png

Q3

In this section, the steps are similar with the Q2.
To eliminate the DC component, w0=0;
The other steps are almost same as the Q2.
The result is plotted as:

1982_IIR and FIR coefficients4.png

At last, to check the PQRST peaks, zoom in the plot

856_IIR and FIR coefficients5.png

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M9131429
  • Price:- $35

Priced at Now at $35, Verified Solution

Have any Question?


Related Questions in MATLAB

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Suppose that a student has the option of enrolling for a

Suppose that a student has the option of enrolling for a single elective during a term. The student must select a course from a limited list of options: "English, " "History, " "Biology, " "Computer, " or "Math." Constru ...

Assignment -we have daily gridded rainfall data of 40 years

Assignment - We have daily gridded rainfall data of 40 years and structure of the dataset is like below; Lat = [6.5:0.25:38.5]; Lon = [66.5:0.25:100]; Rainfall (135x129x365x40) (Lon, Lat, days, years). Now, we looking fo ...

Suppose that you have used some concept learning algorithm

Suppose that you have used some concept learning algorithm to learn a hypothesis h1 from some training data. You are interested in knowing the accuracy that the hypothesis can be expected to achieve on the underlying pop ...

Lab assignment - matlab matrix relationallogical operators

Lab Assignment - MATLAB Matrix, Relational/Logical Operators and Plotting This laboratory exercise/assignment will involve you 1) practicing multiplication operators in MATLAB; 2) practicing relational and logical operat ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Recitation problems -1 determine the highest real root of

Recitation Problems - 1. Determine the highest real root of f(x) = 2x 3 - 11.7x 2 + 17.7x - 5 using the Newton-Raphson method with at least four iterations. Start with an initial guess of x 0 = 3. 2. Determine the real r ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

Assignmentafter the success of your robo-advice venture you

Assignment After the success of your robo-advice venture you decide to explore alternative sources of profitability for your company. You realize that Australian investors are often forced to chose between expensive acti ...

Question - verify the attached paper with matlab and get

Question - Verify the attached paper with matlab and get all the results in the paper and explain step by step the matlab code. Paper - Improving Massive MIMO Belief Propagation Detector with Deep Neural Network. Attachm ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As