worksheet 3 - github pages · the unit impulse or the delta function, denoted as , is the...

22
27/07/2020, 09:44 worksheet3 Page 1 of 22 http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false Lecturer: Set up MATLAB In [ ]: clear all format compact Worksheet 3 To accompany Chapter 2 Elementary Signals Colophon This worksheet can be downloaded as a PDF file (https://cpjobling.github.io/eg-247- textbook/worksheets/worksheet3.pdf) . A printout of this worksheet will be distributed before the first class meeting in the Week 1: Classroom Activities section of the Canvas site. I will also distribute a copy to your personal Worksheets section of the OneNote Class Notebook so that you can add your own notes using OneNote. You are expected to have at least watched the video presentation of Chapter 2 (https://cpjobling.github.io/eg-247-textbook/elementary_signals/index) of the notes (https://cpjobling.github.io/eg-247-textbook) before coming to the first class. If you haven't watch it afterwards! After class, the lecture recording and the annotated version of this worksheet will be made available to you via OneNote and through Canvas.

Upload: others

Post on 01-Mar-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 1 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Lecturer: Set up MATLAB

In [ ]: clear allformat compact

Worksheet 3

To accompany Chapter 2 Elementary Signals

ColophonThis worksheet can be downloaded as a PDF file (https://cpjobling.github.io/eg-247-textbook/worksheets/worksheet3.pdf).

A printout of this worksheet will be distributed before the first class meeting in the Week 1: ClassroomActivities section of the Canvas site. I will also distribute a copy to your personal Worksheets section ofthe OneNote Class Notebook so that you can add your own notes using OneNote.

You are expected to have at least watched the video presentation of Chapter 2(https://cpjobling.github.io/eg-247-textbook/elementary_signals/index) of the notes(https://cpjobling.github.io/eg-247-textbook) before coming to the first class. If you haven't watch itafterwards!

After class, the lecture recording and the annotated version of this worksheet will be made available toyou via OneNote and through Canvas.

Page 2: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 2 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Elementary SignalsConsider the network shown in below where the switch is closed at time and all components areideal.

Express the output voltage as a function of the unit step function, and sketch the appropriatewaveform.

! = "

#out

Q1: What happens before ?

1. 2. 3. 4. 5.

! = 0

= undefined$out= 0$out=$out #%= /2$out #%= ∞$out

-> Open Poll

Q2: What happens after ?

1. 2. 3. 4. 5.

! = 0

= undefined$out= 0$out=$out #%= /2$out #%= ∞$out

Page 3: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 3 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

-> Open Poll

Q3: What happens at ?

1. 2. 3. 4. 5.

! = 0

= undefined$out= 0$out=$out #%= /2$out #%= ∞$out

-> Open Poll

Q4: What does the response of look like?

Circle the picture you think is correct on your handout.

A B

C D

#out

-> Open Poll

Page 4: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 4 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

The Unit Step Function(!) = {&0

0 ! < 01 ! > 0

In MatlabIn Matlab, we use the heaviside function (Named after Oliver Heaviside(https://en.wikipedia.org/wiki/Oliver_Heaviside)).

In [1]: syms tezplot(heaviside(t),[-1,1])heaviside(0)

Page 5: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 5 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

See: show_heaviside.m (https://cpjobling.github.io/eg-247-textbook/elementary_signals/show_heaviside.m).

Note that, so it can be plotted, Matlab defines the heaviside function slightly differently from themathematically ideal unit step:

heaviside(!) =⎧

⎩⎨⎪⎪

0 ! < 01/2 ! = 01 ! > 0

ans =

0.5000

Page 6: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 6 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Circuit RevisitedConsider the network shown below, where the switch is closed at time .

Express the output voltage as a function of the unit step function, and sketch the appropriatewaveform.

! = "

$out

Simple Signal Operations

Page 7: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 7 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Amplitude ScalingSketch and ' (!)&0 −' (!)&0

Time ReversalSketch (−!)&0

Page 8: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 8 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Time Delay and AdvanceSketch and (! − " )&0 (! + " )&0

Examples

Page 9: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 9 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Example 1

Which of these signals represents ?−' (! + " )&0

-> Open Poll

Example 2

What is represented by

1. 2. 3. 4.

−' (! + " )&0−' (−! + " )&0−' (−! − " )&0−' (! − " )&0

Page 10: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 10 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

-> Open Poll

Synthesis of Signals from Unit StepUnit step functions can be used to represent other time-varying functions such as rectangular pulses,square waves and triangular pulses.

Synthesize Rectangular Pulse

Page 11: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 11 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Synthesize Square Wave

Page 12: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 12 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Synthesize Symmetric Rectangular Pulse

Page 13: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 13 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Synthesize Symmetric Triangular Pulse

Page 14: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 14 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

The Ramp Function

In the circuit shown above is a constant current source and the switch is closed at time .(% ! = 0

Show that the voltage across the capacitor can be represented as

and sketch the wave form.

(!) = ! (!)$)(%)

&0

Page 15: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 15 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

The unit ramp function is defined as

so

and

(!) = (*)+*&1 ∫!

−∞&0

(!) = {&10 ! < 0! ! ≥ 0

(!) = (!)&0++!

&1

Page 16: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 16 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Note

Higher order functions of can be generated by the repeated integration of the unit step function.

For future reference, you should determine , and for yourself and make a note of thegeneral rule:

Details are given in equations 1.26—1.29 in the textbook.

!

(!)&2 (!)&3 (!)&,

= (!)&,−11,

++!

&,

The Dirac Delta Function

In the circuit shown above, the switch is closed at time and for . Express theinductor current in terms of the unit step function and hence derive an expression for .

! = 0 (!) = 0(- ! < 0(!)(- (!)$-

Page 17: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 17 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Notes

To solve this problem we need to invent a function that represents the derivative of the unit step function.This function is called or the dirac delta function (named after Paul Dirac(https://en.wikipedia.org/wiki/Paul_Dirac)).

.(!)

The delta functionThe unit impulse or the delta function, denoted as , is the derivative of the unit step.

This function is tricky because is discontinuous at but it must have the properties

and

for all .

.(!)

(!)&0 ! = 0.(*)+* = (!)∫

!

−∞&0

.(!) = 0 ! ≠ 0

Page 18: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 18 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Sketch of the delta function

Important properties of the delta functionSee the accompanying notes (index).

Examples

Example 3

Evaluate the following expressions

3 .(! − 1)!4

Page 19: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 19 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

!.(! − 2)+!∫∞

−∞

(! − 3)!2.′

Page 20: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 20 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Example 4

(1) Express the voltage waveform shown above as a sum of unit step functions for the time interval s

$(!)−1 < ! < 7

Page 21: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 21 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Using the result of part (1), compute the derivative of and sketch its waveform.$(!)

Lab WorkIn the first lab, next Tuesday, we will solve further elemetary signals problems using MATLAB andSimulink following the procedure given between pages 1-17 and 1-22 of the Karris. We will also explorethe heaviside and dirac functions.

Page 22: Worksheet 3 - GitHub Pages · The unit impulse or the delta function, denoted as , is the derivative of the unit step. This function is tricky because is discontinuous at but it must

27/07/2020, 09:44worksheet3

Page 22 of 22http://localhost:8888/nbconvert/html/elementary_signals/worksheet3.ipynb?download=false

Answers to in-class questionsMathematically

Q1. when (answer 2)

Q2. when (answer 3)

Q3. when (answer 1)

jumps from to instantanously when the switch is closed. We call this a discontinuous signal!

Q4: The correct image is:

Example 1: Answer 3.

Example 2: Answer 2.

= 0$out −∞ < ! < 0

=$out #% 0 < ! < ∞

= undefined$out ! = 0

#out 0 #%