This article uses MATLAB R2018b
Set up
1. Open Simulink Library Browser, and enter spectrum in the box 1 to find 2, which is the Spectrum Analyzer.
2. Drag the Spectrum Analyzer to the Simulink simulation interface and double-click the Spectrum Analyzer to pop up the following interface.
3. Now make the Spectrum Analyzer settings (such as the negative half axis of the spectrum).
①Click the icon 1 to display the parameters in the red box 2 on the right, and you can set the parameters according to the figure;
②Pay attention to check the Two sided spectrum in the yellow box 3, and run the simulation to display the negative half axis of the spectrum.
result
Use the Bernoulli binary generator to generate a Bernoulli binary sequence with a rate of 100000bps, and use the Spectrum Analyzer to observe the spectrum of the Bernoulli binary sequence. The result is shown in the figure below.