3777901 dpit exercises

Upload: goxtad

Post on 04-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 3777901 Dpit Exercises

    1/18

    DATA PROCESSING AND

    INVERSE THEORY:

    PRACTICAL EXERCISES REPORT

    Rafael Fernando Daz Gaztelu

    3777901

  • 8/13/2019 3777901 Dpit Exercises

    2/18

    Geophysical Data Processing: Exercise 1

    1) Fourier transform of sine and cosine

    a) Calculate analytically the Fourier transform of f(t)=cos(2M t)

    f(t)=cos(2M t)=

    1

    2 (e2j Mt

    +e2j Mt

    )

    FT(f(t))=F()=

    +

    e2j t 1

    2(e2j M t+e2j M t) dt=1

    2

    +

    (e2j (M)t+e2j(+M)t)dt =

    =1

    2[(M)(+0)]

    b) What is the Fourier transform of f(t)=sin (2 M t)

    f(t)=sin (2 M

    t)=1

    2j (e

    2j Mte2j M t

    )

    FT(f(t))=F()=

    +

    e2j t 1

    2j(e2j Mte2j Mt) dt= 1

    2j

    +

    (e2j(M)te2j(+M)t)dt

    j

    2[(+M)(0)]

    c) Use matlab to compute the Discrete Fourier Transform of f(t)=cos(2M t) andf(t)=sin (2 M t) and plot the amplitude and phase spectra; use M=5Hz

    Why is the computed result different from the analytical result?

    t=[0:0.001:4.95]

    frax=[0:0.101:500];

    nu=5;

    f=cos(2*pi*nu*t);

    g=fft(f)

    subplot(311)

    plot(tf);

    subplot(312)

    plot(tg)

    axis([!1 # !1000 2000])

    subplot(313)

    plot(fraxg)axis([!100 #00 !1000 2000])

  • 8/13/2019 3777901 Dpit Exercises

    3/18

    2) Time and frequency domain.in! the ten "i#en functions in the time domain to their

    counterparts in the fre$uency domain%

  • 8/13/2019 3777901 Dpit Exercises

    4/18

    3) Properties of the Fourier transform.The Fourier transform of f&t) is defined by'

    FT(f(t))=F()=

    +

    f(t)e2j tdt

    The in#erse Fourier transform is "i#en by'

    FT1(F( ))=f( t)=+

    F() e2j tdt

    Demonstrate the follo(in" properties of the Fourier Transform'

    a) imilarity'

    FT( f( t))= 1

    F( )

    FT(f( t))=

    +

    f( t)e2j tdt

    >0 * FT( f( t))= 1

    f( t)e2j t dt=

    [u= dt

    du= dt]=

    1

    f(u)e2 j

    u du +

    + 1

    F( )

  • 8/13/2019 3777901 Dpit Exercises

    5/18

    e) 0roof the con#olution theorem%

    "i# FT( f")=FT(f) 1 FT(")

    FT(f")=

    (

    f()"(t)d)e2j tdt=

    f( )(

    "(t)e2j tdt)d=[u=tdu=dt] == f( )("(u)e

    2j (u)dt d= f() e2j d 1"(u)e

    2j u du=FT(f)1 FT(")QD

    "ii# FT(f 1 ")=FT(f)FT(")

    FT(f 1 ")= f 1 " 1 e2j tdt= (F( -)e2j - td -)"(t)e2j tdt == F( -)("( t)e2j( -)tdt)d=F( -) 1,(2j( -))d -=F(),()

    QD

  • 8/13/2019 3777901 Dpit Exercises

    6/18

    4) Fourier transform of boxcar function.

    o.car function f&t)3 centered at t+4 is "i#en by'

    f(t)=

    1 T

    2

  • 8/13/2019 3777901 Dpit Exercises

    7/18

    axis([0 0.1 !10 10])

    titl&('&nt&r& oxcar /')

    xlab&l('r&u&nc-')

    -lab&l(' ,plitu&')

    subplot(234)

    plot(t%)

    axis([!10 10 0 5])titl&('oxcar function')

    xlab&l('+i,&')

    -lab&l(',plitu&')

    subplot(235)

    plot(nugur)

    axis([0 0.1 !10 10])

    titl&('oxcar /')

    xlab&l('r&u&nc-')

    -lab&l(',plitu&')

    subplot(23#)

    plot(nuangl&(gur))

    axis([0 0.1 !10 10])

    titl&('oxcar /')

    xlab&l('r&u&nc-')

    -lab&l(' ,plitu&')

  • 8/13/2019 3777901 Dpit Exercises

    8/18

    Geophysical Data Processing: Exercise 2

    1) Sampling theorem

    We study the influence of samplin" rate and si"nal len"th% The time si"nal f&t) is "i#en by'f(t)=cos(21t)+cos(2 2t)

    (ith fre$uencies 1=12%567 and 2=7567 %a) Discretise the continous function usin" as time inter#als t=2&s3 '&s3(&s respecti#ely3plot these results%

    b) Compute the amplitude spectra and display results%

    t1=[0:0.002:1]

    t2=[0:0.004:1]

    t3=[0:0.00:1]

    nu1=12.5

    nu2=5

    f1=cos(2*pi*nu1*t1)6cos(2*pi*nu2*t1)

    f2=cos(2*pi*nu1*t2)6cos(2*pi*nu2*t2)

    f3=cos(2*pi*nu1*t3)6cos(2*pi*nu2*t3)

    subplot(311)

    plot(t1f1)

    xlab&l('+i,&')

    -lab&l(',plitu&')

    titl& ('+i,& laps& of 2 ,s')

    subplot(312)

    plot(t2f2)

    xlab&l('+i,&')

    -lab&l(',plitu&')

    titl& ('+i,& laps& of 4 ,s')

    subplot(313)

    plot(t3f3)

    xlab&l('+i,&')

    -lab&l(',plitu&')

    titl& ('+i,& laps& of ,s')

  • 8/13/2019 3777901 Dpit Exercises

    9/18

    c) 8.plain results and compute aliasin" fre$uency% oo! at the amplitude spectra% What does theory

    tell you and (hat happened to the side lobes?

    )ccordin* to t+e ,-.uist "or sa&/lin*# t+eore&$ t+e &ini&u& fre.uenc- ale to sa&/le it+out

    losin* infor&ation is C=M9/=22=2 1 7567=15067 +ic+ -ields a ti&e la/se of tC=%7 ms %

    a&/lin* at t1=2 ms and t2=' ms are still o4$ t+is &eans t+at no infor&ation is lost$unli4e t2=( ms $ +ic+ -ields a fre.uenc- under C $ and it is een isile in t+e a&/litudes/ectru& /lot t+at it *ies a /oor dis/la- of t+e function%

    d) 8.tend the si"nal len"th by addin" 7eros at the end% 0lot the resultin" amplitude spectra of the

    e.tended si"nal and e.plain%

    t1=[0:0.002:1]

    t2=[0:0.004:1]

    t3=[0:0.00:1]

    nu1=12.5

    nu2=5

    f1=cos(2*pi*nu1*t1)6cos(2*pi*nu2*t1)

    f2=cos(2*pi*nu1*t2)6cos(2*pi*nu2*t2)

    f3=cos(2*pi*nu1*t3)6cos(2*pi*nu2*t3)

    1=[f17&ros(15)]

    2=[f27&ros(15)]

    3=[f37&ros(15)]

    +1=[t17&ros(15)]

    +2=[t27&ros(15)]

    +3=[t37&ros(15)]

    subplot(311)

    plot(+11)

    xlab&l('+i,&')

    -lab&l(',plitu&')

    titl& ('+i,& laps& of 2 ,s')

    subplot(312)

    plot(+22)

    xlab&l('+i,&')

    -lab&l(',plitu&')titl& ('+i,& laps& of 4 ,s')

    subplot(313)

    plot(+33)

    xlab&l('+i,&')

    -lab&l(',plitu&')

    title ('Time lapse of 8 ms')

  • 8/13/2019 3777901 Dpit Exercises

    10/18

    ):n e.ercise &) (e ha#e seen that the spectrum of the finite cosine corresponds to t(o sinc

    functions centered at < fre$uency of the cosine% :n order to supress the side lobes of the spectral

    (indo( different time (indo(s can be used3 arlett or Trian"ular Windo(3 6annin" Windo( or

    ,aussian Windo(% Compute the spectra for the same si"nal as in e.ercise &) but use the three

    (indo(in" functions mentioned abo#e%

    t=[0:0.001:1]

    nu1=12.5

    nu2=5

    8=1001

    f=cos(2*pi*nu1*t)6cos(2*pi*nu2*t)

    =bartl&tt(8)

    -=%ann(8)

    ,=gaussin(8)

    ='

    -=-'

    ,=,'

    %=.*f

    =-.*f

    s=,.*f

    subplot(311)

    plot(t%)

    xlab&l('+i,&')

    -lab&l(',plitu&')titl& ('artl&tt or +riangular ino')

    subplot(312)

    plot(t)

    xlab&l('+i,&')

    -lab&l(',plitu&')

    titl& ('

  • 8/13/2019 3777901 Dpit Exercises

    11/18

    Geophysical Data Processing: Exercise 3

    1) !iscrete con"olution.

    Code a function (hich performs a discrete con#olution bet(een t(o arbitrary se$uences .43.3%%%.n

    and .43.3%%%.m%&also called (a#elets)%

    a) 0erform direct con#olution in the time domain%

    b) 0erform the operation in the =>domainc) Thin! of the se$uences .3 .2and y+con#&.3.2) as #ectors and try to (rite the con#olution as a

    matri. multiplication%

    d) Chec! all results (ith the intrinsic function conv%

    %MASTER PROGRAM EVERYTH!G

    "#inp$t('Ente t&e fist avelet "')

    inp$t('Ente t&e secon* avelet &')

    m#len+t&("),

    n#len+t&(&),

    -#."/eos(0n)1,

    H#.&/eos(0m)1,

    fo i#0n2m30

    Y(i)#4

    fo 5#0m

    if(i352064)

    Y(i)#Y(i)2-(5)7H(i3520),

    else

    en*

    en*

    en*

    Y

    #m2n30

    $#/eos(0)

    fo 5#0nfo n#0m

    $(52n30)#$(52n30)2&(5)7"(n),

    en*

    en*

    "m#toeplit/(."(0) /eos(0len+t&(&)30) 1 ." /eos(0len+t&(&)30) 1),

    +0#&7"m

    s$9plot(::0),

    stem(Y)

    ;la9el('Y.n1'),

    "la9el('333336n'),

    title('

  • 8/13/2019 3777901 Dpit Exercises

    12/18

    For t+e aelets6x=[10!12]

    -=[5!5401!1]

    +ese are t+e /lots t+at are /roduced6

    +e last *ra/+s dis/la-s t+e intrinsic conv o/eration%

    ) !iscrete correlation.Code a function (hich performs a discrete correlation bet(een t(o

    arbirtrary (a#elets% The function needs to return both the #alue and the time la"%a) 0erform direct correlation in the time domain%

    b) 9pply a #ariable substitution to (rite a correlation as a con#olution% ou can no( chec! your

    routine &a) usin" the Matlab intrinsiccon$%

    x=input('>nt&r t%& s&u&nc& 1: ');

    %=input('>nt&r t%& s&u&nc& 2: ');

    -=xcorr(x%);

    figur&;

    subplot(311);

    st&,(x);

    xlab&l('n!?');

    -lab&l(',plitu&!?');titl&('@nput s&u&nc& 1');

    subplot(312);

    st&,(fliplr(-));

    st&,(%);

    xlab&l('n!?');

    -lab&l(',plitu&!?');

    titl&('@nput s&u&nc& 2');

    subplot(313);

    st&,(fliplr(-));

    xlab&l('n!?');

    -lab&l(',plitu&!?');

    titl&('Autput s&u&nc&');isp('+%& r&sultant is');

    fliplr(-);

  • 8/13/2019 3777901 Dpit Exercises

    13/18

    3) #inear filtering.

    The (a#elet b is "i#en by @43>343323A3B334% The delay filter f is "i#en by @43434343%

    a) 9pply the delay filter to (a#elet b% 0lot the ori"inal and the delayed (a#elet%

    b) Compute and #isualise the cross>correlation bet(een b and bf and e.plain ho( the time

    difference bet(een b and bf can be estimated%

    c) 0erturb f (ith random noise% Compute and #isualise the cross>correlation bet(een the t(o

    (a#eforms and determine the time shift%

    9#.43040:?>041

    f#.444401

    t#.400?1

    *isp('@EAYE@ BAVEET')

    conv(9f)

    *isp('

  • 8/13/2019 3777901 Dpit Exercises

    14/18

    Geophysical Data Processing: Exercise 4

    1) $otch filter.The discrete si"nal f&t) is "i#en by f(t)=cos(21t) and it is perturbed by noisecharacterised by "(t)=cos (2 2t) (ith fre$uencies 1=12%567 and 2=5067 % The

    si"nal is recorded at inter#al =' ms 3 use E+2 samples% The noise hast to be eliminated formthe si"nal by filterin" it (ith a notch filter%

    a) ho( that for any T: filter the transfer function is "i#en by 6(7)=?(7)

    /(7)=

    2(7)9(7)

    (here the

    coefficients of &7) and 9&7) are the filter coefficients b i and aj% Find the filter coefficients of the

    notch filter and compute and #isualise the impulse response for G+4343 G+43 and G+>434%

    b) Compute the fre$uency response% What other possibility can you thin! of to "et the fre$uency

    response?

    c) 9pply the filter to the si"nal and in#esti"ate the influence of different #alues for G%

    n$0#0:D

    n$:#D4

    ta$#4C44?t#.44C40DC0:1

    n$s#.44C40DC0:1

    epsilon#4C4D

    f0#cos(:7pi7n$07t)

    f:#cos(:7pi7n$:7t)

    f#f02f:

    =#e"p(:757pi7n$s7ta$)

    =4#e"p(3:757n$:7ta$)

    =P#(02epsilon)7e"p(3:757n$:7ta$)

    A#(=3=4)

    #(=3=P)

    0:)

    stem(filtee*)

  • 8/13/2019 3777901 Dpit Exercises

    15/18

    ) %utter&orth filter.9 utter(orth filter is a common form of a lo( pass filter defined by the

    follo(in" amplitude spectrum%

    F( )=F()F()= 1

    1+( C)2n

    Where HCis the cut>off fre$uency3 n is the number of poles (hich determines the rate of decay of thefilter and F() is the comple. conju"ate of F&H)%a) Use the bilinear transformation to find an e.pression for F&7) for a second order utter(orth

    filter &n+2)% 9n e.pression can be obtained in the form F&7)+9&7)5&7)3 (here 9&7) and &7) are

    polynomials in 7%

    b) Construct a second order &n+2) recursi#e utter(orth filter and "i#e the impulse response%

    c) ,i#e the fre$uency response of a second>order utter(orth filter%

    d) 9pply the utter(orth filter to remo#e the noise from the si"nal in e.ercise %

    F(s )=

    c(ss1)(ss2)=

    jc2sin3 /'(ss1) +

    jc2sin3/ '(ss2)

    +e ilinear transfor&ation6

    2j =2171+7

    * =1

    j171+7

    +en6

    F(s)=

    csin3/'

    sin (Csin3/')eCcos3/ '7

    1

    12cos(Csin 3 /')eCcos3/ '7

    1+e2Ccos3/ '72=

    = C

    2 (1+2z1+72)

    '' C

    cos 3 /'+c

    2+((+2 C

    2 )71+('+' C

    cos 3/'+C

    2 )72

  • 8/13/2019 3777901 Dpit Exercises

    16/18

    Geophysical Data Processing: Exercise 5

    1)The problem is to find the in#erse (a#elet h of len"th 2 of the (a#elet "+&I33)% First find the

    in#erse by series e.pansion of its =>transform%

    8n t+e ti&e do&ain e +ad6"+&I33)%8ts :ransfor& is t+en6 ,&=)+IJ=J=2

    8f e are loo4in* for an6&=)t+at does t+e tric46 ,&=)16&=)+$ t+en6 6(=)= 1,(=)

    $ so6

    o 6(=)=1

    +

    5

    12= +ic+ in t+e ti&e do&ain is6 +="1;$5;12#

    :n a second approach find the optimum in#erse (a#elet% What is the best decon#olution operator in

    this case and (hy?

    +e est deconolution o/erator ould e t+e

  • 8/13/2019 3777901 Dpit Exercises

    17/18

    )Consider the function .&t)+cos &2N4t) (ith N4+4367% ample .&t) e#ery second% Ta!e si. samples

    in total% What happens if you sample e#ery t(o seconds? :n (hat follo(s (e only consider the case

    of a samplin" inter#al of second? Calculate the autocorrelation of .&t)% Calculate the prediction

    filter of len"th 2 (hich "i#es .I3 the Lthsample of .&t)% Compare the prediction to the true #alue% :n

    "eneral3 the predicted #alues of .&t) are "i#en by .&t)f&t)% ,i#e the succesi#e errors for these

    predictions &r3r2%%%) and comment%

    n$#4CD

    t0#.40D1

    t:#.4:D1

    t>#.44C0I01

    "0#cos(:7pi7n$7t0)

    ":#cos(:7pi7n$7t:)

    ">#cos(:7pi7n$7t>)

    +#"co("0"0)

    "co(":":)

    #"co(">">)

    s$9plot(>00)

    plot(t0"0)

    title('Samplin+ eve; secon*')

    s$9plot(>0:)

    plot(t:":)

    title('Samplin+ eve; : secon*s')

    s$9plot(>0>)

    plot(t>">)

    title('Samplin+ inteval of 0 secon*')

    fi+$e

    s$9plot(>00)

    stem(+)

    title('A$tocoelation of "0')

    s$9plot(>0:)

    stem(&)

    title('A$tocoelation of ":')

    s$9plot(>0>)

    stem()

    title('A$tocoelation of ">')

  • 8/13/2019 3777901 Dpit Exercises

    18/18

    Geophysical Data Processing: Exercise 6

    si+ma#4C0

    G#. 4C>>>8 0CIKJ0 4 :C4>4K 4 4 :C4>4K 4 4,

    4 :C4004 4 4 :C4004 4 4C?88> 0CD::J 4,

    4 :C440: 4 4 :C440: 4 4 :C440: 4,

    4 :C440: 4 4 :C440: 4 4 :C440: 4, 4 :C4004 4 4 :C4004 4 4 0CD::J

    4C?88>,

    4 0CIKJ0 4C>>>8 4 4 :C4>4K 4 4

    :C4>4K,

    4 4 4 0CIKJ0 4 4 4C>>>8 :C4>4K

    :C4>4K,

    4 4 4 :C4004 :C4004 0CD::J 4 4 4C?88>

    4 4 4 :C440: :C440: :C440: 4 4 4,

    4 4 4 :C440: :C440: :C440: 4 4 4,

    4 4 4C?88> :C4004 :C4004 0CD::J 4 4 4,

    4C>>>8 :C4>4K :C4>4K 0CIKJ0 4 4 4 4 41,m#.D4 I4 D4 I4 D8 I4 D4 I4 D41,

    mt#m'

    %SOV!G THE ORBAR@ PROEM

    *#G7mt

    %SOV!G Y EAST SLFARES

    GT#tanspose(G)

    mls#(inv(GT7G))7GT7*