%clear;clc;
function [vv1,vv2,tt1,tt2]=dokt_ir2int2mx(IR1,IR2,fs,bit,k,OFFS,TWIN)
%OFFS=0;
%TWIN=3*14;
%k=0.5;

%[IR1,fs,bit]=wavread('C:\HIL\LisztZeneakademia_Nagyterem\Impulse\z_5_R_c1_i.wav'); 
%[IR2,fs,bit]=wavread('C:\HIL\LisztZeneakademia_Nagyterem\Impulse\z_21_R_c1_i.wav'); 

[tt1,tt2]=dokt_timescale(IR1,IR2,fs,bit);
tt1=tt1+OFFS;tt2=tt2+OFFS;

vv1=NaN(TWIN,length(tt1));vv2=NaN(TWIN,length(tt2));
for i=1:length(tt1)-1,
  vv1(:,i)=IR1(tt1(i+1)-round(TWIN/2)+1:tt1(i+1)+round(TWIN/2));
end;
for i=1:length(tt2)-1,
  vv2(:,i)=IR2(tt2(i+1)-round(TWIN/2)+1:tt2(i+1)+round(TWIN/2));
end;

% reflexiók ábrázolása
% plot(IR1(1:4000)); hold all; 
% for i=1:length(tt1)-1, plot(tt1(i+1)-round(TWIN/2)+1:tt1(i+1)+round(TWIN/2),vv1(:,i),'r'); end; hold off;

%L=length(tt1);
%for i=2:L,
%ujhossz(i-1)=round(k*(tt1(i)-tt1(i-1))+(1-k)*(tt2(i)-tt2(i-1))); end;