Hello everyone!! I am really struggling with this, been trying different examples and methods but still can't get it right. Will appreciate anyone who could tell me a method to do it or any useful tips.. It is regarding delay time.. I created a Signal and a delayed version of the signal, also I plotted the correlated version of the two signals and I meant to be able to see it from the correlated graph the delayed time and calculate it.. I am not sure how can I find the delay time?? I found "Align Signals" from the communication toolbox and I read the documentation about it and it's exactly what I am looking for, I obtained the toolbox but unfortunately they use diagrams and channels as graphs and it is not what I am looking for, I want a way to calculate it?
N=1024; % Number of samples
f1=1; % Frequency of the sinewave
FS=200; % Sampling Frequency
n=0:N-1; % Sample index numbers
x=sin(2*pi*f1*n/FS); % Generate the signal, x(n)
t=[1:N]*(1/FS); % Prepare a time axis
subplot(3,1,1); % Prepare the figure
plot(t,x); % Plot x(n)
title('Sinwave of frequency 1000Hz [FS=8000Hz]'); xlabel('Time, [s]'); ylabel('Amplitude'); grid;%Delayed version of the Signal..
D = -4;y=(sin(2*pi*f1*n/FS))-D; % Generate the signal, x(n)t=[1:N]*(1/FS); % Prepare a time axis subplot(3,1,2); % Prepare the figureplot(t,y); % Plot x(n)title('Sinwave the delayed version [FS=8000Hz]');xlabel('Time, [s]');ylabel('Amplitude');grid;%Correlation between the two Signals..
Rxx=xcorr(x,y); % Estimate its autocorrelation
subplot(3,1,3); % Prepare the figureplot(Rxx); % Plot the autocorrelation
grid;title('Correlation between the Signal and the Delayed version !');xlable('lags');ylabel('Autocorrelation');
Best Answer