chapter 0 solutions manual chaparro

31
Chapter 0 From the Ground Up 1

Upload: snowsummit

Post on 26-Nov-2015

1.071 views

Category:

Documents


11 download

DESCRIPTION

Chaparro Signals and Systems

TRANSCRIPT

  • Chapter 0

    From the Ground Up

    1

  • Chaparro Signals and Systems using MATLAB 0.1

    Pr 0.1 (a) Assuming a maximum frequency of 22.05 KHz for the acoustic signal, the numbers of bytes (8bits per byte) for two channels (stereo) and a 75 minutes recording is: 2x 22,050 samples/channel/second x 2bytes/sample x 2 channels x 75 minutes x 60 seconds/minute = 7.938 108 bytes. Multiplying by 8 we getthe number of bits. CD quality means that the signal is sampled at 44.1 KHz and each sample is representedby 16 bits or 2 bytes.

    (b) The raw data would consist of 8 (bits/sample) x 10,000 (samples/sec)=80,000 bits/sec. The vocoder ispart of a larger unit called a digital signal processor chip set. It uses various procedures to reduce the numberof bits that are transmitted while still keeping your voice recognizable. When there is silence it does nottransmit, letting another signal use the channel during pauses.

    (c) Texting between cell phones is possible by sending short messages (160 characters) using the short mes-sage services (SMS). Whenever your cell-phone communicates with the cell phone tower there is an exchangeof messages over the control channel for localization, and call setup. This channel provides a pathway forSMS messages by sending packets of data. Except for the cost of storing messages, the procedure is ratherinexpensive and convenient to users.

    (d) For CD audio the sampling rate is 44.1 kHz with 16 bits/sample. For DVD audio the sampling rate is192 kHz with 24 bits/sample. The sampling process requires getting rid of high frequencies in the signal,also each sample is only approximated by the binary representation, so analog recording could sound betterin some cases.

    (e) The number of pixels processed every second is: 352 240 pixels/frame 60 frames/sec.The number of bits available for transmission every second is obtained by multiplying the above answer by 8bits/pixel. There many compression methods JPEG, MPEG, etc.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.2

    Pr 0.2 As we will see later, the sampling period of x(t) with a frequency of max = 2pifmax = 2pi shouldsatisfy the Nyquist sampling condition

    fs =1

    Ts 2fmax = 2

    so Ts 1/2. Thus when Ts = 0.1 the analog and the discrete-time signals look very much like eachother, indicating the signals have the same information such a statement will be justified in the Chapter onsampling where we will show that the analog signal can be recovered from the sampled signal. It is clear thatwhen Ts = 1 the information is lost. Although it is not clear from the figure that when we let Ts = 0.5 thediscrete-time signal keeps the information, this sampling period satisfies the Nyquist sampling condition andas such the original signal can be recovered from the sampled signal. The following MATLAB script is used.

    % Pr. 0.2

    clear all; clf

    T=3; Tss= 0.0001; t=[0:Tss:T];

    xa=4*cos(2*pi*t); % analog signal

    xamin=min(xa);xamax=max(xa);

    figure(1)

    subplot(221)

    plot(t,xa); grid

    title(Analog Signal); ylabel(x(t)); xlabel(t sec)

    axis([0 T 1.5*xamin 1.5*xamax])

    N=length(t);

    for k=1:3,

    if k==1,Ts= 0.1; subplot(222)

    t1=[0:Ts:T]; n=1:Ts/Tss: N; xd=zeros(1,N); xd(n)=4*cos(2*pi*t1);

    plot(t,xa); hold on; stem(t,xd);grid;hold off

    axis([0 T 1.5*xamin 1.5*xamax]); ylabel(x(0.1 n)); xlabel(t)

    elseif k==2, Ts=0.5; subplot(223)

    t2=[0:Ts:T]; n=1:Ts/Tss: N; xd=zeros(1,N); xd(n)=4*cos(2*pi*t2);

    plot(t,xa); hold on; stem(t,xd); grid; hold off

    axis([0 T 1.5*xamin 1.5*xamax]); ylabel(x(0.5 n)); xlabel(t)

    else,Ts=1; subplot(224)

    t3=[0:Ts:T]; n=1:Ts/Tss: N; xd=zeros(1,N); xd(n)=4*cos(2*pi*t3);

    plot(t,xa); hold on; stem(t,xd); grid; hold off

    axis([0 T 1.5*xamin 1.5*xamax]); ylabel(x(n)); xlabel(t)

    end

    end

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.3

    0 1 2 36

    4

    2

    0

    2

    4

    6Analog Signal

    x(t)

    t sec0 1 2 3

    6

    4

    2

    0

    2

    4

    6

    x(0.1

    n)

    t

    0 1 2 36

    4

    2

    0

    2

    4

    6

    x(0.5

    n)

    t0 1 2 3

    6

    4

    2

    0

    2

    4

    6

    x(n)

    t

    Figure 1: Analog signal (top left) and discrete-time signals for Ts = 0.1 sec (top right) and Ts = 0.5 sec andTs = 1 sec (bottom left to right).

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.4

    Pr 0.3 The derivative is

    y(t) =dx(t)

    dt= 8pi sin(2pit)

    which has the same frequency as x(t), thus the sampling period should be like in the previous problem,Ts 0.5.% Pr. 0.3

    clear all

    % actual derivative

    Tss=0.0001;t1=0:Tss:3;

    y=-8*pi*sin(2*pi*t1);

    figure(2)

    % forward difference

    Ts=0.01;t=[0:Ts:3];N=length(t);

    subplot(211)

    xa=4*cos(2*pi*t); % sampled signal

    der1_x=forwardiff(xa,Ts,t,y,t1);

    clear der1_x

    % forward difference

    Ts=0.1;t=[0:Ts:3];N=length(t);

    subplot(212)

    xa=4*cos(2*pi*t); % sampled signal

    der1_x=forwardiff(xa,Ts,t,y,t1);

    The function forwardiff computes and plots the forward difference and the actual derivative.

    function der=forwardiff(xa,Ts,t,y,t1)

    % % forward difference

    % % xa: sampled signal using Ts

    % % y: actual derivative defined in t

    N=length(t);n=0:N-2;

    der=diff(xa)/Ts;

    stem(n*Ts,der,filled);grid;xlabel(t, nT_s)

    hold on

    plot(t1,y,r); legend(forward difference,derivative)

    hold off

    For Ts = 0.01 the finite difference looks like the actual derivative but shifted, while for Ts = 0.1 it does not.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.5

    0 0.5 1 1.5 2 2.5 340

    20

    0

    20

    40

    t, nTs

    0 0.5 1 1.5 2 2.5 340

    20

    0

    20

    40

    t, nTs

    forward differencederivative

    forward differencederivative

    Figure 2: Ts = 0.01 sec (top) and Ts = 0.1 sec (bottom)

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.6

    Pr 0.4 (a) The finite difference (let Ts = 1 for simplicity)

    1[x(n)] = x(n) x(n 1)

    is connected with the finite difference given in the chapter as follows

    1[x(n+ 1)] = x(n+ 1) x(n) = [x(n)]

    That is, [x(n)] is 1[x(n)] shifted one sample to the left.(b) (c) The average of the two finite differences gives

    0.5 {1[x(n)] + [x(n)]} = 0.5[x(n+ 1) x(n 1)]

    which gives a better approximation to the derivative than either of the given finite differences. The followingscript is used to compute 1 and the average

    % Pr. 0.4

    % compares forward/backward differences

    % with new average difference

    Ts=0.1;

    for k=0:N-2,

    x1=4*cos(2*pi*(k-1)*Ts);

    x2=4*cos(2*pi*k*Ts);

    der_x(k+1)=x2-x1; % backward difference

    end

    der_x=der_x/Ts;

    Tss=0.0001;t1=0:Tss:3;

    y=-8*pi*sin(2*pi*t1); % actual derivative

    n=0:N-2;

    figure(3)

    subplot(211)

    stem(n*Ts,der_x,k);grid

    hold on

    stem(n*Ts,der1_x,b,filled) % derv1_x forward difference

    % from Pr. 0.2

    hold on

    plot(t1,y,r); xlabel(t, nT_s)

    legend(bck diff,forwd diff, derivative)

    hold off

    subplot(212)

    stem(n*Ts,0.5*(der_x+der1_x));grid;xlabel(t, nT_s) % average

    hold on

    plot(t1,y,r)

    hold off

    legend(average diff,derivative)

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.7

    0 0.5 1 1.5 2 2.5 330

    20

    10

    0

    10

    20

    30

    t, nTs

    bck diffforwd diffderivative

    0 0.5 1 1.5 2 2.5 330

    20

    10

    0

    10

    20

    30

    t, nTs

    average diffderivative

    Figure 3: Comparison of different finite differences.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.8

    Pr 0.5 (a) According to Kirchoffs current law

    is(t) = iR(t) + iL(t) =vL(t)

    R+ iL(t)

    but vL(t) = LdiL(t)/dt so that the differential equation relating the input is(t) to the output current in theinductor iL(t) is

    diL(t)

    dt+ iL(t) = is(t)

    after replacing L = 1 and R = 1. Notice that this d.e. is the dual of the one given in the Chapter, so that thedifference equation is

    iL(nTs) =Ts

    2 + Ts[is(nTs) + is((n 1)Ts)] + 2 Ts

    2 + TsiL((n 1)Ts) n 1

    iL(0) = 0

    (b)(c) The scripts to solve the difference and differential equations are the following

    % Pr. 0.5

    clear all

    % solution of difference equation

    Ts=0.01;

    t=[0:Ts:100];

    figure(4)

    for k=0:2;

    if k==0, subplot(311)

    elseif k==1, subplot(312)

    else, subplot(313)

    end

    W0= 0.005*10k*pi; % frequency of source

    is=cos(W0*t); % source

    a=[1 (-2+Ts)/(2+Ts)]; % coefficients of i_L(n), i_L(n-1)

    b=[Ts/(2+Ts) Ts/(2+Ts)]; % coefficients of i_s(n), i_s(n-1)

    il=filter(b,a,is); % current in inductor computed by

    % MATLAB function filter

    H=1/sqrt(1+W02)*ones(1,length(t)); % filter gain at W0

    plot(t,is,t,il,r,t,H,g); xlabel(t); ylabel(i_s(t),i_L(t))

    axis([0 100 1.1*min(is) 1.1*max(is)])

    legend(input current,output current,filter gain); grid

    pause(0.1)

    end

    %%%%

    % solution of differential equation for cosine input of frequency 0.5pi

    clear all

    syms t x y

    x=cos(0.5*pi*t);

    y=dsolve(Dy+y=cos(0.5*pi*t),y(0)=0,t)

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.9

    figure(5)

    subplot(211)

    ezplot(x,[0 100]);grid

    subplot(212)

    ezplot(y,[0 100]);grid

    axis([0 100 -1 1])

    0 10 20 30 40 50 60 70 80 90 1000

    0.5

    1

    t

    i s(t),i L

    (t)

    input currentoutput currentfilter gain

    0 10 20 30 40 50 60 70 80 90 1001

    0

    1

    t

    i s(t),i L

    (t)

    input currentoutput currentfilter gain

    0 10 20 30 40 50 60 70 80 90 1001

    0

    1

    t

    i s(t),i L

    (t)

    input currentoutput currentfilter gain

    0 10 20 30 40 50 60 70 80 90 100

    1

    0.5

    0

    0.5

    1

    t

    cos(1/2 pi t)

    0 10 20 30 40 50 60 70 80 90 1001

    0.5

    0

    0.5

    1

    t

    ...+2 (2 cos(1/2 pi t)+pi sin(1/2 pi t))/(4+pi2)

    Figure 4: Left (top to bottom): solution of difference equation for 0 = 0.005, 0.05, 0.5 (rad/sec). Right:input (top), solution of differential equation (bottom).

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.10

    Pr 0.6 (a) The distributive and the associative laws are equivalent to the ones for integrals, indeedk

    cak = c( + a1 + a0 + a1 + ) = ck

    ak

    since c does not depend on k. Likewisek

    [ak + bk] = ( + a1 + b1 + a0 + b0 + a1 + b1 ) =k

    ak +k

    bk

    Finally, when adding a set of numbers the order in which they are added does not change the result. Forinstance,

    a0 + a1 + a2 + a3 = a0 + a2 + a1 + a3

    (b) Gauss trick can be shown in general as follows. Let S =Nk=0 k then

    2S =

    Nk=0

    k +

    0k=N

    k

    letting ` = k +N in the second summation we have

    2S =

    Nk=0

    k +

    N`=0

    (N `) =Nk=0

    (k +N k) = NNk=0

    1 = N(N + 1)

    where we let the dummy variables of the two sums be equal. We thus have that for N = 104

    S =N(N + 1)

    2=

    104(104 + 1)

    2 0.5 108

    (c) Using the above properties of the sum,

    S1 =

    Nk=0

    (+ k) =

    Nk=0

    1 +

    Nk=0

    k

    = (N + 1) + N(N + 1)

    2

    (d) The following script computes numerically and symbolically the various sums

    % Pr. 0.6

    clear all

    % numeric

    N=100;

    S1=[0:1:N];

    S2=[N:-1:0];

    S=sum(S1+S2)/2

    % symbolic

    syms S1 N alpha beta k

    simple(symsum(alpha+beta*k,0,N))

    % computing sum for specific values of alpha, beta and N

    subs(symsum(alpha+beta*k,0,N),{alpha,beta,N},{1,1,100})

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.11

    S = 5050

    ((2*alpha + N*beta)*(N + 1))/2

    5151

    The answers shown at the bottom.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.12

    Pr 0.7 (a) The following figure shows the upper and lower bounds when approximating the integral of t:

    upper bound

    lower bound

    0

    0.25

    0.5

    0.75

    1t

    x(t) = t

    0.25 0.5 0.75

    1

    Figure 5: Upper and lower bounds of the integral of t.

    (b) (c) The lower bound for the integral is

    S` =

    N1n=1

    (nTs)Ts = T2s

    N1n=1

    n = T 2s

    N2`=0

    (`+ 1)

    = T 2s

    [(N 1)(N 2)

    2+ (N 1)

    ]The definite integral is 1

    0

    tdt =1

    2

    The upper bound is

    Su =

    Nn=1

    (nTs)Ts = S` +NT2s

    Letting NTs = 1, or Ts = 1/N we have then that[(N 1)(N 2) + 2(N 1)

    2N2

    ] 1

    2[

    (N 1)(N 2) + 2(N 1)2N2

    ]+

    1

    N

    for large N the upper and the lower bound tend to 1/2.The following script computes the lower and upper bound of the integral of t,

    % Pr. 0.7

    clear all

    Ts=0.001;N=1/Ts;

    % integral of t from 0 to 1 is 0.5

    syms S1 n T k

    % lower bound

    n=subs(N);T=subs(Ts);

    y=simple(symsum(k*T2,1,n-1));

    yy=subs(y)

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.13

    % upper bound

    z=simple(symsum(k*T2,1,n));

    zz=subs(z)

    % average

    int= 0.5*(yy+zz)

    giving the following results (the actual integral is 1/2)

    yy = 0.4995

    zz = 0.5005

    int = 0.5000

    (d) For y(t) = t2, 0 t 1, the following script computes the upper and the lower bounds and their average:%% integral of t2 from 0 to 1 is 0.333

    % lower bound

    y1=simple(symsum(k2*T3,1,n-1));

    yy1=subs(y1)

    % upper bound

    z1=simple(symsum(k2*T3,1,n));

    zz1=subs(z1)

    % average

    int= 0.5*(yy1+zz1)

    giving the following results, in this case the value of the definite integral is 1/3.

    yy1 = 0.3328

    zz1 = 0.3338

    int = 0.3333

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.14

    Pr 0.8 The indefinite integral equals 0.5t2. Computing it in [0, 1] gives the same value as the sum of theintegrals computed between [0, 0.5] and [0.5, 1].

    As seen before, the sum

    S =

    100n=0

    n =100(101)

    2= 5050

    while

    S1 = S + 50 = 5100

    S2 = S

    the first sum has an extra term when n = 50 while the other does not. To verify this use the following script:

    % Pr. 0.8

    clear all

    N=100;

    syms n,N

    S=symsum(n,0,N)

    S1=symsum(n,0,N/2)+symsum(n,N/2,N)

    S2=symsum(n,0,N/2)+symsum(n,N/2+1,N)

    giving

    S = 5050

    S1 = 5100

    S2 = 5050

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.15

    Pr 0.9 (a) If = 1 then

    S =

    N1n=0

    1 = 1 + 1 + + 1 N times

    = N

    (b) The expression

    S(1 ) = S S= (1 + + + N1) (+ 2 + + N1 + N )= 1 N

    as the intermediate terms cancel. So that

    S =1 N1 , 6= 1

    Since we do not want the denominator 1 to be zero, the above requires that 6= 1. If = 1 the sum wasfound in (a). As a finite sum, it exists for any finite values of .(c) Putting (a) and (b) together we have

    S =

    {(1 N )/(1 ) 6= 1N = 1

    (d) If N is infinite, the sum is of infinite length and we need to impose the condition that || < 1 so that ndecays as n. In that case, the term N 0 as N , and the sum is

    S =1

    1 || < 1

    If || 1 this sum does not exist, i.e., it becomes infinite.(e) The derivative becomes

    S1 =dS

    d=

    n=0

    nn1 =1

    (1 )2

    or that a new sum n=0

    nn =

    (1 )2

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.16

    Pr 0.10 (a)(b) We have that0 < et < et

    for > 0.

    % Pr. 0.10

    clear all

    % compare two exponentials

    t=[0:0.001:10];

    x=exp(-0.5*t);

    x1=exp(-1*t);

    figure(6)

    plot(t,x,t,x1,r); legend(Exponential Signal, a=-0.5,Exponential Signal, a=-1)

    grid

    axis([0 10 0 1.1 ]); xlabel(time)

    0 1 2 3 4 5 6 7 8 9 100

    0.2

    0.4

    0.6

    0.8

    1

    time

    Exponential Signal, a=0.5Exponential Signal, a=1

    (c) Sampling x(t) = eat using Ts = 1, we get

    x(t)|t=n = ean = n

    where = ea > 0(d) The voltage in the capacitor is given by

    vc(t) =1

    C

    t0

    e0.5d + vc(0)

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.17

    with a initial voltage vc(0) = 0. Letting C = 1, we have

    vc(t) =e0.5

    0.5 |t0 = 2(1 e0.5t)

    so that at t = 1 the voltage in the capacitor is vc(1) = 2 2e0.5 = 0.79.(e) Letting NTs = 1, the definite integral is approximated, from below, by

    N1n=0

    Tse0.5(n+1)Ts

    if we let = e0.5Ts the above sum becomes

    Ts

    N1n=0

    n+1 = Ts1 N1

    which is computed using the following script:

    % compute value of Int (the integral)

    N=1000;Ts=1/N;alpha=exp(- 0.5*Ts);

    Int=Ts*alpha*(1-alphaN)/(1-alpha)

    Int = 0.7867

    approximating the analytic result found above.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.18

    Pr 0.11 (a) The point (1,1) in the two-dimensional plane corresponds to z = 1 + j. The magnitude and phaseare

    |z| = 1 + 1 =

    2

    z = tan1 (1) = pi/4

    (b) For the other complex numbers:

    |w| =

    2, w = pi pi/4 = 3pi/4|v| =

    2, v = pi + pi/4 = 5pi/4

    |u| =

    2, u = pi/4

    The sum of these complex numbersz + w + v + u = 0

    (c) The ratios

    z

    w=

    1 + j

    1 + j =

    2ejpi/42ej3pi/4

    = 1ejpi/2 = j

    w

    v=1 + j1 j =

    2ej3pi/42ej5pi/4

    = 1ejpi/2 = j

    u

    z=

    1 j1 + j

    =

    2ejpi/42ejpi/4

    = 1ejpi/2 = j

    Also, multiplying numerator and denominator by the by the conjugate of the denominator we get the aboveresults. For instance,

    z

    w=

    1 + j

    1 + j =(1 + j)(1 j)

    2=1 j j j2

    2=2j

    2= j

    and similarly for the others.(d) y = 106 = j106 = 106z so that

    |y| = 106|z| = 106y = pi/4

    Although the magnitude of y is negligible, its phase is equal to that of z.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.19

    Pr 0.12 (a) If w = ez thenlog(w) = z

    given that the log and e functions are the inverse of each other.(b) The real and imaginary of w are

    w = ez = e1ej1 = e cos(1) real part

    +j e sin(1) imaginary part

    (c) The imaginary parts are cancelled and the real parts added twice in

    w + w = 2Re[w] = 2e cos(1)

    (d) Replacing zw = ez = e1ej1

    so that |w| = e and w = 1.(e) Using the result in (a)

    | log(w)|2 = |z|2 = 2(f) According to Eulers equation

    cos(1) = 0.5(ej + ej) = 0.5(w

    e+w

    e

    )which can be verified using w + w obtained above.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.20

    Pr 0.13 A long way to do this problem is by using the exponential expression for the sinusoids we have

    cos() cos() = 0.5(ej + ej) 0.5(ej + ej)

    = 0.25(ej(+) + ej(+)) + 0.25(ej() + ej())

    sin() sin() = Pr0.5j(ej ej)(Pr0.5j)(ej ej)= 0.25(ej(+) + ej(+)) 0.25(ej() + ej())

    adding these two terms we get

    0.5(ej(+) + ej(+)) = cos(+ )

    Same for the other expression.A short way is to consider ejej = ej(+). The product

    ejej = (cos() + j sin())(cos() + j sin())

    = [cos() cos() sin() sin()] + j[sin() cos() + cos() sin()]

    while

    ej(+) = cos(+ ) + j sin(+ )

    so that equating the real part of the above two equations we get the desired trigonometric identities.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.21

    Pr 0.14

    cos() cos() = 0.5(ej + ej) 0.5(ej + ej)

    = 0.25(ej(+) + ej(+)) + 0.25(ej() + ej())

    = 0.5 cos(+ ) + Pr0.5 cos( )

    Now,

    sin() sin() = cos( pi/2) cos( pi/2)= 0.5 cos( pi/2 + pi/2) + 0.5 cos( pi/2 + pi/2)= 0.5 cos(+ pi) + 0.5 cos( )= 0.5 cos(+ ) + 0.5 cos( )

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.22

    Pr 0.15 (a) Using the expression for the complex conjugate we have

    zz = (x+ jy)(x jy) = x2 jxy + jyx (j2)y2 = x2 + y2

    since j2 = (1)2 = 1. Likewise,

    1

    z=

    z

    zz=

    x jyx2 + y2

    (b) Instead of doing the multiplication using the rectangular representation, if z = |z|ej (polar representa-tion) then we have that

    zz = |z|2 = (x2 + y2)2 = x2 + y2

    because z = |z|ej and so the exponents cancel out. In the same way,

    1

    z=

    1

    |z|ej =ej

    |z| =|z|ej|z|2 =

    x jyx2 + y2

    (c) Using rectangular forms of z = x+ jy, w = v + jq we have

    (z + w) = ((x+ v) + j(y + q)) = (x+ v) j(y + q) = (x jy) + (v jq) = z + w

    Using the polar form of z = |z|ej and w = |w|ej we have

    (zw) = (|z||w|ej(+)) = |z||w|ej(+) = |z|ej|w|ej = zw

    (d) The polar forms arez = rej

    w = ej

    thenzw = rej(+)

    end of story. On the other hand, using the rectangular forms

    zw = r [cos() cos() + j cos() sin() + j sin() cos() sin() sin()]

    since this should be equal to the above polar expression which in rectangular form is equal to

    zw = r[cos( + ) + j sin( + )]

    we get as bonus the identities

    cos( + ) = cos() cos() sin() sin()sin( + ) = cos() sin() + sin() cos()

    by comparing the real and the imaginary parts of the two identical expressions.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.23

    Pr 0.16 (a) Representing the complex number z = x + jy = |z|ej then |x| = |z|| cos()| and since| cos()| 1 then |x| |z|, the equality holds when = 0 or when z = x, i.e., it is real.(b) Adding two complex numbers is equivalent to adding two vectors to create a triangle with two sides thetwo vectors being added and the other side the vector resulting from the addition. Unless the two vector beingadded have the same angle, in which case |z|+ |v| = |z + v|, it holds that |z|+ |v| > |z + v|.

    !z

    !v!z + !v

    Figure 6: Addition of two vectors illustrating the triangular inequality.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.24

    Pr 0.17 (a)(b) Sincex(t) = (1 + jt)2 = 1 + j2t+ j2t2 = 1 t2

    real

    +j 2timag.

    its derivative with respect to t is

    y(t) =dx(t)

    dt= 2t+ 2j = dRe[x(t)]

    dt+ j

    dIm[x(t)]dt

    % Pr. 0.17

    clear all

    t=[-5: 0.001:5];

    x=(1+j*t).2;

    xr=real(x);

    xi=imag(x);

    figure(7)

    subplot(211)

    plot(t,xr); title(Real part of x(t)); grid

    subplot(212)

    plot(t,xi); title(Imaginary part of x(t)); xlabel(Time); grid

    % Warning when plotting complex signals

    figure(8)

    disp(Read warning. MATLAB is being nice with you, this time!)

    plot(t,x); title(COMPLEX Signal x(t)?); xlabel(Time)

    When plotting the complex function x(t) as function of t, MATLAB ignores the imaginary part. One shouldnot plot complex functions as functions of time as the results are not clear when using MATLAB.(c) Using the rectangular expression of x(t) we have 1

    0

    x(t)dt =

    10

    (1 t2 + 2jt)dt = 1

    0

    (1 t2)dt+ 2j 1

    0

    t dt = t t3

    3+ j

    2t2

    2

    10 =

    2

    3+ j1

    (d) The integral 10

    x(t)dt = 1

    0

    (1 t2 2jt)dt = 1

    0

    (1 t2)dt 2j 1

    0

    t dt = t t3

    3 j 2t

    2

    2

    10 =

    2

    3 j1

    which is the complex conjugate of the integral calculated in (c). So yes, the expression is true.

    5 4 3 2 1 0 1 2 3 4 525

    20

    15

    10

    5

    0

    5Real part of x(t)

    5 4 3 2 1 0 1 2 3 4 510

    5

    0

    5

    10Imaginary part of x(t)

    Time5 4 3 2 1 0 1 2 3 4 5

    25

    20

    15

    10

    5

    0

    5COMPLEX Signal x(t)?

    Time

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.25

    Pr 0.18 (a) Using Eulers identity

    ejpin = cos(pin) + j sin(pin) = cos(pin) = (1)n

    so it is a real signal.

    ejpin

    n

    1

    1

    0

    1

    2

    3

    Figure 7: The complex exponential ejpin = cos(pin) which is real.

    (b) Replacing the sines by exponentials we have

    sin() sin() =1

    4(ej ej)(ej ej)

    =1

    4[ej(+) + ej(+) ej() ej(+)

    ]=

    1

    4 [2 cos(+ ) 2 cos( )]

    =1

    2[cos( ) cos(+ )]

    (c) Similarly

    cos() sin() =1

    4j(ej + ej)(ej ej)

    =1

    4j

    [ej(+) ej(+) ej() + ej(+)

    ]=

    1

    4j[2j sin(+ ) 2j sin( )]

    =1

    2[sin(+ ) sin( )]

    If = then cos() sin() = (1/2) sin(2) since sin(0) = 0. We have that T0 = 2 is the period of sin(pit),cos(pit) as well as sin(2pit) (indeed, sin(2pi(t+ 2)) = sin(2pit+ 4pi) = sin(2pit)), therefore the integral T0

    0

    sin(pit) cos(pit)dt = 0.5

    T00

    sin(2pit)dt = 0

    since the area under the sin(2pit) from [0, 2], which is the above integral, is zero. Thus sin(pit) and cos(pit)are orthogonal.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.26

    Pr 0.19 In the previous problem we obtained

    sin() sin() =1

    2[cos( ) cos(+ )]

    When we let = in this equation, we have that

    sin2() = 0.5[1 cos(2)]

    and the integral 10

    sin2(2pit)dt =

    10

    0.5dt 0.5 1

    0

    cos(4pit)dt = 0.5

    since the area under cos(4pit) from 0 to 1 is zero.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.27

    Pr 0.20 (a) Replacing zk = ||1/Nej(+2pik)/N in zN we get zNk = ||ej(+2pik) = ||ej() = for anyvalue of k = 0, , N 1.(b) Applying the above result we have:

    For z2 = 1 = 1ej2pi the roots are zk = 1ej(2pi+2pik)/2, k = 0, 1. When k = 0, z0 = ejpi = 1 andz1 = e

    j2pi = 1.

    When z2 = 1 = 1ejpi the roots are zk = 1ej(pi+2pik)/2, k = 0, 1. When k = 0, z0 = ejpi/2 = j, andz1 = e

    j3pi/2 = j.

    For z3 = 1 = 1ej2pi the roots are zk = 1ej(2pi+2pik)/3, k = 0, 1, 2. When k = 0, z0 = ej2pi/3; fork = 1, z1 = ej4pi/3 = ej2pi/3 = z0 ; and for k = 2, z2 = 1e

    j(2pi) = 1.

    When z3 = 1 = 1ejpi the roots are zk = 1ej(pi+2pik)/3, k = 0, 1, 2. When k = 0, z0 = ejpi/3; fork = 1, z1 = ejpi = 1; and for k = 2, z2 = 1ej(5pi)/3 = 1ej(pi)/3 = z0

    (c) Notice that the roots are equally spaced around a circle of radius r and that the complex roots appear aspairs of complex conjugate roots.

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.28

    Pr 0.21 (a) The log (using the naperian base) of a product is the sum of the logs of the terms in the product,and the log and the exponential are the opposite of each other so the last term in the equation.(b) Using the above expression for the log of a complex number (log of real numbers is a special case):

    log(2) = log(2ejpi) = log(2) jpilog(1 + j1) = log(

    2ejpi/4) = log(

    2) + jpi/4 = 0.5 log(2) + jpi/4

    log(2ejpi/4) = log(2) + jpi/4

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.29

    Pr 0.22 (a) If x = j

    cos(j) =1

    2(e + e) = cosh()

    (b) The hyperbolic sine is defined as

    sinh() =1

    2(e e)

    which is connected with the circular sine as follows

    sin(j) =1

    2j(e e) = j sinh() sinh() = j sin(j)

    (c) Since e > 0 then cosh() = cosh() > 0, the smallest value is for = 0 which gives cosh(0) = 1(d) Indeed,

    sinh() = 12

    (e e) = sinh()% Pr. 0.22

    clear all

    theta=sym(theta);

    x= 0.5*(exp(-theta)+exp(theta));

    y= 0.5*(exp(theta)-exp(-theta));

    figure(9)

    subplot(211)

    ezplot(x,[-10,10])

    grid

    subplot(212)

    ezplot(y,[-10,10])

    grid

    10 8 6 4 2 0 2 4 6 8 100

    1000

    2000

    3000

    4000

    5000

    6000

    1/2 exp()+1/2 exp()

    10 8 6 4 2 0 2 4 6 8 10

    2000

    1000

    0

    1000

    2000

    1/2 exp()1/2 exp()

    Copyright 2010, Elsevier, Inc. All rights reserved.

  • Chaparro Signals and Systems using MATLAB 0.30

    Pr 0.23 (a) Shifting to the right a cosine by a fourth of its period we get a sinusoid, thus

    sin(0t) = cos(0(t T0/4)) = cos(0t 0T0/4) = cos(0t pi/2)

    since 0 = 2pi/T0 or 0T0 = 2pi.(b) The phasor that generates a sine is Aejpi/2 since

    y(t) = Re[Aejpi/2ej0t] = Re[Aej(0tpi/2)] = A cos(0t pi/2)

    which equals A sin(0t).(c) The phasors corresponding to x(t) = A cos(0t) = A cos(0t+ pi) is Aejpi . For

    y(t) = A sin(0t) = A cos(0t pi/2) = A cos(0t pi/2 + pi) = A cos(0t+ pi/2)

    the phasor is Aejpi/2. Thus, relating any sinusoid to the corresponding cosine, the magnitude and angle ofthis cosine gives the magnitude and phase of the phasor that generates the given sinusoid.(d) If z(t) = x(t) + y(t) = A cos(0t) + A sin(0t), the phasor corresponding to z(t) is the sum of thephasors Aej0, corresponding to A cos(0t), with the phasor Aejpi/2, corresponding to A sin(0t), whichgives

    2Aejpi/4 (equivalently the sum of a vector with length A and angle 0 with another vector of length

    A and angle pi/2). We have that

    z(t) = Re[

    2Aejpi/4ej0t]

    =

    2A cos(0t pi/4)

    Copyright 2010, Elsevier, Inc. All rights reserved.