MATLAB: Error: SpatialSmoothing should not be larger than -1 (Phased Array Toolbox)

doaMATLABmicrophone arrayPhased Array System Toolboxsource localization

I'm getting the error below using RootMUSICEstimator. When I set SpatialSmoothing=0 I get the same error. When I set it to -2, the error is 'Expected SpatialSmoothing to be nonnegative'
Error using coder.internal.assert (line 33) The value of SpatialSmoothing should not be larger than -1.
Error in coder.internal.errorIf (line 7) coder.internal.assert(~cond, msgID, varargin{:});
Error in phased.internal.AbstractULADOA/validatePropertiesImpl (line 48) coder.internal.errorIf(cond,'phased:phased:internal:AbstractULADOA:InvalidSpatialSmoothing', M – 2);
Error in phased.internal.AbstractULASubspaceDOA/validatePropertiesImpl (line 59) validatePropertiesImpl@phased.internal.AbstractULADOA(obj);
Error in phased.RootMUSICEstimator/validatePropertiesImpl (line 211) validatePropertiesImpl@phased.internal.AbstractULASubspaceDOA(obj);
Error in Array16 (line 19) ang = rootmusicangle(signal)
Fs=44100;
H = phased.OmnidirectionalMicrophoneElement;
array=phased.UCA('NumElements',16,'Radius',0.15,'Element',H);
rootmusicangle = phased.RootMUSICEstimator('SensorArray',array,...
'OperatingFrequency',Fs,...
'NumSignalsSource','Property','NumSignals',1);
rootmusicangle.ForwardBackwardAveraging = true;
timepoint=[49.6, 49.7];
Fs=44100;
timepoint=timepoint.*Fs;
signal=audioread('E:\Dropbox (MIT)\YilinGuo\16SoundUSB\16SoundUSB-multichannel.wav',timepoint);
ang = rootmusicangle(signal)

Best Answer

Thanks for bringing this to our attention, the error is misleading and we should fix it. The real reason behind the scene is that to use RootMUSIC algorithm on a UCA, the array needs to satisfy certain condition. However, before I going into the details, I have several observations:
1. Looks like you are using a microphone array yet in rootmusicangle, the propagation speed is set to speed of light, so that seems to be incorrect. 2. You set the operating frequency as Fs, but these two are not the same. In fact, it's not clear to me whether your signal is modulated at a carrier. If your signal is indeed unmodulated, then RootMUSIC algorithm is not the right choice and you may need to find some other technqiues to do direction of arrival estimation.
Could you clarify your application and I'd be happy to help identify if there is something in the toolbox that can help.
HTH