How to Calculate Vertical Wavelength

Hi,
In the attached file "Signal" I have three (3) columns of signals. Please I want to calculate the wavelength?. The dt is 0.02 km. the data ranges from 20 to 40 km.
thanks

 Accepted Answer

This should get you started:
D = load('Signal.txt');
dt = 0.02;
L = size(D,1);
t = linspace(0, 1, L)*dt;
Fs = 1/dt;
Fn = Fs/2;
FTD = fft(D - mean(D))/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
[Amax,idx] = max(abs(FTD(Iv,:))*2);
FreqAtMaxAmplitude = Fv(idx)
figure
subplot(3,1,1)
plot(Fv, abs(FTD(Iv,1))*2)
xlim([0 5])
grid
subplot(3,1,2)
plot(Fv, abs(FTD(Iv,2))*2)
grid
xlim([0 5])
subplot(3,1,3)
plot(Fv, abs(FTD(Iv,3))*2)
grid
xlim([0 5])
The wavelength is the propagation velocity divided by the frequency in radians/time unit. The ‘FreqAtMaxAmplitude’ gives the frequencies of the peaks in Hz, so multiply these by to get the radian frequencies. You will then have to provide the propagation velocity in order to calculate the wavelength:
lambda = propagation_velocity ./ (2*pi*FreqAtMaxAmplitude)

4 Comments

TTA
TTA on 5 Mar 2020
Edited: TTA on 5 Mar 2020
Thank you very much. Please how can know the propagation velocity. I used the default wave velocity of 299 792 458 m/s, but my values are too large. Please I get a hint?
I would use that propagation velocity as well, for electromagnetic waves. You might be able to get better frequency resolution with:
FTD = fft(D - mean(D), 4.^nextpow2(L))/L;
Fv = linspace(0, 1, fix(size(FTD,1)/2)+1)*Fn;
Iv = 1:numel(Fv);
then:
[Amax,idx] = max(abs(FTD(Iv,:))*2);
FreqAtMaxAmplitude = Fv(idx)
producing:
FreqAtMaxAmplitude =
3.161430358886719e-02 9.374618530273438e-02 3.080368041992188e-02
and:
propagation_velocity = 299792458;
lambda = propagation_velocity ./ (2*pi*FreqAtMaxAmplitude)
producing:
lambda =
1.509236205638623e+09 5.089641934579894e+08 1.548952947892271e+09
They definitely appear to be very large. This may be a problem with the units, so check them carefully starting with ‘dt’ (that determines the frequency vector, ‘Fv’) and continuing through all of them.
Thank you very much. I really appreciate
As always, my pleasure!

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

TTA
on 5 Mar 2020

Commented:

on 6 Mar 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!