hw2_sol

pdf

School

California Polytechnic State University, San Luis Obispo *

*We aren’t endorsed by this school

Course

60

Subject

Electrical Engineering

Date

Oct 30, 2023

Type

pdf

Pages

16

Uploaded by CorporalTrout3858

Report
ECE102, Fall 2023 Homework #2 Signals & Systems Prof. J.C. Kao University of California, Los Angeles; Department of ECE TAs: Yang, Bruce, Shreyas Due Friday, 23 Oct 2023, by 11:59pm to Gradescope. Covers material up to Lecture 5. 100 points total. 1. (22 points) Elementary signals. (a) (9 points) Consider the signal x ( t ) shown below. Sketch the following: x(t) 1 1 2 3 4 -1 t 2 i. y ( t ) = x ( t ) [1 u ( t 1) + u ( t 2)] Solution: If we look at u ( t 1) u ( t 2), we’ll see that it is equal to 1 between t = 1 and t = 2, and equals 0 elsewhere. Since subtract one from this expression, the situation is reversed Therefore, its multiplication with x ( t ) will be: y ( t ) = ( x ( t ) t < 1 or t > 2 0 else 1
x(t) 1 1 2 3 4 -1 t 2 ii. y ( t ) = R t −∞ [ δ ( τ + 1) δ ( τ 1) + δ ( τ 2)] x ( τ ) Solution: Using the sifting property, x(t) 1 1 2 3 4 -1 t 2 -1 iii. y ( t ) = x ( t ) + r ( t + 1) u ( t ) 3 r ( t ) + 3 r ( t 1) r ( t 3) Solution: 2
x(t) 1 1 2 3 4 -1 t 2 -1 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
(b) (9 points) Evaluate these integrals: i. R −∞ f ( t + 1) δ ( t + 1) dt Solution: Using the sifting property, we first have: f ( t +1) δ ( t +1) = f (0) δ ( t +1). Therefore, Z −∞ f ( t + 1) δ ( t + 1) dt = f (0) Z −∞ δ ( t + 1) dt = f (0) . ii. R t e 2 τ u ( τ 1) Solution: To evaluate this integral, we have to consider two cases; the first one is when t 1 and the second one is when t < 1. This is because u ( τ 1) is one when τ 1 and zero otherwise. Thus, if t 1, then: Z t e 2 τ u ( τ 1) = Z t e 2 τ = e 2 τ 2 t = e 2 t 2 If t < 1, then: Z t e 2 τ u ( τ 1) = Z 1 e 2 τ = e 2 τ 2 t = e 2 2 . iii. R 0 f ( t )( δ ( t 1) + δ ( t + 1)) dt Solution: The integral can be decomposed as follows: Z 0 f ( t ) δ ( t 1) dt + Z 0 f ( t ) δ ( t + 1) dt Using the sifting property for the first integral, we have: Z 0 f ( t ) δ ( t 1) dt = Z 0 f (1) δ ( t 1) dt = f (1) The second integral is zero, because δ ( t + 1) is centred at t = 1 and the limits of the integration do not include t = 1. Therefore, Z 0 f ( t )( δ ( t 1) + δ ( t + 1)) dt = f (1) (c) (4 points) Let b be a positive constant. Show the following property for the delta function: δ ( bt ) = 1 b δ ( t ) Hint: what function is “delta-like”? Solution: 4
We know that δ ( t ) is defined as follows: δ ( t ) = lim 0 rect ( t ) Therefore, δ ( bt ) = lim 0 rect ( bt ) The rectangle rect ( bt ) is shown in Fig. 1. Let ∆ = ∆ /b , then the same rectangle can be written as: rect ( bt ) = 1 b rect ( t ) Therefore, δ ( bt ) = lim 0 rect ( bt ) = lim 0 1 b rect ( t ) = 1 b δ ( t ) Note : we can extend this argument to b < 0. In general for any b ̸ = 0, we have: δ ( bt ) = 1 | b | δ ( t ) Figure 1: 5
2. (23 points) Expression for signals. (a) (15 points) Write the following signals as a combination (sums or products) of unit triangles ∆( t ) and unit rectangles rect( t ). Solution: i. Fig. i)We can see this signal as the sum of two shifted unit triangles, where the first one’s magnitude is amplified by 2, i.e., x ( t ) = 2∆( t 1) + ∆( t 2). ii. Fig. ii) We can express this signal as the sum of three triangles with the first one shifted to the left, the second one not shifted, and the third one shifted to the right. Their adjacent sides merge into the horizontal lines for 1 t ≤ − 0 . 5 and 0 . 5 t 1. All three triangles are compressed by a factor of 2. Therefore, x ( t ) = ∆(2( t 1)) + ∆(2( t + 1)) + 2∆( t ). iii. Fig. iii) We can first represent the outmost sides in terms of unit triangles with peaks at x = 1 and x = 1. Therefore we get 2∆( t + 1) + 2∆( t 1). We also notice a vertical change of 2 at x = 0 . 5 and x = 0 . 5, which indicates there is a 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
rectangle with magnitude of 2. Thus we get 2rect( t ). After that, the only waveform left in the figure is a unit triangle ∆( t ) . The signal can be expressed as follows: x ( t ) = 2∆( t + 1) + 2∆( t 1) + 2rect( t ) + ∆( t ) (b) (8 points) Express each of the signals shown below as sums of scaled and time shifted unit-step functions. Solution: i. x a ( t ) = u ( t ) + 2 u ( t 1) 3 u ( t 3) 4 u ( t 4) ii. x b ( t ) = 2 u ( t 1) + u ( t 8) u ( t 3) + 2 u ( t 7) 2 u ( t 5) 7
3. (30 points) System properties. (a) (20 points) A system with input x ( t ) and output y ( t ) can be time-invariant, causal or stable. Determine which of these properties hold for each of the following systems. Explain your answer. i. y ( t ) = | x ( t ) | + x ( t 2 ) Solution: Time-invariance : If we delay the input by τ , i.e., x τ ( t ) = x ( t τ ), the output is: y τ ( t ) = | x τ ( t ) | + x τ ( t 2 ) = | x ( t τ ) | + x ( t 2 τ ) On the other hand, y ( t τ ) = | x ( t τ ) | + x (( t τ ) 2 ) Since y ( t τ ) ̸ = y τ ( t ), the system is time-variant. Causality : Since the output can depend on future values of the input, the system is not causal. For instance, the output at t = 2 depends on x (4). Stability : If | x ( t ) | ≤ B x for any t , then | y ( t ) | = | x ( t ) | + x ( t 2 ) ≤ | x ( t ) | + x ( t 2 ) 2 B x The output is also bounded, the system is then stable. ii. y ( t ) = R t + T t T x ( λ ) , where T is positive and constant. Solution: Time-invariance : If we delay the input by τ , i.e., x τ ( t ) = x ( t τ ), the output is: y τ ( t ) = Z t + T t T x τ ( λ ) = Z t + T t T x ( λ τ ) Let λ = λ τ , then y τ ( t ) = Z t + T τ t T τ x ( λ ) = Z ( t τ )+ T ( t τ ) T x ( λ ) which is equal to y ( t τ ). The system is then time-invariant. Causality : The system is integrating values of x ( t ) from t T to t + T . The output depends on future values of x ( t ), therefore it is not causal. Stability : If | x ( t ) | ≤ B x for any t , then | y ( t ) | = Z t + T t T x ( λ ) Z t + T t T | x ( λ ) | Z t + T t T B x = 2 TB x The output is also bounded, the system is then stable. iii. y ( t ) = ( t + 1) R t −∞ x ( λ ) Solution: 8
Time-invariance : If we delay the input by τ , i.e., x τ ( t ) = x ( t τ ), the output is: y τ ( t ) = ( t + 1) Z t −∞ x τ ( λ ) = ( t + 1) Z t −∞ x ( λ τ ) Let λ = λ τ , then y τ ( t ) = ( t + 1) Z t τ −∞ x ( λ ) On the other hand, y ( t τ ) = ( t τ + 1) Z t τ −∞ x ( λ ) Therefore y ( t τ ) ̸ = y τ ( t ). The system is then time variant. Causality : The system is integrating values of x ( t ) up to time t . The output does not depend on future values of x ( t ), the system is then causal. Stability : Even if x ( t ) is absolutely bounded, the integral: Z t −∞ x ( λ ) cannot in general be bounded, the system is unstable. For instance, suppose x ( t ) = 1, then R t −∞ 1 → ∞ . Another example, suppose x ( t ) = u ( t ), then y ( t ) = ( t + 1) Z t −∞ u ( λ ) = ( t + 1) Z t 0 1 = ( t + 1) t ( t + 1) t cannot be bounded as t → ∞ , because ( t + 1) t → ∞ as t → ∞ . iv. y ( t ) = 1 + e x ( t ) Solution: Time-invariance : If we delay the input by τ : x τ ( t ) = x ( t τ ), the output is: y τ ( t ) = 1 + e x τ ( t ) = 1 + e x ( t τ ) Similarly, y ( t τ ) = 1 + e x ( t τ ) Since y ( t τ ) = y τ ( t ). The system is then time-invariant. Causality : Since the output does not depend on any future values of the input, the system is causal. Stability : If | x ( t ) | ≤ B x for any t , then | y ( t | ≤ e B x We know that exponent function is finite if the input is finite, thus the output is bounded, and the system is stable. 9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
v. y ( t ) = 1 1+ x 2 ( t ) Solution: Time-invariance : If we delay the input by τ , i.e., x τ ( t ) = x ( t τ ), the output is: y ( t ) = 1 1 + x 2 τ ( t ) = 1 1 + x 2 ( t τ ) On the other hand, y ( t τ ) = 1 1 + x 2 ( t τ ) Therefore y ( t τ ) = y τ ( t ). The system is then time invariant. Causality : The output depends on present value of the input. The system is then causal. Stability : We have the denominator: 1 + x 2 ( t ) 1 = 1 1 + x 2 ( t ) 1 for any t . This implies that y ( t ) 1. Moreover y ( t ) > 0, therefore for any t , we always have | y ( t ) | ≤ 1. The system is always stable. (b) (6 points) Consider the following three systems: S 1 : w ( t ) = x ( t/ 2) S 2 : z ( t ) = Z t −∞ w ( τ ) S 3 : y ( t ) = S 3 ( z ( t )) The three systems are connected in series as illustrated here: Choose the third system S 3 , such that overall system is equivalent to the following system: y ( t ) = Z t 1 −∞ x ( τ ) Solution: We first express z ( t ) in terms of x ( t ): z ( t ) = Z t −∞ w ( τ ) = Z t −∞ x ( τ/ 2) 10
Let τ = τ/ 2, then = dτ/ 2 and τ t = τ = τ/ 2 t/ 2, z ( t ) = 2 Z t/ 2 −∞ x ( τ ) To obtain the required y ( t ) from z ( t ), we need first to do a time-scaling by 2 for z ( t ). This step gives us: z (2 t ) = 2 Z t −∞ x ( τ ) The second step is to do a right shift by 1: z (2( t 1)) = 2 Z t 1 −∞ x ( τ ) Therefore, the third system is as follows: y ( t ) = 1 2 z (2( t 1)) (c) (4 points) In part (b), you saw an example of three systems connected in series. In general, systems can be interconnected in series or in parallel to form what we call cascaded systems. The figure below shows the difference between a series cascade and a parallel cascade. Note that parts (b) and (c) are unrelated. i. (2 points) Show that the series cascade of any two time-invariant systems is also time-invariant. Solution: Suppose the output of S 1 is y 1 ( t ) when the input is x ( t ), and that the output of S 2 is y ( t ) when the input is y 1 ( t ). If we delay x ( t ) by τ (the input to the first system is now x ( t τ )), then the output of the first system is y 1 ( t τ ). This 11
is because the system is time-invariant. y 1 ( t τ ) is now the input to the second system. Again, since the second system is time-invariant, the output of the second system is y ( t τ ). Therefore, for the overall system, when we apply x ( t τ ) as input, we get y ( t τ ) as output. The series cascade is then time-invariant. ii. (2 points) Show that the parallel cascade of any two time-invariant systems is also time-invariant. Solution: Suppose for input x ( t ), we get the outputs y 1 ( t ) and y 2 ( t ) respectively from S 1 and S 2 . Therefore, y ( t ) = y 1 ( t ) + y 2 ( t ). If we delay the input by τ (the input is now x ( t τ )), then we get y 1 ( t τ ) and y 2 ( t τ ) respectively from S 1 and S 2 because both systems are time-invariant. Therefore, the output is y 1 ( t τ )+ y 2 ( t τ ) which is equal to y ( t τ ). Thus, the overall system is time-invariant. iii. ( Optional ) Can you think of two time-variant systems, whose series cascade is time-invariant ? Can you think of two time-variant systems, whose parallel cascade is time-invariant ? Solution: Yes, for series cascade: S 1 : y ( t ) = x ( t/ 2) and S 2 : y ( t ) = x (2 t ) For parallel cascade: S 1 : y ( t ) = x ( t ) tx ( t ) and S 2 : y ( t ) = x ( t ) + tx ( t ) 4. (10 points) Power and energy of complex signals (a) (5 points) Let x ( t ) = Ae jωt + Be jωt where A and B are complex numbers expressed in polar form A = r 1 e B = r 2 e Is x ( t ) a power or energy signal? If it is an energy signal, compute its energy. If it is a power signal, compute its power. ( Hint: Use the fact that the square magnitude of a complex number v is: | v | 2 = v v , where v is the complex conjugate of the complex number v . ) Solution: x ( t ) is a periodic signal, therefore it is not an energy signal (its energy goes to infinity). It is a power signal. To calculate its power, we compute first the magnitude of x ( t ): | x ( t ) | 2 = x ( t ) x ( t ) = ( r 1 e j ( ωt + ϕ ) + r 2 e j ( ωt ϕ ) )( r 1 e j ( ωt + ϕ ) + r 2 e j ( ωt ϕ ) ) = r 2 1 + r 1 r 2 e j 2 ωt + r 1 r 2 e j 2 ωt + r 2 2 = r 2 1 + r 2 2 + 2 r 1 r 2 cos(2 ωt ) 12
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Therefore, the power of x ( t ): P = lim T →∞ 1 2 T Z T T ( r 2 1 + r 2 2 + 2 r 1 r 2 cos(2 ωt ) ) dt = lim T →∞ 1 2 T 2 Tr 2 1 + 2 Tr 2 2 + r 1 r 2 sin(2 ωt ) ω T T ! = lim T →∞ 1 2 T 2 Tr 2 1 + 2 Tr 2 2 + 2 r 1 r 2 sin(2 ωT ) ω = r 2 1 + r 2 2 (b) (5 points) Is x ( t ) = e (2+ 1 + 2 ) t u ( t + 3) an energy signal or power signal? Again, if it is an energy signal, compute its energy. If it is a power signal, compute its power. Solution: x ( t ) = e (2+ 1 + 2 ) t u ( t + 3) = e 2 t e j ( ω 1 + ω 2 ) t u ( t + 3) The magnitude of x ( t ) is given by: | x ( t ) | = e 2 t u ( t + 3) Therefore, its energy is: E = Z 3 e 4 t dt = e 4 t 4 t = 3 = e 12 4 Therefore, it is an energy signal. Its power is then 0. 5. (15 points) Python (a) (3 points) Task 1 A complex sinusoid is denoted: y ( t ) = e ( σ + ) t First compute a vector representing time from 0 to 10 seconds in about 500 steps (You can use np.linspace ). Use this vector to compute a complex sinusoid with a period of 2 seconds, and a decay rate that reduces the signal level at 10 seconds to 1/3 its original value. What σ and ω did you choose? Also, Hint: to define complex number e (5+6 j ) y = np . exp( 5 + 1 j *6 ) Solution: We want the period to be of 2 seconds, this implies that ω = π . We also want a decay rate that reduces the signal level at 10 seconds to 1/3 of its original value, this implies: e 10 σ = 1 3 = σ = ln(3) / 10 13
t = np . linspace( 0 , 10 , 500 ) T = 2 omega = 2 * np . pi / T sigma = np . log( 1 / 3 ) / 10 print ( 'sigma = ' + str (sigma)) print ( 'omega = ' + str (omega)) y = np . exp((sigma + 1 j * omega) * t) Values of sigma and omega are: sigma = -0.10986122886681098 omega = 3.141592653589793 (b) (7 points) Task 2 Use the y.real() and y.imag() Python functions to extract the real and imaginary parts of the complex exponential. i. (5 points) Plot them as a function of time (plot them separately, you can use subplot for this task). This should look more reasonable. Label your axes, and check that your signal has the required period and decay rate. Solution: y_re = np . real(y) y_im = np . imag(y) fig_5b = plt . figure() plt . subplot( 2 , 1 , 1 ) plt . plot(t, y_re) plt . ylabel( r'$\mathcal {Re} \{y(t)\}$' ) plt . title( r'Real and Imaginary Parts of $y(t)$' ) plt . subplot( 2 , 1 , 2 ) plt . plot(t, y_im) plt . xlabel( r'$t$' ) plt . ylabel( r'$\mathcal {Im} \{y(t)\}$' ) plt . show() Figure 2: Task 2, part i) 14
ii. (2 points) Plot the imaginary component of y as a function of real component of y. What can be inferred from the plot ? Hint: Comment on the shape of the plot and what we can infer about the envelope of y ( t ) from the shape? Solution: Code and Plot for imaginary vs real plt . plot(y_re, y_im) plt . xlabel( r'$\mathcal {Re} \{y(t)\}$' ) plt . ylabel( r'$\mathcal {Im} \{y(t)\}$' ) plt . title( r'Imaginary vs Real Parts of $y(t)$' ) plt . show() Figure 3: Task 2, part ii) The shape is in the form of spiral showing that the signal does not have a constant envelope. It is either growing or decaying. 15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
(c) (5 points) Task 3 Use the np.abs() and np.angle() functions to plot the magnitude and phase angle of the complex exponential (plot them in the same figure). Scale the np.angle() plot by dividing it by 2*pi so that it fits well on the same plot as the np.abs() plot (i.e. plot the angle in cycles, instead of radians, the function np.angle(x) returns the angle in radians). Feel free to also explore and visualize the change in the wave-forms for different sigma and omega values. Solution: y_mag = np . abs(y) y_faz = np . angle(y) fig_5c = plt . figure() plt . subplot( 2 , 1 , 1 ) plt . plot(t, y_mag) plt . ylabel( r'$|y(t)|$' ) plt . title( r'Magnitude and Phase Angle of $y(t)$' ) plt . subplot( 2 , 1 , 2 ) plt . plot(t, y_faz / ( 2 * np . pi)) plt . xlabel( r'$t$' ) plt . ylabel( r'$\angle y(t)$' ) plt . show() Figure 4: Task 3 Plotting both the graphs in the same plot instead of a subplot is also fine. 16

Browse Popular Homework Q&A

Q: In a dog race, a dog accelerates from a speed of 4 m/s to a speed of 9 m/s over a distance of 50…
Q: Find the general solutions to the differential equations:   y" + 5y' - 6y = 0 y" + 6y' - 9y = 0…
Q: Goldenrod Company makes artificial flowers and reports the following data for the month: Purchases…
Q: ccompanying data set and construct a 95​% confidence interval estimate of the mean pulse rate of…
Q: The pathway that can move highest rates of sodium ions is: A. Sodium channels B. Sodium…
Q: How do you think your beliefs about teaching and learning were shaped by your personal experiences…
Q: Calculate the magnitude and direction of the Coulomb force on each of the three charges shown in the…
Q: 14. Open Skies purchased a portfolio of available-for-sale securities during the year. The cost and…
Q: Find the area and perimeter of an isosceles triangle whose base is 48 and one of equal sides is 22…
Q: write a program that consists of two threads. The first is the main thread that every Java…
Q: 951 mol of N2 gas is in a constant volume 235.6 L turbine at 25 °C. If 11.36 MJ of heat energy is…
Q: Question 6 L Given the matrices A and B, find the matrix product AB. 50 - [8 -2]. B = [-23] 3 -2 1…
Q: Question 6 In what way do the bones of the skeletal system relate to the immune system? B C D The…
Q: When studying radioactive​ material, a nuclear engineer found that over 365​ days, 1,000,000…
Q: Given main.py and a Node class in Node.py, complete the LinkedList class (a linked list of nodes) in…
Q: Why is a variable that belongs to the class, and not to individual instances named static  What…
Q: Solve the given differential equation. et² dy=x dy=x√2-ydx
Q: a. Find the probability of selecting a class that runs between 51.5 and 51.75 minutes. ​(Round to…
Q: Write an Arm Assembly Program that does the following: •Stores on the stack a list of words of…
Q: Find the area of the shaded region. The graph depicts the standard normal distribution of bone…
Q: The data table contains waiting times of customers at a​ bank, where customers enter a single…
Q: 2. On January 1, 2015, Schultz Corporation issued $100,000 of its ten-year, 6% bonds payable at…