Feature Vector

The feature vector is a list of numbers that describes a signal (or a frame of a signal) in a compact, structured way. Instead of working with thousands of raw samples, we extract a small set of meaningful measurements — the features — and arrange them into a vector. This vector becomes the representation of the signal for further processing, classification, or analysis.

For example, a feature vector for a 25 ms audio frame might look like this:

[0.12, 0.87, −0.34, 2.15, 0.56, ...]

Each number in the vector corresponds to a specific feature — say, the RMS energy, the zero-crossing rate, the spectral centroid, or an MFCC coefficient. The vector as a whole captures a multidimensional description of the signal frame.

Importantly, the feature vector is not the signal itself — it is a representation of it. It discards details that are considered irrelevant for the task at hand and retains only the information that is expected to be useful.

Why Do We Use Feature Vectors?

Raw signals are bulky, redundant, and often contain more information than we actually need. A feature vector solves three practical problems:

  • Dimensionality reduction — Instead of feeding 512 samples into a classifier, we feed 13 or 20 features. This reduces computational cost and memory requirements.
  • Noise robustness — Features are designed to be stable under moderate noise, unlike raw samples which are highly sensitive to it.
  • Interpretability — Features have physical or perceptual meanings (e.g., energy, pitch, brightness), which makes it easier to understand what the system is doing.

Feature vectors are the standard input for most machine learning models in audio processing — from simple classifiers like SVM to deep neural networks.

How Is a Feature Vector Constructed?

The construction of a feature vector typically follows a fixed pipeline:

  1. Framing — The signal is divided into short, overlapping frames (e.g., 20 ms to 40 ms).
  2. Feature extraction — For each frame, a set of features is computed. These can be time-domain features (like RMS, ZCR, STE, crest factor), frequency-domain features (like spectral centroid, spectral flux), or cepstral features (like MFCCs).
  3. Vector assembly — The extracted features are concatenated into a single vector. The order of features is usually fixed, so that every frame produces a vector of the same length.
  4. (Optional) Normalisation — The vector may be scaled or normalised to ensure that all features contribute equally to subsequent processing.

The result is a fixed-length vector that represents that frame. For a whole signal, we get a sequence of feature vectors — one per frame — which can be arranged into a feature matrix or used as input to a sequence model like an LSTM.

Types of Feature Vectors

Feature vectors are not all the same. They differ in what they include and how they are constructed. Here are some common types:

  • Low-level feature vectors — These contain basic acoustic features like RMS energy, ZCR, spectral centroid, and bandwidth. They are cheap to compute and often used as a first-pass description.
  • MFCC vectors — These contain Mel-Frequency Cepstral Coefficients (typically 13 to 40 coefficients per frame). They are the most widely used feature vectors in speech and audio processing because they capture the spectral envelope in a way that approximates human perception.
  • Delta and double-delta vectors — Sometimes the feature vector is extended by adding the first and second derivatives of the features (delta and double-delta coefficients). This adds temporal context to the frame.
  • Concatenated vectors — In some systems, different types of features are concatenated into a single, larger vector. For example, an MFCC vector might be combined with pitch and energy features to form a richer representation.
  • Deep feature vectors — These are produced by the hidden layers of a neural network. They are not hand-crafted but learned from data, and they often capture higher-level abstractions.
Fixed-Length vs. Variable-Length Vectors

Most feature vectors are fixed-length — the number of features is the same for every frame. This is essential for most machine learning algorithms, which expect inputs of a consistent size.

However, some representations are variable-length. For example, a spectrogram frame can have a variable number of frequency bins depending on the FFT size, but this is usually normalised or resampled to a fixed size before being used as a feature vector.

In practice, fixed-length vectors are the norm because they are simpler to work with and are supported by most classifiers and neural network architectures.

Feature Vectors in Practice: GMM and Clustering

Feature vectors are rarely used in isolation. In most practical systems, we collect many feature vectors from different frames and different signals, and we look at how they are distributed in the feature space. One of the most common ways to model this distribution is the Gaussian Mixture Model (GMM).

Imagine we extract MFCC feature vectors from a large number of speech frames. Each vector has 13 dimensions, but we can visualise only two of them at a time. The plot below shows a 2D projection of such vectors — each point is a single frame, and the colour indicates which Gaussian component it belongs to.

Figure 1: 2D projection of MFCC feature vectors (dimensions 1 and 2). Each point represents one audio frame. The colours indicate the GMM component assignment — the model groups similar vectors together, revealing structure in the data.

GMMs are used extensively in speech processing. For example, in speaker identification, a GMM is trained on the feature vectors of a specific speaker. When a new utterance comes in, its feature vectors are compared to the model — the speaker whose GMM gives the highest likelihood is identified as the speaker.

Other models that rely on feature vectors include:

  • Hidden Markov Models (HMMs) — Used in speech recognition to model the temporal evolution of feature vectors over time.
  • Support Vector Machines (SVMs) — Used for classification tasks like music genre recognition or emotion detection.
  • Deep Neural Networks (DNNs) — The input layer of a DNN is simply a feature vector (or a sequence of them).
  • k‑Means Clustering — A simpler algorithm that groups feature vectors into clusters for tasks like vector quantisation.

In all these cases, the feature vector is the fundamental unit of representation — the thing that the model sees and learns from.

Practical Considerations

When working with feature vectors, a few things are worth keeping in mind:

  • Feature scaling — Features often have different ranges (e.g., energy can be large, while ZCR is between 0 and 1). Scaling or normalising the vector is usually necessary for distance-based algorithms and neural networks.
  • Feature selection — Not all features are equally useful. Adding irrelevant features can hurt performance. It is often worth experimenting with different subsets of features.
  • Context — A single feature vector captures only the current frame. For many tasks, the temporal context (neighbouring frames) is equally important. This is why delta features and sequence models are commonly used.
  • Interpretability — One of the strengths of hand-crafted feature vectors is that each component has a clear meaning. This makes debugging and understanding the system much easier than with black-box deep features.

The feature vector is а bridge between the continuous, high-dimensional world of signals and the structured, low-dimensional world of algorithms and models. Understanding what goes into a feature vector — and why — is important for those who work with DSP and audio processing.