TL;DR
A signal is sparse when most of its entries are exactly zero. A vector with a thousand entries but only five nonzero ones is fully described by five numbers and their positions. Sparsity is why compression works (store only the nonzero part) and why you can take far fewer measurements than the signal length, as long as you recover the signal by searching for the simplest vector that fits the measurements.
Where you'll see it: in transform-based image compression, in compressed sensing MRI and single-pixel cameras, in sparse regression that keeps only a few important features, and in radar or sonar when only a few targets are present.
Intuition
Most of the time, nothing is happening
Think of a recording of one held note in an otherwise quiet room. In the raw time samples, every number is nonzero, because the waveform is always moving. But describe the same sound by which frequencies are present, and only a handful of frequencies (the note and a few overtones) carry any energy. Everything else is essentially zero.
So sparsity is a property of a signal together with a way of describing it. A signal is sparse in a basis when only a few of its coefficients in that basis are nonzero. A pure sine wave that completes five cycles over the recording is dense in the time samples, yet it has one nonzero coefficient in the Fourier basis (plus its mirror image).
Why sparsity helps measuring
Each measurement you take of an -entry vector gives you one number. Normally you need numbers to pin down unknowns. But if you know that only entries are nonzero, you only need to find those values and their positions. The difficulty is that the measurements do not say where the nonzero entries are. You have to search for the sparsest vector that is consistent with what you measured.
Why the search is hard
Finding the sparsest vector by brute force means trying every possible set of positions out of . That is choices, which explodes quickly. The trick that makes sparse recovery practical is replacing the hard count of nonzero entries with a smooth, convex penalty, the L1 norm, which can be solved efficiently.
The math
Definition
A vector is -sparse if at most of its entries are nonzero. Its support is the set of positions where . Its sparsity is the count
Here is the length of the signal and is the number of nonzero entries you allow. The symbol is often called the "zero norm", but it is not a true norm: doubling a vector does not double it, because . It counts, it does not measure length.
Real signals are often not exactly sparse but compressible: sorted by size, their entries decay quickly, so a few large ones carry almost all the energy. The theory below applies to these with a small extra error term.
Measurements as linear equations
We observe a signal through a measurement matrix of size . Each row of is one measurement, and we record
Matrix times vector is the same as taking a weighted sum of the entries of for each row. When , there are many vectors with the same measurements . Sparsity is the extra information that picks out one of them.
Recovery by the sparsest solution
The ideal recovery rule is
It finds the sparsest vector that explains the data, but as noted above it is combinatorial and NP-hard in general.
The convex relaxation
Replace the zero count by the L1 norm, :
This is called basis pursuit. It is a linear program, so standard solvers handle it at realistic sizes. Its success depends on being well behaved. The usual condition is the restricted isometry property (RIP). Say has RIP of order with constant if, for every -sparse vector ,
In words, does not squash any sparse vector close to zero or blow it up. Candès (2008) showed that when , the L1 solution recovers every -sparse exactly. Random Gaussian matrices satisfy this with on the order of rows, which is the sense in which "few measurements" is true.
- |x| (L1 penalty)
- x² (L2 penalty)
flowchart LR A[Sparse signal x, mostly zeros] --> B[Measure: y = A x, m numbers] B --> C[Solve L1 minimization subject to A x = y] C --> D[Recovered x-hat]
Worked examples
Take unknowns and one measurement . Many vectors fit this. We want the one with the smallest L1 norm.
- Every solution has the form for some number .
- Its L1 norm is . Check the three regions:
- For : . This falls from 4 at to 2 at .
- For : , which is above 2 and rising.
- For : , which is above 4.
- The minimum is , at . So , a 1-sparse vector.
- Compare with the L2 rule, which minimises . Setting the derivative to zero gives , so . Its squared length is , and no entry is zero.
- Interpretation: L1 concentrates everything on the one column that explains the measurement, while L2 spreads the answer across both entries.
- L1 norm of every solution (4 - 2t, t)
A sensor array has channels, and at any moment only sources are active. We can afford measurements. A plain linear solve would need . Sparse recovery needs roughly rows, where is a constant that depends on the matrix and the recovery guarantee.
- Compute the scale: , and .
- So .
- The required count is about 27 times a constant, not 1000. With a constant of a few, a few dozen to a hundred measurements is the right order of magnitude.
- Interpretation: the number of measurements depends on how many sources are active and only logarithmically on how many channels exist. The constant is not given by the formula, so the honest statement is a scaling law, not a guarantee for a specific matrix.
Tradeoffs and failure modes
Sparsity is a strong assumption. Use it when it is true in some basis you can name in advance. The usual failure cases are below.
| Situation | Problem | Better choice |
|---|---|---|
| Signal is dense in every basis you have | L1 recovery returns a poor answer | Keep a dense model, use least squares or a Bayesian prior |
| Measurements are noisy | Exact equality constraint is wrong | Noisy recovery (L1 with a residual penalty, the lasso form) |
| Sparsity level is unknown or large | Measurement count grows with | Adaptive or greedy methods, or a larger budget |
| Matrix is a poor design (columns too similar) | RIP fails, recovery can pick the wrong support | Redesign the random or structured measurement matrix |
| You need the exact answer for small | L1 may differ from the true sparsest answer | Exhaustive or mixed-integer search on the support |
Some practical warnings:
- The basis matters more than the algorithm. If you pick the wrong basis, the signal is dense there and no solver rescues it.
- Recovery is exact only under assumptions. Without RIP-type conditions, L1 can return a different sparse vector that fits the data equally well.
- Noise breaks exact zeros. Real measurements almost never give exact zeros in the recovered vector; you threshold, and the threshold is a choice you must justify.
History
In the 1970s, geophysicists trying to recover spike trains from seismic traces found that fitting with the L1 norm gave sparse, interpretable reflectors when least squares smeared them out. Robert Tibshirani's lasso (1996) brought the same penalty into statistics as a way to select variables while fitting a regression. Scott Chen, David Donoho and Michael Saunders named the constrained form basis pursuit in the late 1990s.
The modern theory came in the mid-2000s. Emmanuel Candès, Justin Romberg and Terence Tao, and independently David Donoho, showed that a random measurement matrix with far fewer rows than the signal length can recover a sparse signal exactly by L1 minimization. The field was named compressed sensing. It caught on because it turned an intuition about compressible signals into a precise guarantee, and because it made practical devices possible, such as single-pixel cameras and faster MRI scans.
Check yourself
QuestionA vector is . What is its sparsity , and what is ?Show answer
Two entries are nonzero, so . The L1 norm adds the absolute values of the nonzero entries: . Note that counts entries, while measures size, so the two answers are different kinds of quantity.
QuestionMinimise subject to . Give a minimiser, and say why the answer is not unique.Show answer
Any point with has L1 norm , so every point on the segment from to is a minimiser, for example or . The answer is not unique because along that segment the L1 norm is flat. Adding a small generic perturbation to the problem usually selects a sparse corner, which is why the lasso and basis pursuit often return sparse answers.
QuestionWhy does minimising the L1 norm tend to produce exact zeros, while minimising the squared L2 norm does not?Show answer
The L1 penalty has a kink at zero: its slope is just below zero and just above, so there is a range of optimal values that includes zero. The squared penalty has zero slope at zero, so the optimiser shrinks entries smoothly and rarely lands exactly on zero. The corner in the plot of against is the geometric reason.
QuestionA seismic array has 10,000 channels. Only about 50 are active at once, and you can afford 500 measurements. Is a plain least-squares solve enough, and what do you do instead?Show answer
A plain solve is not enough: with rows and unknowns there are infinitely many exact solutions, and least squares picks one that spreads energy over all channels. Sparse recovery fits the setting: , so 500 rows is plausibly enough, up to the unknown constant. You would solve the L1 minimisation subject to the measurement equations, and check the result against a noisy-measurement version if the data contain noise.
Sources
- Compressed sensing (Wikipedia): https://en.wikipedia.org/wiki/Compressed_sensing
- Lasso (statistics) (Wikipedia): https://en.wikipedia.org/wiki/Lasso_(statistics)
- Boyd and Vandenberghe, Convex Optimization: https://web.stanford.edu/~boyd/cvxbook/