two signal one is original signal i.e. pulses and other is receiving signal with a noise. finding the delay in signal by using the cross correlation.
2 次查看(过去 30 天)
显示 更早的评论
[Rxx,lags]=xcorr(orignal_signal,reciever_signal);
d=finddelay(orignal_signal,reciever_signal);
I want to find the delay in the signal for real time application. so what are the following error and how can we resolve it.
An error occurred while running the simulation and the simulation was terminated
Caused by:
Maximum lag must be an integer. Error in xcorr.m (line 283) coder.internal.assert(maxlag == floor(maxlag), ... Error in xcorr.m (line 87) Error in 'untitled/MATLAB Function' (line 11)
1 个评论
nick
2024-1-2
Kindly share the "original_signal" and "receiver_signal" or the entire code to effectively resolve the issue.
回答(1 个)
William Rose
2024-1-27
The error above occurs if you pass a non-integer scalar value for receiver_signal, because a scalar is interpreted as maxlags, which must be an integer.
Example which demonstrates the error you observed:
N=1000;
origSig=double(rand(1,N)>.05); % x=random sequence of 5% ones and 95% zeros
recSig=5.5;
xcorr(origSig,recSig)
Please show your code to if you need more assistance.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!