derivative using FFT properties
Show older comments
Hi, I am trying to make a calculation by taking the first deriviative without success, I've tried the next couple of methods:
%%%the data is a seismic shot gather
%%%size(data_TX,1)=1001 (number of time samples)
%%%siz (data_TX,2)=256 (number of increments)
data_FK=fft2(data_TX);
% setting the the time and spacial freq vectors
fq=linspace(0,1/dx,size(data_TX,1)-1/2*dt);
kx=linspace(0,1/dy,size(data_TX,2)-1/2*dx);
%1 method
[FQ,KX]=meshgrid(ifftshift(fq),ifftshift(kx));
Dt_data_FK=2i*pi*FQ.*data_FK;
Dx_data_FK=2i*pi*KX.*data_FK;
%in this case I need to transpose the matrices
FQ=FQ';
KX=KX';
Dt_data_FK=2i*pi*FQ.*data_FK;
Dx_data_FK=2i*pi*KX.*data_FK;
Dt_data_TX=ifft2(Dt_data_FK);
Dx_data_TX=ifft2(Dx_data_FK); %I get in this case a complex data set ?
%2nd method
data_FK=fftshift(fft2(data_TX));
Dt_data_FK=2*pi*1i*diag(fq)*data_FK;
Dx_data_FK=2*pi*1i*data_FK*diag(kx);
Dt_data_TX=ifft2(ifftshift(Dt_data_FK),'symmetric');
Dx_data_TX=ifft2(ifftshift(Dt_data_TX),'symmetric');
note: I need to make the calculation for a cube CUBE(k,j,i), k=1001 time samples, j=256 recievers,i=256 shots.
I tried at first to use fftn but all ways produced me with wrong results. the theory is right but i'm not sure exactly how to take the derivative.
1 Comment
Jonathan Ron
on 28 Jun 2012
Accepted Answer
More Answers (1)
Francesco
on 18 Jan 2013
1 vote
Hello.
When I use the script shown after "EDIT 6/22" by Elige Grant, I seem to get complex numbers in the "data_spacedomain_differentiated" matrix. Shouldn't the signal just be real? Should I just extract the real component or am is that script somehow incomplete??
Cheers,
F
Categories
Find more on Fourier Analysis and Filtering 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!