How to convolve a wavelet with a signal to make a wedge model?
4 views (last 30 days)
Show older comments
Maria Amr
on 27 Jan 2021
Answered: Afshin Aghayan
on 27 Jan 2021
I asked my question in public but I have not got any help. I would appreciate if you can help me as I am new in MATLANB :(.
I have a signal and I want to convolve it with a wavelet and make a wedge model. It is a seismic wedge model and I want to make a single low impedance layer wedge model. I truly appreciated in advance!
My wavelet code is:
%.............................................
fr=30;% frequency
dt=.002;
T=0.1;
tt=-T:dt:T;
tsh=0.008;%time shifting
tr=round(length(tt)/2);
t=tt(tr:end);
zpr=(1-tt.^2*fr^2*pi^2).*exp(-tt.^2*pi^2*fr^2);%zero-phase ricker
figure(10)
plot(zpr)
%................................................
My signal is:
%...............................................
data=xlsread('1');
amp=data(:,2);%us/f
time=data(:,1);%ms
tim=time(1:1:end);
am=amp(1:1:end);
len=length(tim);
for i=1:len
if am(i)==-999.25
am(i)=am(i-1);
end
end
data1=zeros(len,2);
tti=round(tim);
for j=2:len
r(j)=(am(j)-am(j-1))/(am(j)+am(j-1));% reflection coefficients
end
plot(r)
%%%%%%%%%
I can convolve the wavelet and signal to make a simple synthetic trace but not a wedge.
%..............................................................
s=conv(r,zpr);
if mod(length(zpr),2)==0
s=s(length(zpr)/2:end-length(zpr)/2);
else
s=s((length(zpr)-1)/2:end-(length(zpr)-1)/2);
end
ls=length(s);
s(ls)=[];
[m1 n1]=size(s);
if m1==1
s=s';
end
n=10;
dx=2;
scal=5;
figure(1)
for i=1:n
b=(i-1)*dx;
a=scal*s+b;
c=a;
a(a<b)=b;
plot(c,tti,'black')
hold on
fill(a,tti,'k','linestyle','none');
end
hold off
set(gca,'YDir','reverse')
xlim([-dx (n+1)*dx])
ylim([700 2826])
ylabel('millisecent')
title('synthetic trace made of zero-phase ricker') ;
0 Comments
Accepted Answer
Afshin Aghayan
on 27 Jan 2021
I wrote the following code a long time ago (2011) that can create seismic events based on their slope like wedge model. I hope it can be useful for you.
% This function diplays siemic events based on slope
clc
number=input('How maney events do you want to see? ');
x=input('Enter number of traces : ');
d=input('Enter trace interval in m : ');
t=input('Enter maximum recording time in ms : ');
f=input('Enter frequency of the Ricker wavelet (Hz) : ');
% Ricker wavelet equal ricker=(1-2(pi*f*t)^2)*exp(-(pi*f*t)^2))
n=(0:100);
wavelet=(1-2*(pi*f*(n-50)*0.001).^2).*exp(-(pi*f*(n-50)*0.001).^2);
% Creating the impedance matrix
ImpMatrix=zeros(t,x);
for num=1:number
slope=input(['Enter slope of the event#' num2str(num) ' in degree (e.g. 0 means horizontal line) : ']);
t0=input(['Enter start time of the event#' num2str(num) ' in ms : ']);
if t0==0; t0=1; end % In the case t0=0, we assume that the event is recorded at the first sample
for i=1:x
k=d*i;
t1=k*tand(slope)+t0;
if ceil(t1)<=t && ceil(t1)>0
ImpMatrix(ceil(t1),i)=1;
end
end
end
fieldCon=conv2(ImpMatrix,wavelet','same');
field=fieldCon(1:t,:);
%================================Display===================================
if exist('wigb') == 2 % check wigb function exists
figure, wigb(field);
ylabel('Time (ms)'), xlabel('Trace no.')
ylim([1 t])
end
figure,imagesc(field)
ylabel('Time (ms)'), xlabel('Trace no.')
% Afshin Aghayan
% 2011
0 Comments
More Answers (0)
See Also
Categories
Find more on Continuous Wavelet Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!