K-Means clustering operates on raw IQ samples by randomly initializing K centroids in the complex plane and iteratively refining their positions. Each received symbol is assigned to the nearest centroid based on Euclidean distance, after which centroids are recalculated as the geometric mean of their assigned points. This process converges when centroid movement falls below a threshold, yielding estimated constellation points that directly correspond to the transmitter's symbol map.
Glossary
K-Means Clustering

What is K-Means Clustering?
K-Means clustering is an unsupervised machine learning algorithm that partitions received IQ samples into a predefined number of clusters by iteratively minimizing the within-cluster sum of squares, enabling blind estimation of transmitted constellation points without prior knowledge of the modulation format.
In automatic modulation classification, K-Means serves as a blind centroid estimation technique that reconstructs the constellation geometry without requiring pilot symbols or prior knowledge. The algorithm's performance degrades under phase ambiguity and carrier frequency offset, necessitating preprocessing compensation. The number of clusters K must be specified a priori or determined via validation metrics, making it most effective when the modulation order is approximately known or bounded.
Key Characteristics of K-Means in Signal Processing
K-Means clustering serves as a foundational unsupervised learning technique for partitioning raw IQ samples into distinct groups, enabling the blind estimation of transmitted constellation points without prior knowledge of the modulation scheme.
Centroid Initialization Strategies
The selection of initial cluster centers critically impacts convergence speed and the quality of the recovered constellation. Random initialization can lead to suboptimal local minima, while K-Means++ intelligently spreads initial centroids across the IQ plane to improve consistency. In signal processing, domain-specific initialization using constant modulus pre-scaling or angular histogram peaks often outperforms generic methods by leveraging the geometric structure of digital modulations.
Within-Cluster Sum of Squares (WCSS) Minimization
The core objective function, often called inertia, quantifies the compactness of clusters by summing the squared Euclidean distances between each IQ sample and its assigned centroid. The algorithm iteratively executes two steps:
- Assignment Step: Each sample is assigned to the nearest centroid, forming Voronoi regions.
- Update Step: Centroids are recomputed as the arithmetic mean of all samples in their region. This process monotonically decreases WCSS until convergence, effectively acting as a blind minimum-distance decoder.
Handling Phase Ambiguity and Rotation
A raw K-Means output recovers the relative geometry of the constellation but not its absolute phase orientation. The resulting cluster centers will exhibit an arbitrary fixed rotational offset. This phase ambiguity is typically resolved in post-processing by:
- Computing the fourth-power phase estimator for QPSK-like symmetries.
- Aligning the recovered centroids with a known unique word or pilot sequence.
- Applying differential decoding to render the absolute rotation irrelevant.
Determining the Optimal K Value
The number of clusters K corresponds to the modulation order M (e.g., K=4 for QPSK, K=16 for 16-QAM). When M is unknown, it is estimated using validation metrics:
- Elbow Method: Plotting WCSS against increasing K to identify the point of diminishing returns.
- Silhouette Analysis: Measuring how similar a sample is to its own cluster compared to neighboring clusters.
- Gap Statistic: Comparing the WCSS curve to its expectation under a null reference distribution of the data.
Sensitivity to Noise and Outliers
K-Means is inherently sensitive to additive white Gaussian noise (AWGN) and impulsive outliers because the squared Euclidean distance heavily penalizes large deviations. A single high-noise sample can significantly skew a centroid estimate. Mitigation strategies include:
- Preprocessing with a median filter to suppress impulse noise.
- Using K-Medoids, which selects actual data points as centers, for improved robustness.
- Applying data cleaning to discard samples with an EVM exceeding a statistical threshold before clustering.
Computational Complexity and Real-Time Use
The standard Lloyd's algorithm has a complexity of O(n * K * d * i), where n is the number of IQ samples, d is the dimensionality (2 for IQ data), and i is the number of iterations. For real-time spectrum classification, this can be prohibitive. Acceleration techniques include:
- Mini-batch K-Means, which processes random subsets of samples per iteration.
- Triangle inequality acceleration (Elkan's algorithm) to skip unnecessary distance calculations.
- Hardware implementation on FPGAs using parallel distance computation pipelines.
Frequently Asked Questions
Answers to common questions about applying unsupervised K-Means clustering to blind modulation recognition and constellation estimation in digital communication systems.
K-Means clustering is an unsupervised machine learning algorithm that partitions received IQ samples into a predefined number of clusters by iteratively minimizing the within-cluster sum of squares, enabling blind estimation of the transmitted constellation points. In the context of signal constellation classification, the algorithm treats each received complex baseband sample as a point in the two-dimensional IQ plane and groups these points into K clusters, where K corresponds to the hypothesized modulation order (e.g., K=4 for QPSK, K=16 for 16-QAM). The algorithm alternates between an assignment step, where each IQ sample is assigned to the nearest centroid based on Euclidean distance, and an update step, where each centroid is recalculated as the mean of all samples assigned to it. This process converges when the centroid locations stabilize, yielding estimated constellation point positions that can be compared against a library of ideal reference constellations for modulation identification. Unlike supervised deep learning approaches, K-Means requires no labeled training data, making it valuable for blind modulation recognition in cognitive radio and spectrum monitoring applications where the transmitter's modulation scheme is unknown a priori.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core concepts that interact with K-Means clustering for blind modulation recognition and constellation diagram analysis.
Centroid Estimation
The process of calculating the geometric center of a cluster of received IQ samples, typically by averaging, to estimate the location of the original transmitted constellation point. In K-Means, the algorithm iteratively refines these centroids by minimizing the within-cluster sum of squares (WCSS). Accurate centroid estimation is the direct output of convergence, providing a blind estimate of the transmitted symbol locations without prior knowledge of the modulation format.
Gaussian Mixture Model (GMM)
A probabilistic model that represents the distribution of received IQ samples as a weighted sum of Gaussian components, each corresponding to a constellation point. Unlike K-Means' hard assignment, a GMM provides soft, probabilistic cluster memberships using the Expectation-Maximization (EM) algorithm. This is a direct upgrade over K-Means for modulation classification, as it accounts for the variance of noise clouds around each ideal constellation point.
Minimum Distance Decoding
An optimal detection strategy that classifies a received signal point by selecting the constellation symbol with the smallest Euclidean distance to the observation. K-Means clustering implicitly performs this operation: once centroids are estimated, new incoming symbols are assigned to the nearest centroid. This is the decision-making step that follows clustering, minimizing the probability of symbol error in additive white Gaussian noise (AWGN).
Voronoi Region
The convex polygon surrounding a constellation point that contains all locations in the IQ plane closer to that point than to any other. K-Means partitions the signal space into these regions, defining the decision boundaries for demodulation. The algorithm's convergence effectively constructs a Voronoi tessellation of the complex plane, where each region corresponds to a cluster and its associated centroid.
Error Vector Magnitude (EVM)
A quantitative metric measuring the Euclidean distance between the ideal reference constellation point and the actual received signal point. After K-Means estimates the centroids, EVM can be calculated by comparing each received sample to its assigned centroid. This provides a single figure of merit for modulation fidelity, quantifying the combined impact of noise, interference, and hardware impairments on the recovered constellation.
Blind Equalization
A signal processing technique that recovers the original transmitted constellation from a distorted received signal without requiring a known training sequence. K-Means clustering is a form of blind processing, as it directly partitions the received IQ cloud into clusters. When combined with algorithms like the Constant Modulus Algorithm (CMA), clustering can help initialize equalizer taps or directly estimate the distorted constellation geometry.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us