Hi jks,
Thanks for your advice. I had already fixed (rloss/10) problem. But your advice about log10 works my code. The measured RL value at 24.88 m was 3.59 dB. With Matlab iffft i calculate at 28.8m with 5.263dB. There is still a problem with the values but it is better than former
I uploaded the new iFFT result trace from the data and also the whole code. Hope this help you about time scaling
clear all
clc
close all
format long
fid = fopen('2.txt');
values= fscanf(fid,'%f %f %f \n',[3,inf]);
values = values';fclose(fid);
f = values
,1);
f = f*1e6;
rloss = values
,2);
degree = values
,3);
amp = 10.^(rloss/20);
radian = degree*pi/180;
complex = amp.*exp(i*radian);
GAMMA_F = complex;
figure(1);
plot(f,rloss)
title('Return Loss Frekans')
xlabel('Frekans')
ylabel('Return Loss')
axis([7e8 1e9 -5 0])
%-------------IFFT--------------------------%
NFFT =517;
f1 = 700e6;
f2 = 1000e6;
Fstep = (f2-f1)/(NFFT-1);
dt = 1/(Fstep*(NFFT-1));
t = dt* [0:NFFT-1];
GAMMA_T = ifft(GAMMA_F,NFFT);
RL = 20*log10(abs(GAMMA_T));
%-----------DTF---------------------------%
c = 3e8;
Vf = 0.80;
D = c*Vf*t/2;
figure(2);
plot(D,RL)
title('Distance to Fault')
xlabel('Distance')
ylabel('Return Loss')
axis([0 30 -60 0])
---------- Post added at 15:11 ---------- Previous post was at 15:04 ----------
Jks,
Return Loss is a one port meaurement. The signal travel on the cable to far end and back to the test port. Also the signal propagate in coaxial cable according to its velocity factor. i.e for my measurement the cable velocity factor was 0.8.
The distance measurement in time domain calculated like this formula;
D = c . Vf . t/2
If you measured 16 m coaxial cable you should observe your measurement until 32/(c.Vf) in time domain
Hope this helps