My goal is to take a PSD (g^2/Hz), and generate random time series acceleration data of arbitrary length and sampling rate. As recommended in a different post, I am utilizing phase randomisation, which seems to be working as expected.
The process I'm using is as follows: 1.) Sample the PSD at the desired sampling rate from 0 to F_Max and convert to ASD 2.) zero pad ASD to length N = Total_time(say 5 sec)*Fs 3.) ifftshift 4.) phase randomisation 5.) At this point, I check that Parseval's is satisfied, meaning that the mean_squared_ASD == sum_squared_time_series_accel. 6.) I then run the FFT on the time series data to reconstruct the PSD, which also gives me confidence that the time-series data was scaled appropriately.
Questions that are giving me a bit (lot) of trouble: 1.) How do I know that the time series I've created (should be 0:5 secs), is correct? Parseval's doesn't take into account time duration, so while the amplitude comparison is correct, how do I know I haven't mistakenly extended or compressed time?
2.) For zero padding prior to the IFFT, does it matter if I zeropad the center, vs zeropad the outsides and then call IFFTSHIFT?
I've attached code that should run w/o any dependencies: