Discrete Time Convolution HW EEE 203 Wang

pdf

School

Arizona State University *

*We aren’t endorsed by this school

Course

203

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

16

Uploaded by DukePartridge4215

Report
Signals and Systems, I Discrete Time Convolution Signals and systems, I Homework: Discrete Time Convolution INTRODUCTION CONVOLUTION Convolution is a very important technique in signals and systems. While continuous-time convolution is important for theoretical analysis, you have to understand how to do discrete- time convolution in order to write a program to implement it on a computer or a DSP chip. This assignment will help you understand how to perform discrete time convolution operation with delta, window, unit step and exponential functions. For a discrete time, Linear and Time Invariant (LTI) system with impulse response h[n] as shown in Fig. 1, the output y[n] can be obtained through the convolution of input signal x[n] and impulse response h[n] as defined in Eqn. 1. TASK ONE: Convolution with a Delta Function Calculate the convolution of the following two signals 𝑦 [ 𝑛 ]= 𝑥 [ 𝑛 ] [ 𝑛 ] a. Write x[n] as a sum of delta functions similar to Eqn. 6. From the graph given: x [ n ] = ¿ Therefore: x [ n ] = σ [ n 1 ] σ [ n 2 ] b. Compute convolution using the method shown in Eqn. 8. Plot your y[n] in a figure similar to Fig. 2. From the graph we are given that: x [ n ] = σ [ n 1 ] σ [ n 2 ] h [ n ] = σ [ n ] + 2 σ [ n 1 ] +− σ [ n 2 ] From the convolution theory: y [ n ] = x [ n ] h [ n ] i h [ n ] σ [ n n 0 ] = σ [ n n 0 ] ii Applying equation i and ii we obtain:
Signals and Systems, I Discrete Time Convolution y [ n ] = h [ n ] σ [ n 1 ] h [ n ] σ [ n 2 ] y [ n ] = σ [ n 1 ] + σ [ n 2 ] 3 σ [ n 3 ] + σ [ n 4 ] This plot is as shown below: Figure 1: plot of the resultant signal from calculation. c. Go to http://jdsp.engineering.asu.edu/JDSP-HTML5/JDSP.html. Build the simulation diagram as shown in Fig. 1. Figure 2: Convolution as a sum of shifted and scaled input signals Open up Plot 6, 7 and 9. Choose “Plot Quantity” as “Real” at the top and “Plot” as “Discrete” at the bottom. Take a screen shot. Verify Plot 9 is a sum of Plot 6 and 7, as y[n] is a sum of scaled and shifted h[n]’s.
Signals and Systems, I Discrete Time Convolution Figure 3: Graph for plot 6 Figure 4: Graph for plot 7 Figure 5: Graph for plot 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
Signals and Systems, I Discrete Time Convolution Compare your own plot y[n] with Plot 9. Are they the same? You can also see values of y[n] by clicking “Graph Values”. The results from calculation and simulation are the same. From the plotted graphs shown in figure 1 and figure 5. d. Verifying the results: Figure 6: Direct convolution Figure 7: Resultant waveform in plot 4
Signals and Systems, I Discrete Time Convolution TASK TWO Convolution with a Window Function Here a window function is informally defined as a finite number of impulses. Suppose the impulse response is a simple two-impulse window function: Calculate the convolution of the two signals 𝑦[𝑛] = 𝑥[𝑛] ∗ ℎ[𝑛] , where x[n] is defined in Fig. 7 and h[n] is defined in Eqn. 9. a. In Fig. 7, move the convolution machine from left to right and calculate y[n] by hand. Figure 8: Convolution machine with window function Solution: From the graph in figure above: x [ n ] = ¿ h [ n ] = 0.5 ( σ [ n ] + σ [ n 1 ] )
Signals and Systems, I Discrete Time Convolution y [ n ] = x [ n ] h [ n ] = 0.5 ( x [ n ] + x [ n 1 ] ) ……….i From equation I above therefore using the input x[n] we obtain the values of y[n] as: y [ 0 ] = 0.5 ( 0 + 1 ) = 0.5 1 = 0.5 y [ 1 ] = 0.5 ( 1 + 3 ) = 4 0.5 = 2 y [ 2 ] = 0.5 ( 3 + 2 ) = 0.5 5 = 2.5 y [ 3 ] = 0.5 ( 2 + 1 ) = 0.5 3 = 1.5 y [ 4 ] = 0.5 ( 0 + 1 ) = 0.5 1 = 0.5 b. Go to http://jdsp.engineering.asu.edu/JDSP-HTML5/JDSP.html. Build the simulation diagram in Fig. 5. Define Sig. Gen. 1 and 2 as x[n] and h[n] using “User-Defined” signal. Open up Sig. Gen. 1, 2 and Plot 4, make sure all three plots are visible. Take a screenshot. (Take separate screenshots if they cannot fit on the same window.) Figure 9: Generator 1 signals Figure 10: Generator 2 signals
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
Signals and Systems, I Discrete Time Convolution Figure 11: the output plot signals Figure 12: Graph values Is y[n] the same as you calculated in Part a? Yes, if you compare the calculated values in part a and the graph values in figure 12 above, they are the same. TASK THREE Convolution with a Shifted Window Function Now let’s look at a shifted version of the two-impulse window function:
Signals and Systems, I Discrete Time Convolution Figure 13: Convolution machine with time-shifted window function Calculate the convolution of the two signals 𝑦 [ 𝑛 ]= 𝑥 [ 𝑛 ] [ 𝑛 ], where x[n] is defined in Fig. 13 and h[n] is defined in Eqn. 11. a. In Fig. 8, move the convolution machine from left to right and calculate y[n] by hand. From the graph in figure 13 above: x [ n ] = ¿ h [ n ] = 0.5 ( u [ n 2 ] u [ n 3 ] ) y [ n ] = 0.5 ( x [ n 2 ] + x [ n 3 ] ) Therefore, from the data given: N y = N x + N h 1 = 2 + 4 1 = 5 y [ 2 ] = 0.5 ( 0 + 1 ) = 0.5 1 = 0.5 y [ 3 ] = 0.5 ( 1 + 3 ) = 4 0.5 = 2 y [ 4 ] = 0.5 ( 3 + 2 ) = 0.5 5 = 2.5 y [ 5 ] = 0.5 ( 2 + 1 ) = 0.5 3 = 1.5 y [ 6 ] = 0.5 ( 0 + 1 ) = 0.5 1 = 0.5
Signals and Systems, I Discrete Time Convolution b. Go to http://jdsp.engineering.asu.edu/JDSP-HTML5/JDSP.html. Build the simulation diagram in Fig. 5. Define Sig. Gen. 1 and 2 as x[n] and h[n] using “User-Defined” signal. Open up Sig.Gen. 1, 2 and Plot 4, make sure all three plots are visible. Take a screenshot. (Take separate screenshots if they cannot fit on the same window.) Figure 14: Generator 1 signal output Figure 15: Signal generator 2 output Figure 16: Output signal data
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
Signals and Systems, I Discrete Time Convolution Figure 17: Graph values Is y[n] the same as you calculated in Part a? yes they are the same. c. Suppose [ 𝑛 ]=12( 𝛿 [ 𝑛 ]+ 𝛿 [ 𝑛 +1]), derive y[n] in terms of x[n] similar to Eqn. 12 h [ n ] = 0.5 ( σ [ n ] + σ [ n + 1 ] ) y [ n ] = x [ n ] h [ n ] = k =− x [ k ] h [ n k ] y [ n ]= 0.5 k =− x [ k ] ( σ [ n k ] + σ [ n + 1 k ] ) y [ n ]= 0.5 k =− x [ k ] ( σ [ n k ] ) + 0.5 k =− x [ k ] ( σ [ n + 1 k ] ) y [ n ] = 0.5 x [ n ] σ [ n ] + 0.5 x [ n ] σ [ n + 1 ] y [ n ]= 0.5 ( x [ n ] + x [ n + 1 ]) From calculation: y [ 0 ] = 0.5 ( 1 + 3 ) = 4 0.5 = 2 y [ 1 ] = 0.5 ( 3 + 2 ) = 0.5 5 = 2.5 y [ 2 ] = 0.5 ( 2 + 1 ) = 0.5 3 = 1.5 y [ 3 ] = 0.5 ( 0 + 1 ) = 0.5 1 = 0.5 Draw the convolution machine similar to Fig. 13.
Signals and Systems, I Discrete Time Convolution Figure 18: Resultant output signal Is the system causal? Why? No, the system dependents only on the present values and the next values. TASK FOUR Convolution with a Unit Step Function Now what if the impulse response is a unit step function as shown in Eqn. 13? First convince yourself the unit step function is simply a sum of infinite number of shifted impulses as shown in Eqn. 13. By applying the sifting property of Eqn. 2 and 3, we have: Eqn. 14 shows y[n] is the sum of all current and previous input x[n]’s. Calculate the convolution of the two signals 𝑦 [ 𝑛 ] = 𝑥 [ 𝑛 ] [ 𝑛 ], where x[n] is defined in Fig. 19 and h[n] is defined in Eqn. 13.
Signals and Systems, I Discrete Time Convolution Figure 19: Convolution machine with unit step function. a. In Fig. 19, move the convolution machine from left to right and calculate y[n] by hand. x [ n ] = ¿ h [ n ] = i = 0 σ [ n i ] y [ n ] = i = 0 x [ n i ] Therefore: y [ 0 ] = 1 y [ 1 ] = 3 + 1 = 4 y [ 2 ] = 2 + 3 + 1 = 6 y [ 3 ] = 1 + 2 + 3 + 1 = 7 y [ n≥ 3 ] = 7 b. Go to http://jdsp.engineering.asu.edu/JDSP-HTML5/JDSP.html. Build the simulation diagram in Fig. 5. Define Sig. Gen. 1 as x[n] using “User-Defined” signal. Define Sig. Gen. 2 as h[n] using “Rectangular” signal. Set “Gain” to 1, “Pulse width” to 20 (from
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
Signals and Systems, I Discrete Time Convolution 0 to 19), “Time Shift” to 0. Open up Sig. Gen. 1, 2 and Plot 4, make sure all three plots are visible. Take a screenshot. (Take separate screenshots if they cannot fit on the same window.) Figure 20: Signal generator 1 output signal Figure 21: Signal generator 2 output signals Figure 22: Output signal of the plot Is y[n] the same as you calculated in Part a? Why does y[n] start to drop at n = 20? Yes, they are the same. This is because the convoluting signal has been only up to n=20. TASK FIVE Convolution with an Exponential Function
Signals and Systems, I Discrete Time Convolution When the impulse response is an exponential function such as: it can be decomposed into a sum of infinite number of impulses like the unit step function. 𝛿 [ 𝑛 𝑖 ] represents the location of the impulse and (12) 𝑖 represents its value. By applying the sifting property of Eqn. 2 and 3, we have: Eqn. 16 shows y[n] is the sum of all current and previous input x[n]’s scaled by the (12) 𝑖 factor. Figure 23: Convolution machine with exponential function Calculate the convolution of the two signals 𝑦 [ 𝑛 ] = 𝑥 [ 𝑛 ] [ 𝑛 ], where x[n] is defined in Fig. 20 and h[n] is defined in Eqn. 15. a. In Fig. 10, move the convolution machine from left to right and calculate y[n] by hand for n =0 to 4.
Signals and Systems, I Discrete Time Convolution x [ n ] = ¿ h [ n ] = i = 0 ( 1 2 ) i σ [ n i ] y [ n ] = i = 0 ( 1 2 ) i x [ n i ] Therefore: y [ 0 ] = x [ 0 ] = 1 y [ 1 ] = x [ 0 ] 2 + x [ 1 ] = 3.5 y [ 2 ] = x [ 0 ] 4 + x [ 1 ] 2 + x [ 2 ] = 3.75 y [ 3 ] = x [ 0 ] 8 + x [ 1 ] 4 + x [ 2 ] 2 + x [ 3 ] = 2.875 y [ 4 ] = x [ 0 ] 16 + x [ 1 ] 8 + x [ 2 ] 4 + x [ 3 ] 4 + x [ 4 ] = 1.4375 y [ 4 ] = x [ 0 ] 32 + x [ 1 ] 16 + x [ 2 ] 8 + x [ 3 ] 4 + x [ 4 ] 2 x [ 5 ] = 0.71875 b. Go to http://jdsp.engineering.asu.edu/JDSP-HTML5/JDSP.html. Build the simulation diagram in Fig. 5. Define Sig. Gen. 1 as x[n] using “User-Defined” signal. Define Sig. Gen. 2 as h[n] using “Exponential” signal. Set “Exp Base” to 0.5, “Gain” to 1, “Pulse width” to 20 (from 0 to 19), “Time Shift” to 0. Open up Sig. Gen. 1, 2 and Plot 4, make sure all three plots are visible. Take a screenshot. (Take separate screenshots if they cannot fit on the same window.) Figure 24: Signal generator 1 output signal
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
Signals and Systems, I Discrete Time Convolution Figure 25: Signal generator 2 output signal Figure 26: Plot 4 output signal Is y[n] the same as you calculated in Part a? Open up “Graph Values” in Plot 4 will help you compare values. Yes, they are the same as shown in figure 27. Figure 27: Graph values