MATLAB: How to provide PMUSIC function an autocorrelation matrix

autocorrelationdspfmcwmusicPhased Array System Toolboxpmusic

I have system of phased array antenna with 12 receivers as shown below,
for every antenna element I am creating a range doppler matrix using multiple FMCW chirps. Then the value of range doppler cell for specific range is taken and placed in an array of 12 elements. Now I have 12X1 values of same range doppler but different antenna elements.
In order to obtain the angle information I am using the pmusic function. The input data vector of 12X1 dimension is named as rdSnapShot. In order to provide music algorithm function an autocorrelation matrix, I have used definition E[x*x']
nTargets = 2;
Rxx_outerproduct = rdSnapShot*rdSnapShot';
[powerSpectrumMUSIC,idxFreq] =pmusic(Rxx_outerproduct ,nTargets,'corr');
% Adjusting the frequency for zero centered angle
idxFreq = idxFreq - max(idxFreq)./2;
% Shifting the response to obtain zero centeric response
powerSpectrumMUSIC=(powerSpectrumMUSIC);
% Converting the frequency scale to direction of arrival scale
idxAngle = asind(idxFreq/pi);
angResponseMUSIC = (db(powerSpectrumMUSIC));
The result what I am getting is not as expected, being already informed that there can be number of reasons, my intention here is to verify that the flow I am taking is valid and the autocorrelation matrix needed for pmusic is correctly formed.

Best Answer

Your equation looks fine, but if you only has one 12-element vector for the data, then the algorithm cannot work properly because you don't have enough snapshots do get a good estimate of the covariance matrix. In fact, if you only have one vector, then the rank of the matrix will be one. In general, you need the number of snapshots to be at least twice of the number of elements. And if you want a good estimate, 5 times might be more appropriate.
BTW, if you have access to Phaed Array System Toolbox, you may want to check out the function musicdoa or object phased.MUSICEstimator
HTH