Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using MATLAB Starting Signals X = 12 -3); nl = [01]; h = 13 -1 41; n2 = (-2 -1 0]: Algorithm Description and Pseudo-Code
Using MATLAB
Starting Signals X = 12 -3); nl = [01]; h = 13 -1 41; n2 = (-2 -1 0]: Algorithm Description and Pseudo-Code The purpose of this section is to try and help walk you through critical steps and debug, you do not need to report on every suggested action, only on the end result. You also want to make sure to parameterize everything so that when we change to different signals you won't need to change your code. One of the things we generally assume in MATLAB is that outside of given range of n the signal x (or h) is zero. Since they both have different values for n you want to create new vectors, by adding zeros, so that they are both on the same reference point. Create a new variable n, that is large enough for x, h and y In our first example, x and h are easy, since you know what the max and minimum values of each function are. To determine the range that y will be nonzero, simply add the maximum and minimum values. That is to say, the maximum value will be the maximum of ni plus the maximum of n2, and the minimum value will be the minimum of ni plus the minimum of n2. It should be clear that the maximum and minimum do not necessarily have to have the same magnitude. Though it is recommended that you make the result n, symmetric about zero to make the flip operation easier. After creating the variable n, you need to add zeros to the x and h signals so that they are the same length as your new variable n. Stem your new signals and check versus the original signals. Initialize y, fliph You will want to initialize y as all zeros before you start trying to fill in the values. It will make it easier to keep track of everything. Likewise, you will want to flip the signal h before shifting it. Create a loop to shift h through all values The loop should span all values of n, each pass of the loop will populate one value of the y vector. It is recommended that you just start from the first value of n and go through in order. You will need an if statement to determine if you should shift the flipped h vector to the left or right depending on the value of n. The last step of the loop you should multiply the x vector by the h vector and use the sum command to get a single value to store in the y vector Once you are confident that the code works for the first function, try it with the next 3 signal pairs: Signal 2 x = [1 111 11; nl - -1:37 h - 111101011 1); n2-4:4: Signal 3 nl - 100: 150; x = ones (1, length (nl)); n20:100; h = (1/2)^n2; Signal 4 * - repmat (11.10 9:-1:21,1,20); nl = -180:179; h = [1 -1); n2 = 10 11 For your report, output plots of the y[n] for all 4 different signal pairs Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started