How can I store wavelet values in an array while using a loop in MATLAB?

  • Context: MATLAB 
  • Thread starter Thread starter Abdullah266
  • Start date Start date
  • Tags Tags
    Matlab Wavelet
Click For Summary
SUMMARY

The discussion focuses on generating a Ricker wavelet in MATLAB and storing its values in an array for convolution with Earth reflectivity data. The user initially encounters an issue where only the last computed value of the wavelet is retained due to improper array handling. The solution involves modifying the loop to store each computed wavelet value in an array using the syntax w(t/0.001+1)=(1-(2*pi^2*f^2*t^2))*exp(-pi^2*f^2*t^2);, ensuring all values are preserved for further processing.

PREREQUISITES
  • Understanding of MATLAB syntax and array manipulation
  • Familiarity with wavelet theory, specifically the Ricker wavelet
  • Knowledge of convolution operations in signal processing
  • Basic understanding of seismic data and Earth reflectivity concepts
NEXT STEPS
  • Explore MATLAB array indexing techniques for efficient data storage
  • Learn about the Ricker wavelet and its applications in seismic analysis
  • Research convolution methods in MATLAB for signal processing
  • Review MATLAB documentation on loops and array operations for best practices
USEFUL FOR

This discussion is beneficial for MATLAB users, seismic data analysts, and researchers working with wavelet transforms and convolution in signal processing applications.

Abdullah266
Messages
1
Reaction score
0
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
 
Physics news on Phys.org
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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K