Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

04-03-2019 12:55 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

My steps are as follows:

- Generate the PDS using a function. The function I'm using is a Breitschneider ocean wave spectrum.
- Convert the PDS into the time-domain using the method described by Merigaud and Ringwood (link to paper).
- 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

Address: 1NyXnWf9kdjVzjWcW5w4P1V3b1EY4yXP12

Solved! Go to Solution.

Solution

Accepted by topic author AudioVideoDisco

04-03-2019 01:30 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

Address: 1NyXnWf9kdjVzjWcW5w4P1V3b1EY4yXP12