# Modulation Decoding Based on K-Means Algorithm for Bit-Patterned Media Recording
## 4 Simulation and Results
\begin{table}
\begin{tabular}{c c} \hline
**Codeword or Initial Centroid** & **Finalized Centroid with Hard Decision** & **Finalized Centroid with Soft Decision** \\ \hline \([+1,+1,-1,-1,-1,-1]\) & \([+0.99,+0.99,-0.95,-0.94,-1.00,-0.99]\) & \([+2.80,+2.79,-2.88,-2.86,-3.95,-3.96]\) \\ \hline \([-1,-1,+1,+1,+1,+1]\) & \([-0.98,-0.97,+1.00,+1.00,+0.99,+0.99]\) & \([-2.77,-2.78,+2.85,+2.83,+3.96,+3.97]\) \\ \hline \([-1,-1,-1,-1,-1,+1,+1]\) & \([-1.00,-1.00,-0.94,-0.95,+0.99,+0.99]\) & \([-3.95,-3.96,-2.87,-2.88,+2.81,+2.78]\) \\ \hline \([+1,+1,+1,+1,+1,-1,-1]\) & \([+0.99,+0.99,+1.00,+1.00,-0.97,-0.98]\) & \([+3.96,+3.97,+2.84,+2.85,-2.79,-2.77]\) \\ \hline \([+1,-1,+1,-1,-1,-1]\) & \([+0.99,-1.00,+1.00,-0.99,-0.89,-0.97]\) & \([+3.81,-2.79,+2.71,-3.90,-2.52,-3.16]\) \\ \hline \([-1,+1,-1,+1,+1,+1]\) & \([-0.99,+0.99,-0.99,+0.99,+0.99]\) & \([-3.80,+2.80,-2.74,+3.86,+2.53,+3.19]\) \\ \hline \([-1,+1,-1,+1,-1,-1]\) & \([-1.00,+0.99,-0.99,+0.99,-0.98,-0.89]\) & \([-2.78,+3.83,-3.91,+2.71,-3.19,-2.52]\) \\ \hline \([+1,-1,+1,-1,+1,+1]\) & \([+0.99,-0.99,+0.99,-0.99,+0.99,+0.99]\) & \([+2.80,-3.80,+3.87,-2.73,+3.21,+2.53]\) \\ \hline \([-1,-1,+1,-1,+1,-1]\) & \([-1.00,-0.98,+1.00,-0.99,+0.99,-1.00]\) & \([-2.53,-3.18,+2.71,-3.91,+3.82,-2.78]\) \\ \hline \([+1,+1,-1,+1,-1,+1]\) & \([+0.99,+0.99,-0.99,+0.99,-1.00]\) & \([+2.55,+3.19,-2.73,+3.88,-3.82,+2.80]\) \\ \hline \([-1,-1,-1,+1,-1,+1]\) & \([+0.99,+0.99,+1.00,-0.99,+0.99,-1.00]\) & \([+3.19,+2.51,-3.89,+2.70,-2.78,+3.82]\) \\ \hline \([-1,+1,-1,-1,+1,-1]\) & \([-0.99,+0.99,-0.99,-1.00,+0.99,-1.00]\) & \([-3.54,+2.41,-2.90,-2.88,+2.40,-3.54]\) \\ \hline \([+1,-1,+1,+1,-1,+1]\) & \([+0.99,-1.00,+1.00,+1.00,-1.00,+0.99]\) & \([+3.57,-2.39,+2.84,+2.84,-2.38,+3.56]\) \\ \hline \([+1,+1,+1,+1,+1,+1]\) & \([+0.99,+0.99,+1.00,+1.00,+0.99,+0.99]\) & \([+2.95,+2.93,+4.01,+4.02,+2.93,+2.93]\) \\ \hline \([-1,-1,-1,-1,-1,-1]\) & \([-0.94,-0.88,-0.99,-0.99,-0.88,-0.94]\) & \([-2.94,-2.92,-4.04,-4.05,-2.91,-2.92]\) \\ \hline \end{tabular}
\end{table} 
Table 3: Centroids of K-means decoder according to hard and soft decision at SNR = 14 dB. Figure 5: Scatter plot of the received sequences and centroids: (**a**) SNR = 6 dB; (**b**) SNR = 14 dB. Consequently, it is difficult to obtain better BER performance using the conventional decoder and the K-means decoder with a hard decision. Thus, a soft decision is required to improve performance using modulation codes. The conventional decoder and the K-means decoder with soft decision performed better than the PRML detector at the same user density. The complexity of the K-means algorithm generally depends on the number of clusters and dimension. Therefore, when the number of codewords and the length of received sequence are increased, the complexity of the decoder based on the K-means algorithm is also increased, and this complexity is higher than that of the conventional decoder based on the Euclidean distance. However, since the original codewords are used to calculate Euclidean distance and the characteristics of data sequences are not fully considered in the conventional decoder, they show worse BER performance than the K-means decoder. Therefore, the K-means decoder with soft decision shows the best performance.