首页 文章

Matlab互相关与相关系数问题

提问于
浏览
1

我'm writing a program in C++ but using data from matlab involving Cross Correlation. I understand that when I do a correlation on 2 sets of data it gives me a single correlation coefficient number indicating if they are related. But I'我想在 data series 上使用互相关 . 当我在Matlab上运行Cross Correlation时,它给了我很多数据,当绘制时,绘图看起来像一个三角形......我理解相关应该介于/ - 1之间,但是朝向三角形尖端的数据不会同时上升等等 . 我是否对Cross Correlation给出的内容感到困惑,或者Cross Correlation给出的数据实际上是每个点s(t),p(t)的相关系数?任何澄清的帮助表示赞赏 .

Edit 1 (after Phonon's Response)

我的主要问题是:当我交叉关联2个数据系列时,我得到的数据是每个点的相关系数 . 例如,(0,10)和(0,8);数据是否在x = 0时获得了这两个图的相关系数?

2 回答

  • 0

    在Matlab中, xcorr(x,x) 给出了信号x的自相关 . 它没有缩放,它只是信号内部产品的矢量,具有自身的移位版本 . 要缩放它,请使用 xcorr(x,x,'coeff') . 此命令将通过信号's energy (in other words it will divide each coefficient by value of coefficient at zero lag). Note that when you'进行互相关, xcorr(x,y'coeff') 来缩放您的自相关,您将不会得到值1和零延迟,因为缩放的执行方式不同 . 如果你将信号与自身相关联,它只会是1(我希望SO支持数学公式,以便我可以为你写出来) .

  • 1

    你可能想要corrcoef,而不是 xcorr .

相关问题