How to compute transfer function (Frequency Response Function) from experimental data

I have a set of data, in the freqeuncy domain, corresponding to a structural test. I have amplitude, phase and frequency for both the measured output and the input signal (accelerations are measured in the test). The input covers the frequency range $5-100 Hz$. I can compute the frequency response:

RE = abs(amplitude)./sqrt(1+(tan(phase)).^2); IM = RE.*tan(phase); response = complex(RE,IM); 

Having the frequency responses of both input and output I could compute the transfer function $H(\omega)$:

H = abs(response)./abs(g_inp); % g_inp is the frequency response of the input 

The problem arises from the fact that the 2 vectors ( response and g_inp ) have not the same length: the first one has 849 samples and the second one 828. How can I 'synchronize' them? EDIT I tried following the zero-padding method as suggested but I do not get the expected plot. Here my code:

% The input signal is a sine-sweep for which I have: % ginz: amplitude of the input signal % finz: frequency of the input signal % Sine sweep in time domain R = 4; tz = 60/R*log2(finz/finz(1)); u_swt = sin(2*pi*((60*finz(1)/(R*log(2.))*(2.^(R/60*tz)-1)))); base_acc_t = ginz.*u_swt; % zero-padding acc_input = [base_acc_t; zeros(N-n,1)]; % N: length output signal (frequency domain) % n: length input signal (frequency domain) input_freq = fft(acc_input); H = abs(response)./abs(input_freq); 

I obtain a plot which has the peak value at the right frequency, but instead of a nice curve it looks really noisy