How to generate a time signal from spectrum

조회 수: 19 (최근 30일)
Alessandro Antonini
Alessandro Antonini 2013년 1월 7일
편집: Walter Roberson 2024년 8월 9일
Hello,
I'm working on spectrum comes from sea wave data. I have a JONSWAP spectrum and I need to generate a signal in time domain to fed my numerical model of a floating body, can anybody suggest me how do it.
  댓글 수: 1
Mirlan Karimov
Mirlan Karimov 2018년 2월 5일
If you could get any result please share it with me via mirlankarimov@hotmail.com I am working on the same problem

댓글을 달려면 로그인하십시오.

답변 (2개)

Abhishek Ballaney
Abhishek Ballaney 2018년 2월 6일
편집: Walter Roberson 2024년 8월 9일

Isaac
Isaac 2024년 8월 9일
If you have a power spectral density function (PSD), and not a fourier series of the Jonswap then you can't just take an ifft of the spectrum because it is a measure of energy of a frequency band (m^2/Hz), and it no longer has any phase information.
This function will generate a timeseries from a PSD based on equations 8 and 9 in Tabeshpour, 2023. It uses the rand() function to add back in phase, so it will generate a different result each time it is run. If you require preserveing a time series, you can save the rand seed in MATLAB by using rng() (see https://www.mathworks.com/help/matlab/ref/rng.html?searchHighlight=rng&s_tid=srchtitle_support_results_1_rng)
function [t,wave] = PSD_Time(df,Sj)
% Method derived from:
% Tabeshpour, M. R., & Belvasi, N. (2023). Ocean waves
% time-series generation: minimum required artificial wave time-series
% for wave energy converter analysis. Journal of Marine Engineering &
% Technology, 22(6), 273–283. https://doi.org/10.1080/20464177.2023.2197280
l=length(Sj);
t=linspace(0,df^-1,l);%generate output time vector
di=rand(1,l)*2*pi;%random phase angle generation
wi=[df:df:df*l]*2*pi;%Angular frequency
ai=sqrt(2*Sj*df);%Cos wave amplitudes
ni=ai.*cos(wi.*t'+di);%Matrix of all Cos waves
wave=sum(ni,2)';%Add Cos waves together
end

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by