Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Any programming language CMPE 321 LAB 6 Task: Implementation of a Second-Order IIR Filter Write a program that implements a second-order IIR filter. You can

image text in transcribedAny programming language

CMPE 321 LAB 6 Task: Implementation of a Second-Order IIR Filter Write a program that implements a second-order IIR filter. You can use any programming language you want. Make sure you test your function with various inputs, and various filter coefficients. Recall that a second-order IIR filter is given by: y[n] = a1*y[n-1] + a2*y[n-2] + bo*x[n] +b1*x[n-1] + b2*x[n-2] Keep the feedback and feedforward coefficients in arrays a and b. Also, keep the input in array x and the output in array y. You might want to print out the first N=20 outputs of the filter. Test your program with the following parameters: float a []={1, 2, 3}; float b[]={1, 0.5, 0.3}; /* ao, al, a2 */ /* bo, bi, b2 */ float x[N] = {2, 0, -1, 0.5, -2}; The output values generated by your program with these parameters should be: 2.00 5.00 8.10 4.05 0.46 -1.06 -6.39 -3.51 -3.67 -2.89 -2.55 -2.14 -1.84 -1.56 -1.33 -1.13 -0.97 -0.82 -0.70 -0.60 CMPE 321 LAB 6 Task: Implementation of a Second-Order IIR Filter Write a program that implements a second-order IIR filter. You can use any programming language you want. Make sure you test your function with various inputs, and various filter coefficients. Recall that a second-order IIR filter is given by: y[n] = a1*y[n-1] + a2*y[n-2] + bo*x[n] +b1*x[n-1] + b2*x[n-2] Keep the feedback and feedforward coefficients in arrays a and b. Also, keep the input in array x and the output in array y. You might want to print out the first N=20 outputs of the filter. Test your program with the following parameters: float a []={1, 2, 3}; float b[]={1, 0.5, 0.3}; /* ao, al, a2 */ /* bo, bi, b2 */ float x[N] = {2, 0, -1, 0.5, -2}; The output values generated by your program with these parameters should be: 2.00 5.00 8.10 4.05 0.46 -1.06 -6.39 -3.51 -3.67 -2.89 -2.55 -2.14 -1.84 -1.56 -1.33 -1.13 -0.97 -0.82 -0.70 -0.60

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

=+from: a) a MNEs perspective? and b) the HRM managers perspective?

Answered: 1 week ago