Find wave period and wave amplitude from water tank experiment (regular wave)

An example of using MATLAB to find out the wave period and wave amplitude from experimental data.

Toolbox used in this example (verified in R2015b):

  • Signal Processing Toolbox
f=240; % sampling frequency in Hz
Ts = 1/f;

K = 1.5/0.985; % gain of the amp (voltage to wave height)

period=zeros(1,7);
Amp = zeros(1,7);

for i=1:7
   filename = ['WECnoWind_Wave',num2str(i),'.csv'];
   data = importfile(filename, 12, 15012);
   tmp = detrend(data);
   [p,peaks]=findpeaks(tmp,'MinPeakProminence',(max(tmp)-min(tmp))/4);
   period(i) = mean(diff(peaks))*Ts;
   Amp(i) = mean(p)*K;
end

period
Amp

The files including the importfile.m can be download from regularWaveProcess.zip