% Control 03 pregunta 01 clearvars; clc; %lectura del archivo de audio [x,Fs] = audioread("marimba.wav"); N = length(x); %lectura de variables del delay gDelay = input('ingrese ganancia de retroalimentacion gDelay = '); tDelay = input('ingrese tiempo de delay en segundos tDelay = '); Ndelay = round(tDelay*Fs); N2 = N+Ndelay; %prealocamos xDelay = zeros(N2,1); %copiamos arreglo original for i=1:N xDelay(i) = x(i); end %aplicamos delay for i=1:N xDelay(i+Ndelay) = xDelay(i+Ndelay) + gDelay*xDelay(i); end %%creamos nuevo arreglo estereo y = zeros(N2,2); %%copiamos el audio original sin modificar for i=1:N y(Ndelay+i,1) = x(i); end %o podemos hacerlo matricialmente y(Ndelay+1:end,1) = x; %copiamos el arreglo del audio con delay y(:,2) = xDelay; %o usando un ciclo for for i=1:N2 y(i,2) = xDelay(i); end %guardamos el archivo audiowrite('marimbaDelayEstereo.wav',y,Fs)