Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In an application, suppose x = [x1, x2, x3, x4, x5, x6, x7]. This is what we want to do. We want to compute the

In an application, suppose x = [x1, x2, x3, x4, x5, x6, x7]. This is what we want to do. We want to compute the vector y whose elements are to be found as follows: rst element of y should be x1+x32+x3. second element of y should be x2+x33+x4. third element of y should be x3+x34+x5. fourth element of y should be x4+x35+x6. fth element of y should be x5+x36+x7. Stop here since theres no more value in x. Write a MATLAB script (use a for loop) to implement the above logic. Test if your code is working properly by using x = [1, 2, 3, 4, 5, 6, 7] and other arbitrarily dened x vectors (of length 500, say). Believe it or not, what you have just implemented is a digital low pass lter, which can be used to remove (somewhat) screechy sounds from an old audio tape (after digitizing it, of course, say into a wav or an mp3 le). Now try to generalize your code as follows: introduce a variable named WINDOW. The value which is assigned to this variable should control how many elements of x are to be averaged every time (and therefore also the denominator). As the problem has been described, WINDOW = 3 since we are averaging over 3 elements of the x vector every time. If WINDOW = 4, we would compute y as follows: rst element of y should be x1+x2+4x3+x4. second element of y should be x2+x3+4x4+x5. third element of y should be x3+x4+4x5+x6. fourth element of y should be x4+x5+4x6+x7. Stop here since theres no more value in x.

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

Step: 3

blur-text-image

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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

7. Define cultural space.

Answered: 1 week ago

Question

Define leadership.

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

3. Identify the methods used within each of the three approaches.

Answered: 1 week ago