均匀随机过程的自相关

信息处理 matlab 自相关 随机过程 静止的 遍历的
2022-02-10 14:09:28

我目前正在学习信号处理的基础知识。

您可能知道,如果您查看随机过程或例如确定性信号,则自相关的定义是不同的

我的问题是关于随机过程的自相关:

假设上均匀分布的随机变量X[0,1]

所以:对于fX(x)=1(0<x<=1)

自相关定义为:rXX(n1,n2)rXX(n1,n2)=E[X(n1)X(n2)]

如果在二阶之前是平稳的,则自相关只是的函数:XτrXX(τ)=E[X(n+τ)X(n)]

如果我在matlab中使用“rand”命令生成这样一个随机变量并计算自相关(这应该是可能的,因为随机过程是遍历的[时间和集合平均值相等])我得到一个看起来更像卷积的奇怪结果概率密度函数。如果我减去平均值,我会得到我期望的结果,因为我假设 X 是不相关的白噪声,所以rXX(τ)=σx2δ(τ)

x=rand(1,100)
Rxx=xcorr(x,x);
subplot(2,1,1)
plot(Rxx);
grid;
title('Autocorrelation function of (X)');

ylabel('Autocorrelation');

y=rand(1,100)-0.5
Ryy=xcorr(y,y);
subplot(2,1,2)
plot(Ryy);
grid;
title('Autocorrelation function of (Y)=(X-0.5) ');

ylabel('Autocorrelation');

两个过程的自相关

所以我的问题是:

(1)我对的假设有误吗?如果是,我们如何计算因为我们不知道连接概率密度函数rXX(τ)=σx2δ(τ)rXX(τ)fX1X2(x1,x2)

(2)为什么第一个计算自相关的结果看起来如此奇怪?(第一个情节)

1个回答

正如建议的那样,我正在添加我的评论作为答案。观测值的样本自相关函数 (ACF)由下式给出n

p^x(m)=n=0Nm1(xnx¯)(xn+mx¯)n=0Nm1(xnx¯)2

To understand why you have a difference between figure 1 and figure 2, lets assume we are looking at observations xn being zero mean. Let be yn=xn+c with c being a constant. Looking now at matlabs help for xcorr for the input yn we get

r(m)=n=0Nm1ynyn+m=n=0Nm1(xn+c)(xn+m+c)

which can be summarized to

n=0Nm1(xnxn+m)+(Nm)c2

In the case of xcorr m equals m=N,...,N. Which means you are adding a triangle to your result.

To calculate the ACF matlab has the autocorr function, which takes care of normalization and demeaning of the input.