homework 5 solutions

8
ECE301, HW5; DUE: February 2, 2015 [Name:___________SOLUTIONS ______________ ] Peer Reviewed by: _____________________________ PROBLEM 1: The following signals are in the form e n . Find values of and . Make two sketches on complex plane, the first plotting and the second plotting . If you need extra help with this notation, read section B1.2 in the text – review of polar notation in complex numbers. You will need to be very familiar with this for discrete signal processing! a) e 3 n =γ n ¿ 3 γ=e 3 =0.049 b) e jπn = γ n ¿ =−j ( 3.14159 ) γ=e j∠(−π) c) e ( j 2njπn ) =γ n ¿ j ( 2π) =j (−1.14159 ) γ=e j(−1.14159) =e j∠ (−65 o ) Page 1 -65 o -90 o 2π -3 Re() Im() 0.049 Re( γ) Im( γ) Re() Im() Re( γ) Im( γ) Re() Im() Re( γ) Im( γ) Re() Im() Re( γ) Im( γ) - -1

Upload: wick

Post on 14-Dec-2015

218 views

Category:

Documents


2 download

DESCRIPTION

ECE 301 Solutions IUPUI Signals and Systems

TRANSCRIPT

Page 1: Homework 5 Solutions

ECE301, HW5;DUE:

[Name:___________SOLUTIONS______________]

Peer Reviewed by: _____________________________

PROBLEM 1:

The following signals are in the form en. Find values of and . Make two sketches on complex plane, the first plotting and the second plotting . If you need extra help with this notation, read section B1.2 in the text – review of polar notation in complex numbers. You will need to be very familiar with this for discrete signal processing!

a) e−3n=γn

¿−3

γ=e−3=0.049

b) e− jπn=γn

¿− j π=− j(3.14159)

γ=e j∠(−π )

c) e( j2n− jπn)=γ n

¿ j (2−π )= j(−1.14159)

γ=e j(−1.14159)=e j∠(−65o )

d) e−(2n+ j π

3n)=γ n

¿−2− j π3=−2− j1.04

Page 1

-65o

-90o

2−π

-3

Re() (

Im() (

0.049Re(γ ) (

Im(γ ) (

Re() (

Im() (

Re(γ ) (

Im(γ ) (

Re() (

Im() (

Re(γ ) (

Im(γ ) (

Re() (

Im() (

Re(γ ) (

Im(γ ) (

-π-1

-60o

-2

-1.04

Page 2: Homework 5 Solutions

ECE301, HW5;DUE:

[Name:___________SOLUTIONS______________]

Peer Reviewed by: _____________________________

γ=e−(2+ j π

3)=e−(2)e

j∠(−π3

)=0.1353e

j∠(−π3

)

PROBLEM 2:

A cash register output y [n] is the total cost of n items rung up by the cashier. The input x [n] is is the cost of the n-th item.

(a) Write a difference equation relating y [n] to x [n].

Summing from the previous total the new input x:y [n ]=x [n ]+ y [n−1 ]

Grouping y’s on left, x’s on right:y [n ]− y [n−1 ]=x [n ]

Shifting to get all n+… equation (this will be important later).y [n+1 ]− y [n ]=x [n+1 ]

accepting any of the above equations….

(b) Draw this function with time-delay elements and adders (see example 3.4, figure 3.11)

Page 2

D

+x[n]

y[n]

y[n-1]

Page 3: Homework 5 Solutions

ECE301, HW5;DUE:

[Name:___________SOLUTIONS______________]

Peer Reviewed by: _____________________________

PROBLEM 3:

A moving average is used to detect a trend of a rapidly fluctuating variables such as stock prices. A stock price may fluctuate daily, masking a long-term trend. We can better find the long-term trend by smoothing (averaging) the past N values of the prices. Consider a 6 day moving average denoted as y [n ] , as the average for the past 6 end-of-day prices where x [n] is the current day’s price and x [n−1 ] ,… ,x [n−5 ] are the previous day’s prices.

(a) Write the difference equation relatiny [n ] to x [n].

output is the sum of current day plus older days:

y [n ]=16

(x [n ]+x [n−1 ]+x [n−2 ]+x [n−3 ]+x [n−4 ]+x [n−5] )

shifting to make n+…:

y [n+5 ]=16

( x [n+5 ]+x [n+4 ]+x [n+3 ]+x [n+2 ]+x [n+1 ]+x [n ])

(b) Draw this moving average filter with time-delay elements and weighting factors on connectors (see example 3.4, figure 3.11)

(The 1/6 th can also go at the input x[n] or at the output after the sum before y[n]):

Page 3

D D D D D

16

16

16

16

16

16

x[n]

y[n]

∑❑

Page 4: Homework 5 Solutions

ECE301, HW5;DUE:

[Name:___________SOLUTIONS______________]

Peer Reviewed by: _____________________________

PROBLEM 4:

Fibonacci found a sequence of integers {0 1 1 2 3 5 8 13 21 34…}. This sequence sums the previous two Fibonacci numbers.

(a) Find the difference equation describing this sequence: f [n ]

Several forms as before:f [n ]=f [n−1 ]+ f [n−2]

f [n ]−f [n−1 ]−f [n−2]=0

f [n+2 ]−f [n+1 ]−f [n ]=0

(b) Find the 25th and 26th Fibonacci numbers, you can use a calculator, spreadsheet, or MATLAB!

Using MATLAB, like the iterative solutions in the textbook (CE3.3):

n=(0:26); f=[0;1;zeros(length(n)-2, 1)];for k=1:length(n)-2,f(k+2)=f(k+1)+f(k);end;

Then you can look at the vector f to find the solution (see next page)

Don’t forget that the series starts at f(1)=0 here (this will match the MATLAB numbering of the data:

f25 46368f26 75025

Page 4

Page 5: Homework 5 Solutions

ECE301, HW5;DUE:

[Name:___________SOLUTIONS______________]

Peer Reviewed by: _____________________________

Page 5

Page 6: Homework 5 Solutions

ECE301, HW5;DUE:

[Name:___________SOLUTIONS______________]

Peer Reviewed by: _____________________________

f1 0f2 1f3 1f4 2f5 3f6 5f7 8f8 13f9 21

f10 34f11 55f12 89f13 144f14 233f15 377f16 610f17 987f18 1597f19 2584f20 4181f21 6765f22 10946f23 17711f24 28657f25 46368f26 75025f27 121393

Page 6