Converting time domain responses to frequency domain

I am a beginner in FAST and I am modeling the 5MW spar platform and validating the results with the literature.
I got the time domain fully coupled aero-hydro-servo-elastic response. I would like to convert this time-domain result to a frequency domain using MATLAB. To validate, I am starting with conversion of wave elevation in time domain obtained from FAST output, to obtain the frequency domain spectrum (Jonswap Spectrum).
I got the time domain wave elevation correctly but I am not getting the Jonswap spectrum.
I am attaching the time domain and frequency domain pictures.
I will be grateful if you could let me know my mistake.

Dear @Iqbal.Mohammed,

I see a couple problems:

  • Normally the frequency domain is shown as a power spectral density (PSD) rather than just a raw FFT
  • Your frequency discretization is not computed correctly

You can use my script that calculates the PSD directly via FFT without windowing (but with optional binning to smooth the PSD). This script, Jason_PSD.m can be found in the following forum post: User defined spectrum from routine UserWaveSpctrm in HydroDYn - #7 by Jason.Jonkman.

Best regards,