31
Signals and Systems, Part 1 A signal is a real (or complex) valued function of one or more real variables. voltage across a resistor price of Google stock at end of each trading day amount of rain at 16:00 UTC as function of latitude, longitude atmospheric pressure as function of location and time In this course the independent variable is almost always time. Physical signals have units, e.g., volts or psi (Si pascal = N/m 2 ) Signals can (usually or in principle) be measured: g(t) g(0) g(t) -∞ g(u) du (area) g(t) -∞ |g(u)| 2 du (energy) The mathematical term for a measurement is functional.

Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Signals and Systems, Part 1

◮ A signal is a real (or complex) valued function of one or more realvariables.

◮ voltage across a resistor

◮ price of Google stock at end of each trading day

◮ amount of rain at 16:00 UTC as function of latitude, longitude

◮ atmospheric pressure as function of location and time

In this course the independent variable is almost always time.

◮ Physical signals have units, e.g., volts or psi (Si pascal = N/m2)

◮ Signals can (usually or in principle) be measured:

◮ g(t) 7→ g(0)

◮ g(t) 7→∫

−∞g(u) du (area)

◮ g(t) 7→∫

−∞|g(u)|2 du (energy)

The mathematical term for a measurement is functional.

Page 2: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Signals and Systems (cont.)

◮ A system takes signals as inputs and produces signals as outputs.

g(t) −→ system −→ f(t)

◮ In general, the output signal depends on entirety of input signal; e.g.,

◮ f(t) = d

dtg(t)

◮ f(t) =∫ t

t−1g(u) du

◮ G(s) =∫

−∞g(t)e−2πist dt

◮ Examples of physical systems:

◮ Electrical circuit: voltage in, voltage or current out

◮ Building: earth shaking in, building shaking out

◮ Audio amplifier

Page 3: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Signal Energy and Power

◮ The energy of a signal g(t) is∫

−∞

|g(t)|2 dt

If g(t) is complex valued then |g(t)|2 is the square of magnitude.

◮ We are interested in energy only when it is finite. Common cases:

◮ Bounded signal of finite duration; e.g., a pulse

◮ Exponentially decaying signals (output of some linear systems with pulseinput)

◮ Necessary condition for finite energy.

◮ The energy in the “tails” of the signal must approach 0:

limT→∞

(

−T

−∞

|g(t)|2 dt+

T

|g(t)|2 dt

)

= 0

◮ We would expect that the instantaneous power |g(t)|2 → 0, but that isnot required. (This is only of mathematical interest.)

Page 4: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Signal Energy and Power (cont.)

◮ A signal is periodic if it repeats; i.e., for some T > 0

g(t+ T ) = g(t)

for every t. E.g., sin t has period 2π and tan t has period π.

◮ The power of a periodic signal g(t) is the average energy:

Pg =1

T

∫ a+T

a|g(t)|2 dt

where T is the period of g(t).

◮ The power of a general signal is a limit:

Pg = limT→∞

1

T

∫ T/2

−T/2|g(t)|2 dt

This limit may be 0.

g1(t) =

{

e−at t > 0

0 t < 0or g2(t) =

1

1 + |t|

Page 5: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Units of Power

◮ If a signal g(t) measured in volts is applied to a load resistor R, then thepower in watts is

P =g(t)2

R

Normally we do not care about the load, so we normalize to R = 1.

◮ In many applications, the effect of the signal varies as the log of thesignal; e.g., human hearing and sight.

◮ Power can be expressed in decibels (dB). dB are logarithmic and relativeto some standard power.

If P is measured in watts, then

◮ power in dBW is 10 log10

P (power relative to 1W)

◮ power in dBm (or dBmW) is log10(1000P ) = 30 + 10 log

10P

◮ One bel (B) is too large to be useful.

The bel is named for Alexander Graham Bell (1847–1922). The dB was adopted by NBS in 1931.It is not an SI unit.

Page 6: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Classification of Signals

◮ Signals have a variety of characteristics.

◮ values can be continuous or discrete

◮ time variable can be continuous or discrete

◮ deterministic or random

◮ For deterministic signals:

◮ continuous time, continuous valued (mathematics)

◮ continuous time, discrete valued

◮ discrete time, continuous valued (digital signal processing)

◮ discrete time, discrete valued (digital switching)

◮ Time can be restricted to a finite interval

◮ Periodic signals are determined by values on a finite interval.

Page 7: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Classification of Signals (cont.)

Page 8: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Operations on Signals

◮ Time shifting/delay: g(t± T )

Page 9: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Operations on Signals (cont.)

◮ Time scaling: g(at) stretches (0 < a < 1) or squeezes (a > 1)

Page 10: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Operations on Signals (cont.)

◮ Time reversal: g(−t)

◮ Each of these operations corresponds to a linear system.

Page 11: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Unit Impulse Signal

◮ Most physical systems have same output for any narrow pulse with agiven area. E.g., RC circuit:

0 50

5

10

15

0 50

0.5

1

1.5

2

0 50

0.2

0.4

0.6

0.8

0 50

1

2

3

4

5

0 50

0.2

0.4

0.6

0.8

1

0 50

0.2

0.4

0.6

0.8

1

0 50

10

20

30

40

50

0 50

0.2

0.4

0.6

0.8

1

◮ The unit impulse signal is abstraction of infinitely narrow signal witharea 1. Paul A. M. Dirac “defined” δ(t) by

δ(t) 6= 0 if t 6= 0 and

−∞

δ(t) dt = 1

Warning: the energy of δ(t) is not defined.

Page 12: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Properties of Unit Impulse Signal

◮ Sampling property:∫

−∞

ϕ(t)δ(t − T ) dt =

−∞

ϕ(t+ T )δ(t) dt

=

−∞

ϕ(T )δ(t) dt = ϕ(T )

−∞

δ(t) dt = ϕ(T )

In more rigorous mathematics, the sampling property defines the unitimpulse as a generalized function.

◮ Convolution:

ϕ(t) ∗ δ(t) = (ϕ ∗ δ)(t) =

−∞

ϕ(τ)δ(t − τ) dτ = ϕ(t)

◮ Multiplication by a function:

ϕ(t)δ(t) = ϕ(0)δ(t)

◮ Fourier transform of unit impulse is constant 1 at all frequencies.

Page 13: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Unit Step Function u(t)

◮ The Heaviside unit step function is defined by

u(t) =

{

1 t > 0

0 t < 0

The unit step function corresponds to turning on at time 0.

◮ Unit step is integral of unit impulse:

u(t) =

∫ t

−∞

δ(u) du ⇒ δ′(t) = u(t)

Oliver Heaviside (1850-1925) was a self-taught English electrical engineer, mathematician, and physicist who adapted complexnumbers to the study of electrical circuits, invented mathematical techniques to the solution of differential equations (later foundto be equivalent to Laplace transforms), reformulated Maxwell’s field equations in terms of electric and magnetic forces andenergy flux, and independently co-formulated vector analysis.

Page 14: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

The sinc function

◮ In EE 102A we used the definition

sincπ(t) =sinπt

πt.

This function is 1 at t = 0 and zero at the nonzero integers.

We call this sincπ because it includes factor π factor in its argument.

◮ In this course, we define sinc by

sinc(t) =sin(t)

t.

This also has an amplitude of 1 at t = 0 but has zeros at multiples of π.

◮ The two are related by

sinc(πt) = sincπ(t) .

Page 15: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

The sinc function

Graph of sinc(t).

π 2π−2π −π 0 t

1

sinc(t) =sin(t)

t

Page 16: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Periodic Signals

◮ A signal g is called periodic if it repeats in time; i.e., for some T > 0,

g(t+ T ) = g(t)

for all t.

◮ If g is periodic, its period is the smallest such T .

◮ Examples: trignometric functions are periodic.

◮ Period of cos t is 2π

◮ Period of tan t is π.

◮ Period of square wave sgn(sin(2πt)) is 1

◮ Stretching: the period of g(mT ) is T/m

◮ If g and f are periodic, their common period is LCM(Tg, Tf ). E.g.,period of sinπt+ sin(2πt/5) is LCM(2, 5) = 10.

Periods must be commensurable, integer multiples of some shorter time.

Page 17: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Fourier Series

◮ Periodic signals can be written as the sum of sinusoids whose frequenciesare integer multiples of the fundamental frequency f0 = 1/T0.

◮ The most general representation uses complex exponential functions.

g(t) =

∞∑

n=−∞

Cnej2πf0nt

Note the factor of 2π since we are using frequency in cycles/second (Hz).

◮ In general, Fourier series coeffcients Cn are complex numbers even whenthe signal is real valued.

◮ The Fourier series coefficents can be computed by

Cn =1

T0

∫ a+T0

ag(t)e−j2πf0nt dt

The integral is over any period of the signal.

Page 18: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Fourier Series Examples

◮ Sinsuoids have a finite number of terms. By Euler’s formula,

eit = cos t+ i sin t

Therefore

cos t =eit + e−it

2and sin t =

eit − e−it

2i

The Fourier series coefficients for cos t are, . . . C−2, C−1, C0, C1, C2, . . .

. . . , 0, 0, 12 , 0,12 , 0, 0, . . .

and for sin t are

. . . , 0, 0,− 12i =

i2 , 0,

12i = − i

2 , 0, 0, . . .

Page 19: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Fourier Series of Square Wave

◮ Square wave with period 2π defined over interval [−π, π] by

w(t) =

{

1 |t| < π/2

0 −π < |t| < π/2

Fourier series coefficients: if n > 0,

Cn =1

∫ π/2

−π/21 · e−jnt dt

=1

e−jnt

−jn

π/2

−π/2

=1

eπjn/2 − e−πjn/2

jn

=1

2

sinπn/2

πn/2=

1

2sinc(πn/2) =

1

πn(n odd)

C0 =12 , the average value of the square wave.

Page 20: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Fourier Series of Square Wave

0

1

2sinc(πn/2)

1 2 3 4−4 −3 −2 −1 n

0.5

Page 21: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Square Wave (cont.)

−4 −2 0 2 4−0.2

0

0.2

0.4

0.6

0.8

1

1.2N = 1

−2 0 2−0.5

0

0.5

1

1.5N = 3

−2 0 2−0.5

0

0.5

1

1.5N = 5

−2 0 2−0.5

0

0.5

1

1.5N = 7

The overshoot is an example of the Gibbs’ phenomenon.The overshoot is ≈ 9% and occurs no matter how many terms are used.

Page 22: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Fourier Series Alternative Forms

◮ Euler’s formula ejθ = cos θ + j sin θ allows us to represent periodicsignals as sums of sines and cosines:

g(t) = 12a0 +

∞∑

n=1

an cos(2π

T0nt)

+

∞∑

n=1

bn sin(2π

T0nt)

The coefficients are

an =2

T0

∫ T0

0g(t) cos(2πf0nt) dt

bn =2

T0

∫ T0

0g(t) sin(2πf0nt) dt

◮ A third compact form combines the sin(.) and cos(.) terms into phaseshifted cos(.) terms

g(t) = C0 +

∞∑

n=1

An cos(n2πf0t+Θn)

Each frequency component is described by amplitude and phase.

Page 23: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Types of Systems

For theoretical and practical reasons, we restrict attention to systems andhave useful properties and represent the physical world.

◮ Causal

◮ Continuous

◮ Stable

◮ Linear

◮ Time invariant

Fundamental fact: every linear, time-invariant system (LTIS) ischaracterized by

◮ Impulse response: w(t) = h(t) ∗ v(t)

◮ Transform function: in frequency domain, W (f) = H(f) · V (f)

Page 24: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Signals as Vectors

A signal g(t) defined for a finite number of time variables,

g(tk) = gk , k = 1, . . . , n

can be considered to be a vector of dimension n:

g = (g1, g2, . . . , gn)

The Euclidean norm (or size or magnitude) is

‖g‖ =√

|g1|2 + · · · + |gn|2 =

( n∑

k=1

|gk|2

)1

2

(This definition works for complex-valued signals.)The norm is used to measure how far apart are two signals, e.g., to tell howgood an estimate is:

square error = ‖g − g‖2 =

( n∑

k=1

(|gk − gk|2

)

Page 25: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Orthogonality

If two signals are orthogonal, then by Pythagoras’ theorem,

‖f‖2 + ‖g‖2 = ‖f + g‖2

= (f + g) · (f + g)

= f · f + f · g + g · f + g · g = ‖f‖2 + ‖g‖2 + 2(f · g)

Thus two signals are orthogonal if and only inner product f · g = 0.(In this case the energy of the sum is the sum of the energies.)

Recall that f · g = ‖f‖‖g‖ cos θ, where θ is the angle between f and g.

◮ θ = 0 ⇒ f and g point in exactly the same direction

◮ 0 < θ < π/2 ⇒ f and g point in the same general direction

◮ θ = −π/2 ⇒ f and g are perpendicular

◮ π/2 < θ < π ⇒ f and g point in opposite general direction

◮ θ = −π ⇒ f and g point in exactly the opposite direction

Page 26: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Signals as Vectors, II

For most signal processing applications, the number of samples is muchlarger than 3, so we cannot easily visualize signals as vectors.

In fact, n might be infinite, e.g., tk = k∆t for k = 0, 1, 2, . . . or even−∞ < k < ∞.

When the dimension is infinite, the signal’s norm may be infinite. If

‖g‖2 =∑

k

|gk|2 < ∞

the signal has finite energy and is said to belong to L2.

The energy of the sampled signal depends on the sampling interval ∆t. Thepower in each interval is ‖gk‖

2, so total energy is∑

k

|gk|2∆t

Gauss determined the orbit of Ceres using only 24 samples and an early version of the FFT.

Page 27: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Signals as Vectors, III

If the sample interval goes to zero, we obtain a continuous-time signal withenergy

−∞

|g(t)|2 dt = lim∆t→0

k

|gk|2∆t

The class of finite energy signals is named L2 or L2(−∞,+∞).

The two major tasks of signal processing are estimation and detection.

◮ Estimation: finding a good estimate g(t) of an unknown signal g(t)using information of of other signals

◮ Detection: identifying which of one of a finite number of possiblesignals is present, again based on signals that depend on g(t).

In communication systems, the available signal is the output of a channel:

z(t) = h(t) ∗ v(t) + w(t) ,

where the channel attenuates and distorts the input and adds noise.

Page 28: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Component of a Vector along Another Vector

A simple example of a channel with noise results in output

g = cx+ e ,

where the gain c and error e are unknown.There are infinitely many solutions. To minimize error, we choose

e = g − cx

to be orthogonal to x.

Page 29: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Component of a Vector along Another Vector, II

The component of g along x is ‖g‖ cos θ. Therefore

c‖x‖2 = ‖x‖‖g‖ cos θ = 〈g,x〉

So we can solve for c:

c =〈g,x〉

‖x‖2=

〈g,x〉

〈x,x〉

This answer applies to continouous-time signals. Suppose g(t) is defined fort1 < t < t2. We can to approximate g(t) by cx(t). The energy of the error

Ee =

∫ t2

t1

|g(t) − cx(t)|2 dt

is minimized by solving ∂Ee/∂c = 0:

c =

∫ t2t1

g(t)x(t) dt∫ t2t1

|x(t)|2 dt=

1

Ex

∫ t2

t1

g(t)x(t) dt

Page 30: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Application to Signal Detection

Consider a radar pulse g(t).

The return signal depends on whether the transmit signal encounters atarget. Here w(t) represents noise and interference.

y(t) =

{

ag(t− t0) target present

w(t) target absent

Typical pulse is 1 µs at 3 GHz; repetition rates from 2 kHz to 200 KHz

Page 31: Signals and Systems, Part 1 - Stanford Universityweb.stanford.edu/class/ee179/lectures/notes03.pdfSignals and Systems, Part 1 A signal is a real (or complex) valued function of one

Application to Signal Detection, II

A key assumption (usally justified) is that noise w(t) is uncorrelated withsignal.

〈w(t), g(t − t0)〉 =

∫ t2

t1

w(t)g(t − t0) dt = 0

To see if a target is present at distance corresponding to delay t0, wecorrelate the return signal with a delayed version of the radar pulse:

〈y(t), g(t − t0)〉 =

{

∫ t2t1

a|g(t− t0)|2 dt target present

0 target absent

=

{

aEg target present

0 target absent

Obviously, we decide based on whether the correlation is nonzero.To detect targets at all possible distances, we vary t0.