A=[1 -0.75];
B=[0.125 0.125];
c=340;  % m/s
fs=44100; % Hz

X1 = 6; X2 = 4; Y1 = 2; Y2 = 4;
    
    % Direktschall
d0=Y2;
delay=round(d0/c*fs);
out0 = [zeros(delay,1); in];
%out0 = in;   

    % erste Reflexion (nach hinten)
d=Y2+Y1+Y1;
delay=round(d/c*fs);
out1 = [zeros(delay,1); in];
out1 = filter(B,A,out1);
out1 = out1*(d0/d);

    % zweite Reflexion (nach rechts)
x=X2; y=Y2/2;
d=2*sqrt(x*x+y*y);
delay=round(d/c*fs);
out2 = [zeros(delay,1); in];
out2 = filter(B,A,out2);
out2 = out2*(d0/d);

    % dritte Reflexion
x=X1; y=Y2/2;
d=sqrt(x*x+y*y);
delay=round(d/c*fs);
out3 = [zeros(delay,1); in];
out3 = filter(B,A,out3);
out3 = out3*(d0/d);

    % Signale zusammenfügen
len=max([length(out1); length(out2); length(out3);]);
out0=[out0; zeros(len+1-length(out0),1)];
out1=[out1; zeros(len+1-length(out1),1)];
out2=[out2; zeros(len+1-length(out2),1)];
out3=[out3; zeros(len+1-length(out3),1)];
out=out0+out1+out2+out3;
