% close all
function delayed_signal = LTS2_Delay(signal,fs,delay_sec)

nfft = 2^nextpow2(2*length(signal));
Sfft = fft(signal,nfft);
vfc_pos = linspace(0,fs/2,nfft/2+1);
vfc_neg = -fliplr(vfc_pos(2:end-1));
vfc = [vfc_pos,vfc_neg]';
delayvector = exp(-1i*2*pi*vfc*delay_sec);
Sfft = delayvector.*Sfft;
delayed_signal = real(ifft(Sfft,nfft));
delayed_signal = delayed_signal(1:length(signal)); 

end
