Cross-Correlation between signal and the delay version
1 view (last 30 days)
Show older comments
Hi everyone. I have an OFDM signal and I simulated my feedback signal with delay version of input signal. So now I want to calculate the amount of delay. I know we can do it with matlab function xcorr but I want to do it with FIR filter which the coefficients are the reverse of input signal. I calculate with both Xcorr function and with FIR filter but the FIR filter answer is not correct!!!!!!!!!! what can I do? Please help me guys. Here is my code:
T = (7e-6/64)/2;
Fs = 1/T;
ofdm_symbol = func_ofdm_generate('16qam', '8k', 1/32, 1);
x = abs(ofdm_symbol)/max(abs(ofdm_symbol)) .* exp(j*phase(ofdm_symbol));
R_input = real(x);
I_input = imag(x);
h = dfilt.delay(5); %make delay version
FB = filter(h,x);
R_FB = real(FB);
I_FB = imag(FB);
xcorr_signal=filter(conj(R_input(64:-1:1)),1,R_FB(1:1:64));
%D = finddelay(R_input,R_FB);
K=xcorr(R_input(1:64),R_FB(1:64));%calculate by matlab function
delay1 = 64-(find(K==max(K)));
delay2 = 64-(find(xcorr_signal==max(xcorr_signal)));
Best Regards,
Arash
0 Comments
Answers (0)
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!