## 4 Results and Discussion
### Block Size and Complexity Analysis  
The proposed HBC algorithm, as already mentioned, can be regarded as a non-iterative density based clustering algorithm. The fact of not requiring iteration was of particular importance for real-time operation since, in principle, it implies a fixed processing time. The performance of the algorithm, however, depended on the block size employed to estimate the histogram. To evaluate the minimum block size requirement, Figure 5 shows the BER in terms of the block size. As can be seen after a short erratic initial stage, the BER decreased, getting a relatively stable value for block sizes longer than 13,000. The evaluation of the performance for small block sizes was especially difficult because of the high variance consequence of the stochastic nature of the method. We observed that the variance of the BER reduced as the block size increased, as was expected for unbiased statistics. For this reason, to achieve a trade-off between accuracy and processing time, the data shown in Figure 5 were obtained by averaging results for a variable number of runs, up to 100 for 1000 symbol block size and five for 16,000 symbol blocks. In fact, we perceived that when applying HBC for short block sizes, for certain sets of data, the algorithm did not converge to a reasonable partition. In order to quantify this effect, for each block size, we counted the number of runs that failed, and we calculated the efficiency as the percentage of runs that led to an acceptable classification. This region of forbidden block size that, according to Figure 5, spanned up to 2250, should then be avoided to get an acceptable performance. In fact, for applications requiring low latency, we can choose the minimum size of 2250, whereas when latency is not so critical, a higher number of symbols can be employed. Another important point to discuss is the complexity of the proposed algorithm. In order to evaluate it, we can split the algorithm into two main steps: on the one hand, a first stage when the 2D histogram was built and the high density points were found and, on the other hand, the stage when each point was associated with a certain cluster. The histogram can be built in different ways, so it was expected to be machine dependent. A possible solution was, for instance, to find the indexes of the bins for each symbol and, then, update the value of the corresponding bin. That is, assuming that we had \(N_{b}\) bins and that the maximum and the minimum of the histogram were \(M\) and \(m\), the indexes corresponding to the kth complex symbol \(s[k]=s_{i}[k]+j\cdot s_{q}[k]\) were:  
\[ind_{i}[k]=\frac{N_{b}+1}{M-m}\cdot\left(s_{i}[k]-m\right)\text{ and }ind_{q}[k]=\frac{N_{b}+1}{M-m}\cdot\left(s_{q}[k]-m\right). \tag{1}\]  
Once the indexes were found, the count of the bin indicated by \(ind_{i}\) and \(ind_{q}\), \(n_{count}^{k-1}\) was updated. Hence:  
\[n_{count}^{k}(ind_{i},ind_{q})=n_{count}^{k-1}(ind_{i},ind_{q})+1. \tag{2}\]  
Figure 4: Analysis of the decision regions (data are for a launch optical power of 10 mW). (**a**) Histogram of the received constellation. (**b**) Rectangular shaped decision regions obtained using maximum likelihood. (**c**) Linear decision regions after k-means clustering and (**d**) after HBC. In (**b–d**), the received constellations are superimposed on the decision regions. In addition, for all cases, we included a detailed section of the lower left constellation, corresponding to the white rectangle in (**a**). Therefore, in this first stage, the processing of each symbol required five floating-point operations (two to calculate \(ind_{i}\), two to calculate \(ind_{q}\), and another one to update the bin count). In order to build the histogram of a block of \(N_{sym}\) symbols, the total number of FLOPs was then \(5\cdot N_{sym}\), and in conclusion, its complexity was \(\mathcal{O}(N_{sym})\). The finding of the high density points required the sorting of the values of all bins, that is the sorting of \(N_{b}^{2}\) points.