Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Generating wavelet in matlab

  1. May 26, 2010 #1
    Hi all,
    I want to generate a ricker wavelet using matlab then I convolve it with the earth reflictivity (e) to get a seismic trace

    I have (e) and I would like to generate ricker using the equation
    w=(1-(2*pi^2*f^2*t^2))*exp(-pi^2*f^2*t^2)
    between t:dt:tf

    I use loop in matlab to get the wavelet

    for t=0:0.001:0.05
    w=(1-(2*pi^2*f^2*t^2))*exp(-pi^2*f^2*t^2);
    end

    the problem is that matlab assign each w= a value
    and when I convolve it with the e it convolve only the last value in w
    so I want to get w in the form w=[ value1 value2 value ..]
    insted of getting it
    w= value1
    w= value2
    w=value 3
    .
    .
    .

    please I need your urgent help
     
  2. jcsd
  3. May 27, 2010 #2
    You have to store the values in a array, otherwise only the last value at t=0.05 will be stored in w.
    Make w as an array like this
    w(t/0.001+1)=(1-(2*pi^2*f^2*t^2))*exp(-pi^2*f^2*t^2);

    Now w will have all values as desired.
    For any help regarding arrays please refer to Matlab help documentation.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook