# What are the spikes here in the spectral analyser?

I'm learning to use the spectral analyser in Simulink, and tested it with a 500kHz square wave (sampled at 1MHz). When I set the Resolution Bandwidth (RBW) to 700Hz, the plot was beautiful and shows only one spike at 500kHz (the higher frequency harmonics are invisible because the sampling rate is not high enough I suppose).

However, when I set the RBW to auto (Simulink set it to 488.281Hz), there are multiple spikes downwards. I kept most of the default configurations and only tweaked the RBW.

The data in your second graph is between -400dBm and -3400dBm. -400dBm is a power of $$10^{-43}W$$. That's essentially all zeros and what you are looking at here is just residual numerical noise. The negative spikes are simply frequencies where the numerical noise exactly zero and the level in dB of zero is $$-\infty$$. The display needs to cut this off somewhere.
• The frequency resolution of the spectrum analyzer is the sample rate divided by the FFT size. I'm guessing the FFT size is 2048, which makes the resolution indeed 488.28125Hz. We have $488.28 = \frac{10^6}{1024}$ so it is an integer divider. I'm not sure what happens at 600 Hz and how the algorithm exactly implements RBW. Please note that you also have aliasing. You want the sample rate to be larger than twice the highest frequency in the signal. Equal is generally not good enough Jan 19 at 21:04