MATLAB: How to calculate and plot power spectral density of a white noise signal

fast fourier transformfftMATLABpower spectrum densitypsdwhite noise

I want to ultimately find out how many bits are necessary to quantify noise of a signal. I'm working with this source code to generate a noisy white signal, and I know that taking the FFT to find the power spectral density (PSD) will allow me to then quantify voltage noise in the signal per rtHz or noise power per Hz.
When I run the code, I end up getting plots that look like this:
I've never worked with FFTs or PSDs before, and I'm only looking into them to answer my main question of how many bits I need to quantify a noise signal. As a result, I don't know how to discern what my PSD is by looking at these graphs. Is it the bandwidth? The average? I really am not sure.
Thanks.

Best Answer

Hi Sean,
The Power spectral density of a signal gives the Signal Power for the (at each) frequencies over the band. Since you are modelling a white noise for a specified bandwidth (by the ‘bandwidth variable), you get a nearly flat Absolute Noise power (the power shown in figure is reported in dB) over the band.
To quantify the number of bits required, you can use the dynamic range of the ‘noise’ variable to get the approximate estimate.
Hope this Helps.
Kiran Felix Robert