%FUNCTION [time,signal] = Freq2Time(freq,trans)
%********************************************

function [time,signal]=Freq2Time(freq,trans);
[fm,fn]=size(freq);
if fm < 4,
   error('freq data must be in column format')
end;
[tm,tn]=size(trans);
if tm < 4,
   error('transform data must be in column format')
end;
if ((fm ~= tm) | (fn ~= tn)),
   error('frequency and transform data dimensions must match')
end;

%Reconstruct Full Spectrum from Positive Half
shift=zeros(tm,1);
shift(1:tm-1)=trans(2:tm);
transform=[trans ; conj(flipud(shift))];

%Calculate Inverse Transform and generate time axis
[tm,tn]=size(transform);
N=tm;
signal = ifft(transform) ;
fs=freq(2)-freq(1);
dt=1/(fs*N);
time = (0:(N-1))'*dt ;

[m,n]=size(time);
signal=(m/2)*signal;
