Creating a phase-velocity diagram with matlab

In summary, a phase-velocity diagram is a plot used to analyze the propagation of waves in different mediums by displaying the phase velocity as a function of frequency or wavenumber. To create one with Matlab, you can use the "plot" and "scatter" functions and customize its appearance with other plotting functions. The required inputs include frequency or wavenumber data and corresponding phase velocity data, along with units and any additional parameters. The diagram can be used to analyze data by observing the shape and slope of the curves and comparing different data sets for patterns and relationships.
  • #1
Bugeye
4
0

Homework Statement


I'm given a time vector and y-values of a wave. The plot looks like this:
CZiBK.png



Homework Equations


I have been calculating the velocity using this equation:
[itex]c=\frac{ω Δx}{Δ\Phi}[/itex]
Where [itex]\Delta\Phi[/itex] is the phase change between the phase that you calculate using the Fourier transform and Δx is the space between the sensors that collected the data


The Attempt at a Solution


Code:
function [ f velocities ] = dCurve( data, geophoneSpacing, freqLimit )
% Makes the dispersion curve given the raw geophone data, sampling frequency
% and geophone spacing. The resulting curve is plotted.


%Split up the data into useful variables.
%This can be ignored for the most part, this is just reformatting the data
%The results are the following variables:
%t-> the time vector for the equations
%sensorData-> a matrix that has the same number of columns as t and a row for each sensor's raw values
%sensorCount -> The # of sensors
%Fs -> the sampling frequency
datasize=size(data);
t=data(2:datasize(1));
sensorData=data(2:datasize(1),2:datasize(2))';
sensorCount=size(sensorData);
sensorCount=sensorCount(1);
Fs=1/(t(2)-t(1));

%Get the Fourier transform
for i=1:sensorCount
    [f, rawFft(i,:)]=dfft(Fs, sensorData(i,:));
end
absFft=abs(rawFft);
reFft=real(rawFft);
imFft=imag(rawFft);

%Get the phase between each sensor
for i=1:sensorCount
    phi(i,:)=angle(rawFft(i,:));
end

%Get the phase change between each sensor
for i=1:(sensorCount-1) % Go through each pair of sensors. The pairs consist of sensors i and i+1
    dPhi(i,:)=phi(i,:)-phi(i+1,:);
    dPhi=dPhi-(2*pi*(dPhi>pi));
    dPhi=dPhi+(2*pi*(dPhi<-pi));
end

%Calculate velocity
for i=1:(sensorCount-1)
    w=2*pi()*f;
    c(i,:)=(w.*geophoneSpacing)./(dPhi(i,:));
end

f=f(f<=freqLimit);
velocities=c(f<=freqLimit);

end

dfft is a function that creates a fft and a domain and returns it. The thing works fine if both of the equations are exactly the same except shifted a bit. For example, this works. Well, except for that dip at the end:
The initial functions:
6QQpV.png


The result after running them through the script
gpVOp.png


Unfortunately, it doesn't work as well as I would like. For example, those sine waves from above don't work. I get the following results:
Original:
CZiBK.png


Result:
zD2ED.png


I'm not sure if I'm using the wrong equations, if my code is wrong, or if I'm interpreting the graphs wrong. Can anyone help?
 
Last edited:
Physics news on Phys.org
  • #2


Thank you for sharing your work and concerns. It seems like you have put a lot of effort into your code and your analysis of the data. From what I can see, it seems like there may be a few issues that could be causing the discrepancies in your results.

Firstly, it would be helpful to have more information about the data you are working with, such as the type of wave, the frequency range, and the geophone spacing. This could help us better understand the behavior of the wave and potentially identify any issues with your calculations.

Secondly, it seems like you are using a Fourier transform to calculate the phase change between sensors. While this can be a useful tool, it may not be the most accurate method for calculating phase differences between closely spaced sensors. You may want to consider using a cross-correlation method instead, which can provide more precise results for small phase shifts.

Lastly, it is important to double check your code and make sure all the equations and calculations are correct. Sometimes a small mistake in the code can lead to significant errors in the results. It may also be helpful to compare your results with other methods or data sets to verify the accuracy of your calculations.

I hope this helps and good luck with your research!
 

1. What is a phase-velocity diagram?

A phase-velocity diagram is a plot of the phase velocity of a wave as a function of its frequency or wavenumber. It is a useful tool for analyzing the propagation of waves in various mediums.

2. How can I create a phase-velocity diagram with Matlab?

To create a phase-velocity diagram with Matlab, you will need to use the "plot" and "scatter" functions to plot the phase velocity data. You can also use the "legend" function to label the different curves on the diagram.

3. What are the inputs required to create a phase-velocity diagram with Matlab?

The inputs required to create a phase-velocity diagram with Matlab include the frequency or wavenumber data and the corresponding phase velocity data. You may also need to specify the units of the data and any additional parameters, such as the speed of the wave in the medium.

4. Can I customize the appearance of my phase-velocity diagram in Matlab?

Yes, you can customize the appearance of your phase-velocity diagram in Matlab by using various plotting functions, such as "line" and "xlabel," to change the color, style, and labels of the lines and axes. You can also add titles and annotations to make your diagram more informative.

5. How can I use a phase-velocity diagram to analyze my data?

A phase-velocity diagram can provide valuable insights into the behavior of waves in different mediums. By analyzing the shape and slope of the curves on the diagram, you can determine the speed, direction, and other characteristics of the waves. You can also compare different data sets to identify patterns and relationships between the phase velocity and other variables.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
558
  • Calculus and Beyond Homework Help
Replies
1
Views
340
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
619
  • Calculus and Beyond Homework Help
Replies
1
Views
786
Replies
1
Views
626
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
534
  • Calculus and Beyond Homework Help
Replies
10
Views
2K
Back
Top