Digital signal processing: iir filters

Assignment Help MATLAB Programming
Reference no: EM13983

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

Reference no: EM13983

Questions Cloud

Write an essay on wifi performance : Write an essay on WiFi performance
Case study:the british airways story : Case study:The British Airways story
Evaluate business value : How can internet technologies be involved in improving a process in one of the functions of business? Choose one example and evaluate its business value.
Resource base view theory versus positioning theory : Explain Resource Base View theory versus Positioning theory
Digital signal processing: iir filters : Digital Signal Processing
Log periodic dipole antenna theory : The main objective of thesis is to analyze E-fields and H-fields of LPDA using transmission line matrix method.
Producing quality steel by stressing sound management : Nucor Corporation- Producing Quality Steel by Stressing Sound Management Practices
Case study: a new campus for the university of rummidge : Case Study: A new campus for the University of Rummidge
Cyclic group : A cyclic group is a special kind of group that has many similarities with modular arithmetic.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd