# Departament of Electrical and Computer Engineering Universidad de Puerto Rico - Mayagüez

Signals and Systems Assignment 1

by Rubén J. Pérez Rivera 843-06-6160

for Prof. Vidya Manian Department of Electrical and Computer Engineering Universidad de Puerto Rico en Mayagüez manian@ece.uprm.edu

February 22, 2013

Assignment 1: Basic Signal Generation Due Date: February 22 2013

. Answer the questions below each question. 4. Show mathematical development (if any) of the results you have presented. Send copy of the document via email. 2. Write name.Introduction: This work introduces students to signal generation. This document has to be submitted with the following modifications: 1. student ID number and date of submission in first page. 3.

Unit Sample Sequence 1 0.10) 1 zeros(1. title('Unit Sample Sequence').6 0. P1.Problem No. %generate a vector from -10 to 20 n=-10:20. %generate the unit sample sequence delta = [zeros(1. Generate the unit sample sequence u[n] and display it.2]). Questions: 1. stem(n. Modify the program to generate a delayed unit sample sequence ud[n] with a delay of 11. axis([-10 20 0 1.20)]. Run the program and display result.delta). xlabel('Time index n').1: Generation of a unit simple sequence % Program 1-1 % Generation of a unit sample sequence clf.8 Amplitude 0.4 0. ylabel('Amplitude'). .2 0 -10 -5 0 5 Time index n 10 15 20 2.

4 0. Run the program and display result.9)]. Unit Sample Sequence 1 0. ylabel('Amplitude').delta).6 0. %generate the unit sample sequence delta = [zeros(1. %generate a vector from -10 to 20 n=-10:20. % Program 1-1 . title('Unit Sample Sequence').21) 1 zeros(1. Modify the program to generate a unit sample sequence s[n]. stem(n.% Program 1-1 % Generation of a unit sample sequence clf.2 0 -10 -5 0 5 Time index n 10 15 20 3. axis([-10 20 0 1. xlabel('Time index n').8 Amplitude 0.2]).

% Generation of a unit sample sequence clf. title('Unit Sample Sequence'). % Program 1-1 % Generation of a unit sample sequence clf.10) 1 zeros(1.6 0. stem(n. Run the program and display result. %generate the unit sample sequence delta = [zeros(1.20)]. axis([-10 20 0 1. ylabel('Amplitude').4 0. xlabel('Time index n'). Unit Sample Sequence 1 0.2 0 -10 -5 0 5 Time index n 10 15 20 4. %generate a vector from -10 to 20 n=-10:20. Modify the program to generate a delayed unit step sequence sd[n] with an advance of 7 samples.delta).2]). .8 Amplitude 0.

P1. axis([-10 20 0 1.6 0. title('Unit Sample Sequence').8 Amplitude 0. xlabel('Time index n').2: Generation of a complex exponential sequence % Program 1-2 % Generation of a complex exponential sequence .3) 1 zeros(1.4 0.u).%generate a vector from -10 to 20 n=-10:20. stem(n. %generate the unit sample sequence u = [ones(1.2 0 -10 -5 0 5 Time index n 10 15 20 Problem No. ylabel('Amplitude').2]). Unit Sample Sequence 1 0.27)].

ylabel('Amplitude'). stem(n. xlabel('Time index n'). Real part 2 1 Amplitude 0 -1 -2 0 5 10 15 20 25 Time index n Imaginary part 30 35 40 2 1 Amplitude 0 -1 -2 0 5 10 15 20 25 Time index n 30 35 40 2. subplot(2. k=2.2). What will happen if parameter c is changed to (1/12)+(pi/6)*i? . subplot(2. Run the program and generate the sequence.1.imag(x)).clf. title('Imaginary part').ylabel('Amplitude'). x=k*exp(c*n). xlabel('Time index n'). c=-(1/21)+(pi/6)*i. title('Real part').real(x)). n=0:40.1.1). stem(n. Questions: 1.

3. run the program and generate the sequence. . Write a program to generate a real exponential seuqnce.Real part 50 Amplitude 0 -50 0 5 10 15 20 25 Time index n Imaginary part 30 35 40 100 Amplitude 50 0 -50 0 5 10 15 20 25 Time index n 30 35 40 It reverses the signal and magnifies its amplitude.

Use the command sum(s. plot(t. sum(y. y=exp(a*t).n=40.*s) to compute the energy of a real sequence s[n] stored as a vector s. t=0:1:n-1. P1. a=. title('Exponential Signal').5 0 0 5 10 15 20 Time Index 25 30 35 40 5. ylabel('Amplitude').5.3: Generation of a sinusoidal sequence % Program 1-3 . Evaluate the energy of the real-valued exponential sequence x[n] generated in question 3. x 10 8 Exponential Signal 3 2.y). xlabel('Time Index').3699e+017 Problem No.5 2 Amplitude 1.*y) ans = 1.5 1 0.

Which parameter controls phase.x). A=1. f=0. Sinusoidal sequence 2 1.1. n=0:40.5. Questions: 1. What is the frequency of this signal and how can it be changed. ylabel('Amplitude'). arg=2*pi*f*n .5 1 0. stem(n. . axis. phase=0.5 -1 -1. axis([0 40 -2 2]).5 Amplitude 0 -0. title('Sinusoidal sequence') xlabel('Time index n'). grid.phase. x=A*cos(arg) clf.% Generation of a sinusoidal sequence clf.Run the program and display the sequence.5 -2 0 5 10 15 20 T ime index n 25 30 35 40 2.

The parameter that controls phase is “phase=0”in the program 3. x=A*cos(arg) clf.5 1 0 . amplitude 2. phase=0.phase.5 and phase shift 90degress and display it. ylabel('Amplitude').Frequency is 0. Modify the program to genrate a sinusoidal sequence of length 50. grid. % Program 1-3 . % Program 1-3 % Generation of a sinusoidal sequence clf.5 -2 0 5 1 0 1 5 2 0 T ein e n im d x 2 5 3 0 3 5 4 0 4. f=0. axis. S u id l se u n in so a q e ce 2 1 . n=0:40.5. frequency 0.x). arg=2*pi*f*n . A=1. axis([0 40 -2 2]). Modify the program to generate a sinusoidal sequence of frequency 0.9. title('Sinusoidal sequence') xlabel('Time index n').5 -1 -1 .1Hz.08. It can be changed by changing the frequency in the program.5 Amplitude 0 -0 . stem(n.9 and display it.

axis([0 50 -2. phase=90.x). f=0.5. ylabel('Amplitude'). n=0:50. arg=2*pi*f*n .5 2 1. title('Sinusoidal sequence') xlabel('Time index n'). axis.5 2.5 0 5 10 15 20 25 30 Time index n 35 40 45 50 .5 -2 -2. grid.5 -1 -1.5 1 0.08.5]). Sinusoidal sequence 2. A=2.5 Amplitude 0 -0. x=A*cos(arg) clf.% Generation of a sinusoidal sequence clf.phase. stem(n.