From frequency to time domain

I have the function S, representing the sea elevation spectrum in frequency domain.
S= 300x365 , being the spectra for 365 days in 300 frequency timestep.
I want to translate the function to time domain, simulating S for every second in a day (86400s).
How can I implement this?
thank you in advance.

 Accepted Answer

If I understand what you are asking for correctly I am assuming that your matrix S has the fft of the original time domain data.
I think you could then recover it and interpolate to get data for every second in the day using:
% make time vector for original spacing (300 samples per day)
t = linspace(0,86400-1,300);
% recover time domain signal
X = ifft(S);
% interpolate intermediate values
tq = 0:86400-1;
Xq = interp1(t,X,tq)

3 Comments

Jon
Jon on 17 Feb 2022
Edited: Jon on 17 Feb 2022
Alternatively, to do the interpolation, I think you could insert zeros appropriately into the spectrum and then do the ifft, but I'd have to think about the details of how that is done.
Thank you for your answer. My problem was that the spectrum is not directly derived by an fft but you provide me a feasible solution.
Glad that you were able to make progress

Sign in to comment.

More Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Products

Release

R2020a

Asked:

on 17 Feb 2022

Commented:

Jon
on 18 Feb 2022

Community Treasure Hunt

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

Start Hunting!