From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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

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

Download All
0 Kudos
Message 1 of 2
(2,489 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

0 Kudos
Message 2 of 2
(2,481 Views)