Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help for iFFT in Matlab

Status
Not open for further replies.
thanks for prompt reply,
here is the matlab program and data attached
clc
angle =degree ; %calling phase angel
amp = 10.^(RL/20); % converting reflection loss from dB to linear
radian = angle*pi/180; % converting theta to radian
RLCF = amp.*exp(1i*radian); % combining the real and imaginary part
z=abs(RLCF);
figure;
plot(freq,z);% frequency domain plot
title ('frequency domain plot')
c_speed=3e8;
N =length(RL);
f1 = 30e6;% starting frequency
f2 = 190e6;% final frequency
deltaF = (f2-f1)/(N-1); % sampling frequency
dt = 1/(deltaF*(N-1));% sampling time
t = dt*(0:N-1); % total time
distance = c_speed.*t; % for plot in distance domain
RLCT =ifft(RLCF,N);% inverse of frequency domain data of reflectin loss
RLT = 20*log10(RLCT);% dB conversin of reflectionloss data in time domain
figure;
plot(t,RLT);
title ('time domain plot');
figure;
plot(distance,RLT);

I am not getting the proper scale of time : as I am using a co axial line of 16m , using the free space propagation of 3e8m/sec we get time to reach the signal at end is 53.33e-9 sec, but i am not getting this time.
Please advice
thanks again
 

Attachments

  • dtf.rar
    6.5 KB · Views: 114

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
 
Last edited:
  • Like
Reactions: jks

    jks

    Points: 2
    Helpful Answer Positive Rating
hello cmd,
thanks a lot for DTF explanation that really helped me and same has been confirmed from Agilent data sheet cp.literature.agilent.com/litweb/pdf/5989-5723EN.pdf and also the from the Anritsu distance to fault application note . In my case Vf = 1.

Further to that for your case the cause difference in the RL values is explained in the above mentioned Agilent data sheet on page no. 7.
thanks again
 

hi
I want to perform gating in time or distance domain and then to plot the the gated data in frequency domain.
any Idea to implement it in matlab
thanks
 

hi all
any Idea about filtering the time domain data, I think i can apply a window but i dont know how to specify the start time and stop time for window.
please reply
 

Hi jks,
i also dont have any idea about windowing. With my code i locate the fault at the same position with anritsu cable analyzer, but return loss values have some differences from the anritsu's results. You said that agilent explained that but it doesn't contain enoug information.
I uploaded Anritsu's and MATLAB graph's;


The return loss value of first connector is matched with the analyzer results but the other peaks have 2-3db differences. Why is it so?
 

Do you have any idea about this return loss value difference?
 

hello cmd
if you want to try windowing then its easy to apply here is the way

consider your time series as Xn, n=0,1,.......N-1
get a window coefficient as Wn , n=0,1,.......N-1
then Xn*Wn will be the windowed time series

you can get some window like Hanning , hamming kaiser etc (easily design in matlab )

hamming window W=0.54-046*cos(2*pi*(0:M-1)'/(M-1));

you can take the length of window as same as length of your time data series.
hope this will help you
 

Hello,

I have also 300 points vector impedance values in the frequency domain. It's part (z11) of frequency dependent (dimension:(6,6,300)) matrix of high-voltage three-phase XLPE underground cable in range from 10 Hz to 1 MHz. Each phase cable has own sheath and consequently impedance matrix has 6x6 dimension.
My objective is convert this impedance vector in time domain but - time simulation is determined: t=0.003 sec.
Therefore I used frequency step deltaf=1/3*1e+04 Hz (f: 10: 1/3*1e+04 : 1e+06 Hz) in determination of Z(omega).
In attachment you can find Zcca.mat (MATLAB mat file and simple Zcca.txt with impedance vector I must convert into a time domain.

My questions are:
1. How I can convert this impedance vector into 0:0.003 sec time period?
2. Have I choose correct frequency step (1/3*1e+04 Hz) in Z(omega) calculation? If it's not correct, which one I have to use?

MATLAB ifft code in .m file ar simple listing in answer would be highly appreciated!

Thanks in advance
 

Attachments

  • Zcca.zip
    10.4 KB · Views: 110

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top