Calculate the response of the system to a unit step input

Assignment Help MATLAB Programming
Reference no: EM131249077

Lab- Discrete-Time Signals and Systems

Activity 1:

A discrete-time system can be described in one of two ways. One is by the unit-pulse response of the system, and the other is by the difference equation. In the first case, if we are given an input and want to find the output, we have to convolve the system response with the input signal. In the second case, we have to solve the difference equation for the output when the input signal is substituted into the difference equation. The result should be the same no matter what approach is used.

A discrete-time system has the following unit-pulse response:

for

Correspondingly, the following difference equation describes the behavior of the system:

• Use the Matlab command conv to calculate the response of the system to a unit step input, x[n]=u[n]. Consider . Show what you type into the Matlab command window. Also, submit a plot of the output. Be sure to label your axes.

Matlab Tip: Remember that you can easily get help on a command in Matlab by typing help with the command at the prompt:
EDU>>help conv

Matlab Tip: Also, don't forget that in Matlab when you do certain operations on an array element-by-element, you must precede the operator with a period. For instance, in Matlab, if you define an array n as follows:

EDU>>n=[0:20];

then the first term of the unit-pulse response is written as 0.5.^n

Matlab Tip: Sometimes it is useful to know the size of arrays you have created. This can be done in several ways. For example, you can use the command size:

EDU>> size(n)
ans =
1 21

The size of the array is returned. In this case, the array n has a size of 1 row by 21 columns.

Alternatively, you can switch the display from the Current Directory to the Workspace. Then all current variables and arrays and their sizes are displayed. Just click on Workspace in the upper left corner as indicated below.

• Use the Matlab function recur to calculate the response of the system to a unit step input, x[n]=u[n]. Again consider . Show all that you type into the Matlab command window. Submit a plot of the output with the axes labeled.

The Matlab function recur is not a function which comes with Matlab or any of the toolboxes you have installed. Instead, it is a that must be added to your Matlab directory.

The Matlab function recur can be found in a zip file at the Mathworks site at the following location:

https://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=2148

Extract the file recur.m to the current directory shown at the top of the Matlab window.

On the other hand, you can copy and paste the script below into a text file like Notepad and save it as recur.m in the current directory shown at the top of the Matlab window.

function y = recur(a,b,n,x,x0,y0);
%
% y = recur(a,b,n,x,x0,y0)
% solves for y[n] from:
% y[n] + a1*y[n-1] + a2*y[n-2]... + an*y[n-N]
% = b0*x[n] + b1*x[n-1] + ... + bm*x[n-M]
%
% a, b, n, x, x0 and y0 are vectors
% a = [a1 a2 ... aN]
% b = [b0 b1 ... bM]
% n contains the time values for which the solution will be computed
% y0 contains the initial conditions for y, in order,
% i.e., y0 = [y[n0-N], y[n0-N+1], ...,y[n0-1]]
% where n0 represents the first element of n
% x0 contains the initial conditions on x, in order
% i.e., x0 = [x[n0-M],...,x[n0-1]]
% the output, y, has length(n)
%

N = length(a);
M = length(b)-1;
if length(y0) ~= N,
error('Lengths of a and y0 must match')
end
if length(x0) ~= M,
error('Length of x0 must match length of b-1')
end

y = [y0 zeros(1,length(n))];
x = [x0 x];
a1 = a(length(a):-1:1); % reverses the elements in a
b1 = b(length(b):-1:1);
for i=N+1:N+length(n),
y(i) = -a1*y(i-N:i-1)' + b1*x(i-N:i-N+M)';
end

y = y(N+1:N+length(n));

To get information on how to use the function, at the Matlab prompt, type:

EDU>>help recur

It might be helpful to change the index of the difference equation such that the highest index is n rather than n+2.

• Are your plots the same? If not, why not?

Attachment:- Lab– Discrete-Time Signals and Systems.rar

Reference no: EM131249077

Questions Cloud

What is the point the author is trying to make : What is the point the author is trying to make - Shirley Jackson's "The Lottery" is a short story written in the late 1940s about a small town that sticks to tradition despite the advancing world.
What important challenge facing management of organizations : Reflecting on the focus and content of this course, what is an important challenge facing management of organizations today and how would you go about addressing it? Explain.
Main drivers of service innovation : What are the main drivers of service innovation? Give examples and theories to support argument.
Purchasing decisions every day : As consumers we make purchasing decisions every day. maybe without being aware of it, we are constantly comparing perceived value and cost to make these decisions. Sometimes we choose to buy a product from a firm pursuing a cost leadership strateg..
Calculate the response of the system to a unit step input : Use the Matlab command conv to calculate the response of the system to a unit step input, x[n]=u[n]. Consider . Show what you type into the Matlab command window. Also, submit a plot of the output.
Find the capacity of the channel : Consider a channel in which some bits are lost during transmission. The receiver knows which bits are lost but cannot recover them. The situation is shown in figure. Find the capacity of the channel.
Minimize mechanical and stylistic errors : Identify two prewriting techniques discussed in this course that a writer can use to develop relevant supporting points. Provide an example to support your response.
Levels of wealth inequality : Do you think that the federal government should increase levels of taxation on the top 1% to reduce levels of wealth inequality, and why or why not?
Religion and morality presentation : Create an 8- to 10-slide Microsoft® PowerPoint® presentation explaining both the connections and differences between religion and morality. Address the following in your presentation:

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Find the roots of the polynomial

Find the roots of the polynomial - A written part and a Matlab part. The written part will dictate the percentage of the Matlab part in scoring. The written part is closed book closed notes.

  Study and simulate a digital baseband modulation transmitter

Study and simulate a digital baseband modulation transmitter by using MATLAB software. In this lab, we will learn how to generate the transmitted baseband.

  Find the closed-loop transfer function

Find the closed-loop transfer function T(s) = c(s)/R(s). Find a value of Kp that will yield less than 10% overshoot for the closed-loop system. (Note: ignore the zero dynamics to calculate Kp initially)

  Implement the steps outlined and carry out the simulation

Implement the steps outlined and carry out the simulation - Repeat the steps for the specifications - Also produce output waveforms for at least two carrier frequencies. attached document, and provide me with the matlab files for the requirement at..

  Stepper motor driven xy table

Stepper Motor Driven XY Table - Use Matlab and Labjack to acquire digital inputs from limit switches and use Matlab to analyze acquired data

  Write a matlab m-code which solve finite difference equation

Write a Matlab M-code program which solves the Finite Difference equations for the unknown temperatures Ti where the value of N, the number of internal nodes in the vertical direction.

  Calculate and analyze the probability of error for mpsk

Calculate and analyze the probability of error for MPSK under AWGN - Derive mathematically step-by-step the probability of error of MPSK under AWGN where M=2 and M=4;

  Viewing the guided solutions for stormy attaway''s intro

I subscribed for a 7 day study membership trial 2 days ago. I have been viewing the Guided solutions for Stormy Attaway's Intro to programming in Matlab 2nd edition

  Write a program to display all unit-step responses

Write a program that will read in a text string mixed with numbers and letters from the keyboard and count how many numbers there are in the string

  A function of the energy e of the beams

A new particle has been discovered in a lab by colliding two beams of leptons and measuring how many particles are produced as a function of the energy E of the beams. The table below gives the results.

  How do you create a new script or function in matlab

What is the difference between a script and function. How do you create a new script or function in MATLAB

  Create a program to print given sequence

A Fibonacci sequence is composed of elements created by adding the two previous elements. Below is the simplest Fibonacci sequence. Create a program to print above sequence in the command window. Use 'For' loop to implement the logic given in the fi..

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