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.

6 Ansichten (letzte 30 Tage)
[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)

Antworten (1)

William Rose
William Rose am 27 Jan. 2024
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)
Error using matlab.internal.math.parseXcorrOptions
Maximum lag must be an integer.

Error in xcorr (line 72)
matlab.internal.math.parseXcorrOptions(varargin{:});
Please show your code to if you need more assistance.

Kategorien

Mehr zu Signal Generation and Preprocessing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by