# 相关性和卷积

Signal Processing Toolbox™ 提供了一系列相关性和卷积函数，用于检测信号相似性。确定周期性，找到隐藏在长数据记录中的感兴趣的信号，并测量信号之间的延迟以同步它们。计算线性时不变 (LTI) 系统对输入信号的响应，执行多项式乘法，并执行循环卷积。

## 函数

 `corrcoef` 相关系数 `corrmtx` Data matrix for autocorrelation matrix estimation `xcorr` 互相关 `xcorr2` 2-D cross-correlation `xcov ` 互协方差
 `cconv` Modulo-n circular convolution `conv` 卷积和多项式乘法 `conv2` 二维卷积 `convmtx` Convolution matrix `cov` 协方差 `deconv` 去卷积和多项式除法
 `alignsignals` Align two signals by delaying earliest signal `dtw` Distance between signals using dynamic time warping `edr` Edit distance on real signals `finddelay` Estimate delay(s) between signals `findsignal` Find signal location using similarity search

## 主题

### 常见应用

Find a Signal in a Measurement

Determine if a signal matches a segment of a noisy longer stream of data.

Align Two Simple Signals

Learn to align signals of different lengths using cross-correlation.

Echo Cancelation

Use autocorrelation to filter out an echo from a speech recording.

### 自相关和互相关

Autocorrelation Function of Exponential Sequence

Compute the autocorrelation of an exponential sequence and compare it to the analytic result.

Cross-Correlation of Two Exponential Sequences

Compute the cross-correlation of two exponential sequences and compare it to the analytic result.

Autocorrelation of Moving Average Process

Use filtering to introduce autocorrelation into a white noise process.

Cross-Correlation of Two Moving Average Processes

Find and plot the cross-correlation sequence between two moving average processes.

Cross-Correlation of Delayed Signal in Noise

Use the cross-correlation sequence to detect the time delay in a noise-corrupted sequence.

Cross-Correlation of Phase-Lagged Sine Wave

Use the cross-correlation sequence to estimate the phase lag between two sine waves.