# Lab and Assignment

Lab6 – Discrete-Time Signals and Systems

• Watch video entitled “Module 6 –  Discrete-Time Signals in MATLAB”
• Work the lab activity below using MATLAB.
• Include answers for Problems and include MATLAB coding along with any output plots that support solutions into a Word document entitled “Lab6_StudentID”.  Where your student id is substituted in the file name.
• Upload file “Lab6_StudentID”.

Activity 1:

Haven’t Found The Relevant Content? Hire a Subject Expert to Help You With
Lab and Assignment
Post Your Own Question And Get A Custom Answer

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

HW6 – Discrete-Time Signals and Systems

• Read Chapter 9 in the text Signals and Systems Using MATLAB.
• Download and review the supplement questions.  Also review the supplement questions from lesson 1 which has discrete periodic examples.
• Work the below 3 homework problems.
• Submit homework solutions via Assignment Upload Tool.  Show all work for full credit.
1. Compute the unit-pulse response h[n] for n=0, 1, 2 for the discrete time system
2. Determine is each of the following signals is periodic.  If a signal is periodic, what is its period?
• x[n] = 3sin(100n)
• x[n] = 4cos(1.5πn)
3. For the discrete signals defined as the following:

x[0] = 4, x[1] = 1, x[3] = -1, x[n] = 0 for all other integers n.

v[0] = 1, v[1] = -2, v[2] = 3, v[3] = -4, v[n] = 0 for all other integers n.

Compute the convolution x[n]*v[n] for n ≥ 0.

## Calculate the price of your order

Select your paper details and see how much our professional writing services will cost.

We`ll send you the first draft for approval by at
Price: \$36
• Freebies
• Format
• Formatting (MLA, APA, Chicago, custom, etc.)
• Title page & bibliography
• 24/7 customer support
• Amendments to your paper when they are needed
• Chat with your writer
• 275 word/double-spaced page
• 12 point Arial/Times New Roman
• Double, single, and custom spacing
• We care about originality

Our custom human-written papers from top essay writers are always free from plagiarism.

• We protect your privacy

Your data and payment info stay secured every time you get our help from an essay writer.

• You control your money

Your money is safe with us. If your plans change, you can get it sent back to your card.

## How it works

1. 1
You give us the details
Complete a brief order form to tell us what kind of paper you need.
2. 2
We find you a top writer
One of the best experts in your discipline starts working on your essay.
3. 3
You get the paper done
Enjoy writing that meets your demands and high academic standards!

## Samples from our advanced writers

Check out some essay pieces from our best essay writers before your place an order. They will help you better understand what our service can do for you.

## Perks of our essay writing service

We offer more than just hand-crafted papers customized for you. Here are more of our greatest perks.

• Swift delivery
Our writing service can deliver your short and urgent papers in just 4 hours!
• Professional touch
We find you a pro writer who knows all the ins and outs of your subject.
• Easy order placing/tracking
Create a new order and check on its progress at any time in your dashboard.
• Help with any kind of paper
Need a PhD thesis, research project, or a two-page essay? For you, we can do it all.
• Experts in 80+ subjects
Our pro writers can help you with anything, from nursing to business studies.
• Calculations and code
We also do math, write code, and solve problems in 30+ STEM disciplines.

## Frequently asked questions

Get instant answers to the questions that students ask most often.

• ### What if I’m dissatisfied with the paper I get?

The average quality score at our professional custom essay writing service is 8.5 out of 10. The high satisfaction rate is set by our Quality Control Department, which checks all papers before submission. The final check includes:
• Compliance with initial order details.
• Plagiarism.
• Proper referencing.
If for some reason we happen to leave a mistake unnoticed, you are invited to request unlimited revisions of your custom-written paper. For more information, check our Revision Policy. We will do our best to make your experience with Familiar Essays enjoyable.
• ### I need an essay on the same day. Is it something you can do?

Sure. Our writing company offers a fast service with an 8-hour deadline for orders up to master’s level. Make sure to specify the deadline in the order form and our writers will write a paper within the indicated timeslot. Just proceed to submit your requirements here Once you order a custom-written essay, our managers will assign your order to the well-suited writer, who has the best skills and experience for preparing your specific assignment. You can also request one of these extra features:
• Choose the Writer’s Samples option – study 3 randomly-provided pages from orders that have been written by the assigned writer.
• Request a specific writer – choose an academic writer from the dropdown list in the order’s form (optional for returning customers).
You can be sure that your custom writing order will be accomplished by one of our 400+ professional academic writers. They all pass a series of tests to prove their writing prowess and hold the reputation of being the most professional in the industry. Want to make sure writer’s skills match your needs? Get more details on how to choose the appropriate author.
• ### How can I be sure your writing service is not a scam?

We understand that a shade of mistrust has covered the paper writing industry, and we want to convince you of our loyalty. Apart from high-quality writing services, we offer:
• The chances of students to boost writing skills in a quick and effective way.
• The opportunity to manage studies and free time in an enjoyable manner.
• The possibilities to improve overall academic performance.
Our custom writing company has been working for more than 12 years and always puts quality and clients’ needs first. Our operations are legally documented, we are easily accessible online and offline,
• ### Is it legal to use your professional writing service?

Yes. Custom writing help is not prohibited by any university or college. It’s a 100% legal way of getting professional assistance with paper writing. Hiring writers from an essay writing company is in many ways similar to consulting a tutor – we help you solve the writing issues at hand.
• ### How does your service work?

Our custom writing service is a reliable solution on your academic journey that will always help you if your deadline is too tight. You fill in the order form with your basic requirements for a paper: your academic level, paper type and format, the number of pages and sources, discipline, and deadline. Then, you describe the specific details of the paper you need: add the topic, write or paste the instructions, and attach files to be used, if you have them. After that, an online customer support representative chooses the best writer that specializes in your discipline and assigns him or her to complete the paper according to your requirements. When the paper is ready, we check it for plagiarism and send it to you. If you want to change something, you can request a free revision.