Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask MATLAB Expert

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:

http://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

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M92004865
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in MATLAB

Discrete optimisation- solve the following two problems

Discrete Optimisation - Solve the following two problems with both exhaustive enumeration and branch and bound - Problem 1 is a mixed integer linear optimisation problem (the problem has both discrete and continuous vari ...

Prepare a 3 - 10 pages long reportprepare a presentation

Prepare a 3 - 10 pages long report Prepare a presentation with 5 - 9 slides. The slides will include introduction (need and similar work), theoretical background (tested neural networks), Data, Results (Comparison of the ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

Lab assignment - matlab matrix relationallogical operators

Lab Assignment - MATLAB Matrix, Relational/Logical Operators and Plotting This laboratory exercise/assignment will involve you 1) practicing multiplication operators in MATLAB; 2) practicing relational and logical operat ...

Assignmentq1 find the laplace transforms of the following

Assignment Q.1 Find the Laplace transforms of the following functions: (a) t 2 + at + b and (b) sin(2nΠt/T) Q.2 Find f (t) for the following F(s) = α[ f (t)]. (i) 5/(s + 3), (ii) 1/s 2 + 25, (iii) 1/s(s+1) Q.3 Find the L ...

Suppose that you have used some concept learning algorithm

Suppose that you have used some concept learning algorithm to learn a hypothesis h1 from some training data. You are interested in knowing the accuracy that the hypothesis can be expected to achieve on the underlying pop ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Assignmentafter the success of your robo-advice venture you

Assignment After the success of your robo-advice venture you decide to explore alternative sources of profitability for your company. You realize that Australian investors are often forced to chose between expensive acti ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As