MATLAB: How to convert < FDTD> voltage to Frequency domain

transmission line

Hello, if anyone can help me I would be grateful, I have a text file of FDTD voltage values in time domain I would like to convert it in the frequency domain. Any ideas?. Thank you in Advance. PS: the 1st column is the time and the other columns are the voltage values.

Best Answer

This works:
D = load('Lamiae Lammy VNE.txt');
t = D(:,1); % Original Time Vector
v = D(:,2:end); % Original Voltage Matrix
L = size(t,1); % Date Length
tr = linspace(min(t), max(t), L); % Time Vector For Reseampling
vr = resample(v, tr); % Resampled Voltages
Ts = tr(2)-tr(1); % Sampling Time
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
FTvr = fft(vr)/L; % Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
figure(1)
plot(Fv, abs(FTvr(Iv,1))*2, '-b')
hold on
plot(Fv, abs(FTvr(Iv,2))*2, '--r')
plot(Fv, abs(FTvr(Iv,3))*2, ':g')
hold off
grid
axis([0 10 ylim])