Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Language Is MATLAB Let tl = [0 0.3], t2 = [0.5 2], and dt= [0.1, 0.05, 0.01, 0.005] 1. Create a time vector

Programming Language Is MATLAB Let tl = [0 0.3], t2 = [0.5 2], and dt= [0.1, 0.05, 0.01, 0.005] 1. Create a

Programming Language Is MATLAB Let tl = [0 0.3], t2 = [0.5 2], and dt= [0.1, 0.05, 0.01, 0.005] 1. Create a time vector ranging from 0 to 1.0, based on the dt value controlled by the for loop. (5 pts) 2. Create two vectors, a and b, according to the following rules: (5 pts) (-1 min (t1) t max (t1) otherwise ={ (1 min (t2) t max (t2) otherwise 3. Convolve vectors a and b using a manual technique (such as that used in your MiniLab) (10 pts) and MATALB's conv() command (5 pts). You must do this both ways! 4. Create Figure 1, a figure with length(dts)x2 grid (i.e., 4x2 if dts has 4 values) of sub-plots: (20 pts) a. In column 1, plot, using the stem() and hold on commands: i. The manual convolution results ii. The results from conv(). Each row corresponds to a different dt value. Do not plot your convolved values against any specific x-vector. That is, instead of the typical plot(x,y) that you might use, this time simply call plot(y). Be very specific and very careful about your x-axis label. What does the x-axis represent in this case? For example, if you convolve a 0-1 second signal containing 11 values (dt=0.1) with another 0-1 second signal containing 11 values, your convolution, and hence your plot, will have 21 values. b. In column 2, you will plot the same thing as column 1, but you'll need to make an adjustment. You must make a correction such that your resulting solution does not change in amplitude regardless of the dt chosen. i. Notes & hints: 1. Much like calculating the area under a curve discretely using a Riemann sum, you are calculating a discrete convolution. Such numerical approximations are prone to discretization error as dt increases. Therefore, the max value in your plots in column 2 will not be exactly the same, but they will approach the same value as dt gets smaller. 2. The correction is not to normalize by the max value so that your solution always achieves a maximum value of 1. 5. Create Figure 2, which is just like Figure 1, but this time you will plot the results of your convolution versus time. Going back to the previous example as well as referring back to the lecture, if you have 21 values in your solution and you know that dt-0.1, then you also know that time ranges from 0 to 2. To create the plots in Figure 2, you'll need to create a new time vector that accounts for the length of the convolution results. (10 pts) As always, make sure your axes are labeled, that you use appropriate titles, and that lines are clearly distinguishable.

Step by Step Solution

3.51 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

This passage appears to be a set of instructions for a programmi... 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

Visual C# How to Program

Authors: Paul J. Deitel, Harvey Deitel

6th edition

134601548, 134601793, 978-0134601540

More Books

Students also viewed these Programming questions