plot the ricker model in matlab

Here is a simple MATLAB code to plot the Ricker wavelet using the equation of the Ricker model.

main.m
% Ricker model parameters
f = 30;           % Frequency of the wavelet (Hz)
t_peak = 0.04;    % Time of the peak amplitude (s)
dt = 0.001;       % Time step (s)
t = -0.2:dt:0.2;  % Time axis (s)

% Ricker wavelet equation
w = (1 - 2*pi^2*f^2*(t-t_peak).^2) .* exp(-pi^2*f^2*(t-t_peak).^2);

% Plot Ricker wavelet
plot(t,w,'linewidth',2);
xlabel('Time (s)');
ylabel('Amplitude');
title('Ricker Wavelet');
404 chars
15 lines

This will create a plot of the Ricker wavelet with a frequency of 30 Hz and a peak amplitude at 0.04 seconds. You can adjust these parameters to create different wavelets.

gistlibby LogSnag