HOW DO I GET FREQUENCY AND PHASE ANGLE FROM A WAVE SIGNAL
4 views (last 30 days)
Show older comments
If i have a wave signal data collected at site as below, how can i get the frequency and phase angle from it?
Arrival Time: 0, 0.00013, 0.00025, 0.00038, 0.0005
Amplitude: 0.060643, 0.083724, 0.004865, 0.038468, 0.11925
4 Comments
Answers (2)
Walter Roberson
on 27 Aug 2012
As your times are not uniform, you need a non-uniform discrete fft, sometimes abbreviated nfft and sometimes nufft and sometimes other things.
There does not appear to be any MATLAB routine or any MATLAB File Exchange routine for nfft, but see
0 Comments
Azzi Abdelmalek
on 27 Aug 2012
Edited: Azzi Abdelmalek
on 27 Aug 2012
%your signal don't contain just one frequency

num=xlsread('FileName');t=num(:,1);y=num(:,2);
Y=fft(y);
[wc,w0,a0,ak,bk,c0,ck]=get_harmonics(Y,t(2)-t(1),2)
%the ck contains your frequencies
% wc contains the pulses (rd/s)
stem(wc,abs(ck)) %your Amplitude spectrum
stem(wc,angle(ck)) % your phase spectrum
% get get_harmonics on
3 Comments
Walter Roberson
on 27 Aug 2012
Ron's question implies that the signals are arriving at irregular times, but you seem to be skipping the times in this analysis.
Azzi Abdelmalek
on 27 Aug 2012
Edited: Azzi Abdelmalek
on 28 Aug 2012
Walter, pas is a sample time, and you are right it is not constant. maybe we can interpolate to have a constant sample time. I don't know why the sample time is changing?
pas=min(abs(diff(t)));
t1=min(t):te:max(t);
y1=interp1(t,y,t1)
Y=fft(y);
[wc,w0,a0,ak,bk,c0,ck]=get_harmonics(Y,pas,2)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!