
%import audio
[x,Fs] = audioread('impuls.wav');

%delay in feedback path
d = 1


%feedback delay coefficient
a= 0.75; 


%length of input in samples
N = length(x);
y = zeros(N,1);

%indexing every element for output
for n = 1:N
    
    %comparing length of file with length of sample delay
    if n < d+1
            %output = input
            y(n,1) = x(n,1);
    %adding delayed signal
    else
        %output = input + delayed version of input
        %changing the relative amplitude with a
        y(n,1) = x(n,1) + a*y(n-d,1);
    end
end

filename = 'output.wav';
audiowrite(filename,y,Fs);
sound(y,Fs);
    