Matlab xcorr函数详解
Matlab提供了计算互相关和自相关的函数xcorr函数
1.使用方法
c = xcorr(x,y)
c = xcorr(x)
c = xcorr(x,y,‘option’)
c = xcorr(x,‘option’)
c = xcorr(x,y,maxlags)
c = xcorr(x,maxlags)
c =
xcorr(x,y,maxlags,‘option’)
c =
xcorr(x,maxlags,‘option’)
[c,lags] = xcorr(…)
其中option为:
"biased"为有偏的互相关函数估计;
"unbiased"为无偏的互相关函数估计;
"coeff"为0延时的正规化序列的自相关计算;
"none"为原始的互相关计算
2.特别的:
c=
xcorr(x,‘option’)特指以上某个选项的自相关估计。
c = xcorr(x,y,maxlags)
返回一个延迟范围在[-maxlags,maxlags]的互相关函数序列,输出c的程度为2maxlags+1.
c = xcorr(x,maxlags)
返回一个延迟范围在[-maxlags,maxlags]的自相关函数序列,输出c的程度为2maxlags+1.
c = xcorr(x,y,maxlags,‘option’)
同时指定maxlags和option的互相关计算.
c = xcorr(x,maxlags,‘option’)
同时指定maxlags和option的自相关计算.
3.例子
3.1计算自相关
dt=.1;
t=[0:dt:100];
x=cos(t);
[a,b]=xcorr(x,‘coeff’);
plot(b*dt,a)
3.2计算互相关
dt=.1;
t=[0:dt:1000];
x=cos(t);
y=sin(t);
[a,b]=xcorr(x,y,200,‘coeff’);
plot(b*dt,a)
- Matlab中 pdist 函数详解(各种距离的生成)
- Matlab textread函数详解
- MATLAB view函数详解
- Matlab textread函数详解
- Matlab中pdist 函数详解(各种距离的生成)
- matlab函数详解之“sub2ind”
- AWGN函数详解 (matlab)
- matlab 对于图像操作函数的详解
- 详解Matlab中 sort 函数用法
- Matlab中pdist 函数详解(各种距离的生成)
- Matlab中pdist 函数详解(各种距离的生成)
- Matlab中plot函数及legend函数详解
- MATLAB中plot函数功能详解
- matlab函数详解之“padarray”
- Matlab中处理日期与时间的函数详解
- matlab 的 colormap 函数详解
- Matlab之graythresh()函数详解
- matlab的meshgrid函数详解
- matlab interp2函数详解
- matlab中的ezplot函数详解