I have to write a code that calculates wave height, wave length, and period from bottom mounted pressure gauges in the ocean. I am using a FFT to create a spectral density plot. Where do I go from there?

2 views (last 30 days)
plot(index_DW, pressure_DW, 'b', index_SW, pressure_SW, 'r') %from graph, find cells 8800-9000 average mean Patm=mean(pressure_DW(8800:9000)) rho=1025 %density g=9.81 %gravity deep_z=(pressure_DW-Patm)./rho./g*1000 %deep water elevation plot(deep_z) %about 5m = 16.405ft deep_Z=deep_z(2100:7500) %trim signals, **indices changed date_time_dw=date_time_DW(2100:7500) %trim all signals the same way; sync plot(date_time_dw) plot(date_time_dw,deep_Z) %time/temp
depth_deep=mean(deep_Z) deep_eta=detrend(deep_Z) plot(date_time_dw,deep_eta)
m=length(deep_eta) n=pow2(nextpow2(m)) Fn=fft(deep_eta,n) Fm=fft(deep_eta,m) plot(Fm) figure plot(Fn)
SFn=2.*(Fn.*conj(Fn)) %folds SFm=2.*(Fm.*conj(Fm)) plot(SFn) figure plot(SFm) plot(SFm(1:length(SFm/2))) plot(SFn) figure plot(SFm) %only slight differences between the two SFn and SFm, plotted by indices

Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!