## 3 Simulation Setup  
The simulation was performed using the Matlab Communications Toolbox, which is a standard and widely used tool in the communications community. The simulation's focus is on evaluating the spectral clustering algorithm against nonlinear phase noise, so a sweep was performed using \(-90\), \(-100\), \(-110\) dBc/Hz at 1 MHz offset, simulating a 10 GHz transmission. The measurements were selected from the the state of the art, and the justification for this is given in the Section 5. The phase noise scenarios were applied to three modulations, 16-QAM, 32-QAM, and 64-QAM, to appreciate the effect as the constellation size increases.  
The nonlinear phase noise is accompanied by additive white Gaussian noise (AWGN), which varies the signal-to-noise ratio in the range of 5 dB to 20 dB by observing the behavior in scenarios where the channel is dominated by noise. A summary of the parameters used for the simulation is shown in Table 1. The data generated in Matlab were exported as files and fed as inputs to the k-means and spectral clustering algorithms developed in Python.  
Figure 4: Spectral clustering algorithm with demapping step.  
Figure 5: Relabeling data for demapping. (**a**) Mapping for 16-QAM constellation. (**b**) 16-QAM constellation with noise. (**c**) Demapping of 16-QAM constellation.  
We used a heuristic method to determine the kernel bandwidth value (\(\sigma\)). This involved taking a buffer with low nonlinear noise (16-QAM, 110 dB/Hz) to be processed by spectral clustering. At the same time, we varied the value of sigma until we obtained the appropriate clustering for the chosen buffer. The value found for sigma was equal to 10. We used this previously obtained value to apply spectral clustering to the other modulations. In future work, we will explore how to obtain the kernel bandwidth's value from the data automatically.  
Despite adjusting the value of sigma for spectral clustering with a single modulation format, applying spectral clustering to other modulations yielded promising results, demonstrating that it is a robust algorithm.  
The application of the algorithm is assumed to be downstream of the ADC in the receiver of a real system, so the result of the noise application includes all previous optical stages and the inclusion of electrical noise. Therefore, the plots used for the analysis are the SNR vs. BER (bit error rate) generated in Python as output. The approach presented in this paper will allow us to move towards the real-time implementation of the algorithm on FPGA-based heterogeneous architectures in future work. The implementation of algorithms on FPGAs requires exploring the design space to optimize the architecture, taking into account hardware resources and performance in terms of latency and throughput. The exploration is a non-trivial task that encompasses the design of each part of the architecture, such as memory buffers, parallel processing units, and communication interfaces for data input and output; so, it is a research focus that we will address in future work.  
Since the computational complexity of spectral clustering is \(\mathcal{O}\big{(}n^{3}\big{)}\), which is challenging in this case for high-order modulation schemes like 64-QAM, the idea is to make an analysis in C/C++ code, identifying loops that can be accelerated by applying directives such as pipeline and unroll array partition, among others. The main challenge is to accelerate the calculation of the eigenvectors.