function [ imp_resp, freq_resp] = analyzeImpResp( signal, sensor_data ,kgrid)
p0=2*10^(-5);
%deconvolution
points_amount=length(sensor_data.p(:,1));
record_length=length(sensor_data.p(1,:));
source_ref=flip(signal);

imp_resp_tr(1,:)=conv(source_ref, sensor_data.p(1,:));
imp_resp.schroeder_log(1:points_amount,1:length(imp_resp_tr(1,:)))=-100;

for i=1:points_amount
% impulse response
imp_resp.imp_resp(i,:)=conv(source_ref, sensor_data.p(i,:));
imp_resp.t_array(i,:)=0:kgrid.dt:kgrid.dt*length(imp_resp.imp_resp)-kgrid.dt;


%frequency response in dB
[A,B,C]=(spect(imp_resp.imp_resp(i,:), 1/kgrid.dt));
freq_resp.f_array(i,:)=A;
freq_resp.freq_resp_lin(i,:)=B;
freq_resp.freq_resp(i,:)=20*log10(B/p0);
freq_resp.phase_resp(i,:)=C; 
impulse=imp_resp.imp_resp(i,:);
%schroder backward integration
[schroeder_log, EDT, RT20 ] = RT_backward( impulse, kgrid );
imp_resp.schroeder_log(i,1:length(schroeder_log(1,:)))=schroeder_log;
imp_resp.EDT(i,:)=EDT;
imp_resp.RT20(i,:)=RT20;
%imp_resp.RT30=RT30;

end

end