📄 correlations.m
字号:
%CORRELATIONS Input/output auto/cross-correlation.% [RXX, RYY, RXY, L] = CORRELATIONS(X,Y,Dmax,Nb,Nw) %returns the input autocorrelation matrix RXX, the output autocorrelation % matrix RYY, and the input-output cross-correlation vector RXY of size 2L+1. % L is calculated so that the cross-correlation matrix of a delayed X and Y% can be generated from RXY. The delay of X has to be smaller than Dmax.% X is the transmitted data vector.% Y is the received data vector(including the channel noise). % Dmax is the maximum allowed delay.% Nb and Nw are the tap sizes of the target impulse response and the time domain equalizer, respectively.function [Rxx,Ryy,rxy,L] = correlations(x,y,maxDelay,Nb,Nw)% size of rxy should be big enough to generate cross correlation matrices for delays up to maxDelayL = max([maxDelay+Nb Nw]);% calculate the input autocorrelation vector of size Nbrxx = xcorr(x,x,Nb,'unbiased');% form a toeplitz matrix of size Nb x NbRxx = toeplitz(rxx(Nb+1+(0:Nb-1)));% calculate the output autocorrelation vector of size Nwryy = xcorr(y,y,Nw,'unbiased');% form a toeplitz matrix of size Nw x NwRyy = toeplitz(ryy(Nw+1+(0:Nw-1)));% calculate the input-output cross-correlation of size Lrxy = xcorr(x,y,L,'unbiased');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -