metocean / wavespectra

MIT License
1 stars 1 forks source link

question about interpolation #24

Open RubendeBruin opened 4 years ago

RubendeBruin commented 4 years ago

I need to combine wave-spectra with vessel RAOs to calculate vessel responses. In order to do so I may need to interpolate the wave-spectrum to a different frequency grid.

I can not find what the exact definition of the spectrum is. Is it defined by

  1. connecting the efth/freq values? afbeelding

or

  1. by energy bins with the centers defined by freq, width by dfarr and height by efth: afbeelding

The code to calculate the spectral energy seems to use 2. But the _interp_freq method seems to assume 1.

If definition 2 is used, then I need to use a slightly different interpolation formula to correctly account for the difference in bin-widths. Tried to sketch it below: afbeelding

For the energy to be conserved when interpolating, the areas A and B need to be identical. This can be done by placing an additional point on the intersection of the bins when interpolating.