wecopttool.core.fd_to_td
- fd_to_td(fd, f1=None, nfreq=None, nsubsteps=1, zero_freq=True)[source]
Convert a complex array of Fourier coefficients to a real array of time-domain responses.
The input is a complex 2D array with each column containing the Fourier coefficients for some response. Columns are length
nfreq+1, and the first row corresponds to the real-valued zero-frequency (mean, DC) components. The entries of a column representing a responsexarex=[X0, X1, ..., Xn].Returns a real array with same number of columns and
2*nfreqrows, containing the time-domain response at timeswecopttool.time(f1, nfreq, nsubsteps=1). The imaginary component of the highest frequency (the 2-point wave) is excluded, as it will always evaluate to zero.If both
f1andnfreqare provided, it uses the time matrixwecopttool.time_mat(f1, nfreq, nsubsteps=1), else it uses the inverse real FFT (numpy.fft.irfft()).If
zero_freq = False(not default), the mean (DC) componentX0is excluded, and the matrix/vector length is reduced by 1.Opposite of
wecopttool.td_to_fd().- Parameters:
fd (ArrayLike) – Array containing the complex Fourier coefficients.
f1 (float | None) – Fundamental frequency
f1[\(Hz\)].nfreq (int | None) – Number of frequencies.
nsubsteps (int) – Number of steps between the default (implied) time steps. A value of
1corresponds to the default step length.zero_freq (bool | None) – Whether the mean (DC) component is included.
- Raises:
ValueError – If only one of
f1ornfreqis provided. Must provide both or neither.- Return type: