Hi Amelia,
I understand that you want to reconstruct a signal from its Power Spectral Density (PSD). This can be a little tricky because reconstructing a signal frequires both magnitude and the phase information. However, PSD only provides the magnitude information and not phase.
If available, you can use the phase from the original FFT. For more details you can refer to the following related MATLAB Answer:
Alternatively, you can generate a random phase, but this will not reconstruct the original signal accurately.
Additionally, ensure that the complex spectrum obtained after combining magnitude and phase is symmetric, as the inverse FFT assumes a symmetric spectrum for real-valued signals.
I hope it helps!
