coherence
result = coherence(A)
Input: A · Output: result
What it is
A is an M×N sensing matrix.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = coherence(A) | A matrixnot documented yet | spectral_coherence —magnitude-squared spectral coherence of two signals | Returns a single number: the largest inner product between any two different normalised columns of A. Small is good. Unrelated to spectral_coherence (magnitude-squared spectral coherence of two signals) in the Signal Processing chapter's Spectral Analysis section — two different functions, two different names. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
A = randn(60, 200, seed = 7) / sqrt(60)
print("coherence {coherence(A):.3f}, provable sparsity {cs_guarantee(A)}")
output
coherence 0.558, provable sparsity 1
from compressed-sensing
How it works
coherence(A) — the largest inner product between two different normalised columns of a compressed-sensing matrix. Pre-existing, single-argument, left untouched. The unrelated DSP two-signal magnitude-squared coherence lives under its own name, spectral_coherence, below — see that arm's comment for why it isn't an overload of this one.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.