Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Generation of a time domain signal from a given power density spectrum?

Solved!
Go to solution
Highlighted

Hi community,

 

I'm trying to generate a time-domain signal "f(t)" from a given power density spectrum (PDS) "S(f)" - code snippet below.PSD_to_time.png

 

My steps are as follows:

  1. Generate the PDS using a function. The function I'm using is a Breitschneider ocean wave spectrum.
  2. Convert the PDS into the time-domain using the method described by Merigaud and Ringwood (link to paper).
  3. Display the time-domain function f(t) on a graph.

The problem I'm having is when I try to take the IFT of the PDS I'm getting "NaN" for all of my values. I've also tried implementing some of the methods described at this link but I get the same problem. I'm hoping that I'm making a silly mistake given that my knowledge of PSD and fourier transforms is lacking.

 

Any help is greatly appreciated,

 

AVD

I accept Kudos and BTC Tips 😄
Address: 1NyXnWf9kdjVzjWcW5w4P1V3b1EY4yXP12
0 Kudos
Message 1 of 2
(447 Views)
Solution
Accepted by topic author AudioVideoDisco

I've just solved my own question thanks to some more searching on the forums so I thought I'd post here in case it can help anyone else.

 

The IFFT wasn't working because my generated PSD input data included a few NaNs (it turns out the Fourier functions don't like NaNs). After removing them my code works. Solution courtesy of this forum post.

 

Thanks forums

I accept Kudos and BTC Tips 😄
Address: 1NyXnWf9kdjVzjWcW5w4P1V3b1EY4yXP12
0 Kudos
Message 2 of 2
(439 Views)