testchirps.m




 
 
testchirps.m
More comments
function[t,e,n,z]=testchirps(npts,delt,amplove,amprayl,azlove,azrayl)
%
% [t,e,n,z]=testchirps(npts,delt,amplove,amprayl,azlove,azrayl)
%
% Generate synthetic Love and Rayleigh waves from the 
% Matlab chirp function
%
% Input:
%   npts = number of points
%   delt = sampling interval (s)
%   amplove = amplitude of Love wave
%   amprayl = amplitude of Rayleigh wave
%   azlove = azimuth of approach of the Love wave
%   azrayl= azimuth of approach of the Rayleigh wave
tfin=delt*(npts-1);
t=linspace(0,tfin,npts);
wlove=amplove*chirp(t,0.01,npts,1).*t.*(tfin-t);
wrayl=amprayl*chirp(t,0.005,npts,2).*t.*(tfin-t);
z=-imag(hilbert(wrayl));   % phaseshift the vertical Rayleigh wave
%figure;
%subplot(2,1,1);
%plot(t,wlove);
%subplot(2,1,2);
%plot(t,wrayl,'r',t,z,'b');
%  Make synthetic particle motions
e=-sin(azrayl*pi/180)*wrayl - cos(azlove*pi/180)*wlove;
n=-cos(azrayl*pi/180)*wrayl + sin(azlove*pi/180)*wlove;
%
%figure;
%subplot(3,1,1);
%plot(t,e);
%subplot(3,1,2);
%plot(t,n);
%subplot(3,1,3);
%plot(t,z);
return;
 
 



Matlab WebSite: http://www.mathworks.com/



 

Back