# Simplified Welch Algorithm for Spectrum Monitoring
## 4 Simulations
### Simulation Results  
As it can be seen in Figure 10, FFT samples are generated by \(2\times N_{F}\) delays. In first \(N_{F}\) clocks, the \(N_{F}\) input data of the first segment is arriving and buffered for FFT calculation. In the second \(N_{F}\) clocks, the FFT of the first input is calculated. While the FFT of the first segment is calculating, the input data of the second segment is buffering. This sequence continues and calculates the FFT of input segments in real time by \(2\times N_{F}\) delays for all segments.  
Another important note here is that the generated FFT samples are displayed from \(0\) to \(2\pi\) instead of \(-\pi\) to \(\pi\). To solve this problem, the first half of the FFT samples must be shifted after the second half to recover the standard spectrum centered at the desired frequency.  
After the periodogram values are calculated, they are saved inside the RAM. Each sample is saved in a memory address based on its number in the FFT vector. For example, the 100 th periodogram sample is stored in the register with an address equal to 100 in RAM. The idea for calculating a Welch sample is to perform weighted averaging before saving data in each RAM register. Remember that the counter resets with the \"Data Ready\" pulse, thus, at each moment, the counter value is displaying the corresponding FFT sample number. The output value of the counter is also used to determine the address of this sample inside the RAM. Before overwriting new samples on its related address, the design fetches the previous sample, weighs it with the \(\alpha\) parameter and then adds it to the new generated sample. This idea calculates the Welch value based on the weighted averaging. As time goes on, the samples saved inside the RAM converge to Welch samples.  
Figure 11 displays the convergence of Welch samples to the final spectrum for \(\alpha=0.99\) from the simulation. As it can be seen, two spectra generated during the convergence time are displayed. The first spectrum generated is noisier and displays a spectrum of input data with fewer details. After convergence, the spectrum is completely smooth with considerably less noise.  
Figure 10: Amplitude of FFT samples based on the index number (NFFT = 2048).  
To better understand the performance obtained over the FFT and the effect of the \(\alpha\) parameter on the final spectrum, Figure 12 displays the computed spectrum with a different \(\alpha\). During this test, a CWI with Signal to Interference Ratio SI = R12 dB is added to the transmitted signal. For FFT samples, the peak position of CWI fades in the noise and other frequency components make it barely visible. For the Welch spectrum obtained with \(\alpha=0.25\), the peak is detectable; however, the distance between the maximum peak and the other frequency components is not sufficiently visible and can be misleading for a detector. As the \(\alpha\) parameter increases, the spectrum gets smoother and clearer. For \(\alpha=0.99\), the spectrum is completely smooth, without most of the noise, and the peak appears clearly with a noticeable distance on top of the original signal.  
As is explained here, in the modified version, the \(\alpha\) parameter plays the same role of the averaging number in the original Welch algorithm. The main advantage of using the  
Figure 11: Convergence of Welch samples.  
Figure 12: Welch spectrum obtained with different \(\alpha\) parameters.  
modified version is the simplicity and flexibility of the averaging control. The \(\alpha\) parameter is like a flexible control volume in the user's hand and allows the PSD parameters to be adjusted based on the current situation.