Documentos de Académico
Documentos de Profesional
Documentos de Cultura
https://www.youtube.com/watch?v=0vW4KVFV__o
lc
% c
% c lear
[entrada fo]=audioread('6.wav');
[respuesta fo]=audioread('catedral.wav');
entrada=entrada(:,1);
respuesta=respuesta(:,1);
Emu1=conv(entrada,respuesta);
wavwrite(Emu1,44100,uiputfile({'*.mp3'},'guardar como'));
sound(Emu1,44100);
%
% %EMULADOR
%
% [y a]=audioread('6.wav');
% [h1 a]=audioread('plazache.wav');
%
% y= y(:,1);
% h1= h1(:,1);
% x= conv(y,h1);
% x= x(1:length(y));
% L= length(x);
% f= a*(0:(L/2))/L;
% X= fft(x);
% X_1= X(1:L/2+1);
% b= 1000;
% c= 4000;
% filtro(1:L,1)= 0;
% filtro(b:c,1)= 1;
% filtro(L-(c-b):L,1)= 1;
% Y=X.*filtro;
% x_1=ifft(Y);
% x_2=(x_1.*conj(x_1)).^0.5;
%
% for i=1:length(x_1)
% i f x_1(i) < 0
% x_2(i)=x_2(i)*(-1);
% e nd
% end
%
% sound(x_2,44100)
% subplot(3,1,1)
% plot(f,X_1);
% subplot(3,1,2)
% plot(x);
% subplot(3,1,3)
% plot(x_2);
%EMULADOR
[y a]=audioread('6.wav');
[h1 a]=audioread('catedral.wav');
y=y(:,1);
h1=h1(:,1);
Emu1=conv(y,h1);
%sound(Emu1);
F1=fft(Emu1);
%F1= F1(200:8000);
x=ifft(F1);
x_1 = (x.*conj(x)).^0.5;
sound(x_1/1000);
plot(x_1/1000);
%PROYECTO DJ
ound(y,a);
% s
% p lot(y);
%5 Terminator
[x b]=audioread('4.wav');
% sound(x,b);
% plot(x(:,1))
%Longitud audio 1
r=length(y);
EZCLA
% M
% I gualar tamao de vectores
% if length(x)<r
% x1=zeros(r,1);
% x1(1:length(x),1)=x(:,1);
% end
%
% z=x1+y;
% sound(z,a);
%
% subplot(3,1,3)
% plot(z);
% title('Seal 1+2')
%
% subplot(3,1,1)
% plot(x1)
% title('Seal 1')
%
% subplot(3,1,2)
% plot(y)
% title('Seal 2')
%Tiempo de duracin
t1=size(y,1)/a;
%ELONGACIN DE LA SEAL
% el=2;
% lento = zeros(el*r,1);
% lento(1:el:el*r,1)=y;
%
% % frecuencia lento
% f= a/el;
%
% subplot(2,1,1)
% plot(lento)
% title('Seal elongada')
%
% subplot(2,1,2)
% plot(y)
% title('Seal original')
%
% sound(5*lento,a);
%COMPRESION DE LA SEAL
% co=2;
% sound(y(1:co:r),a);
%
% subplot(2,1,1)
% plot(y(1:co:r))
% title('Seal comprimida')
%
% subplot(2,1,2)
% plot(y)
% title('Seal original')
%INVERSIN
nv=y(end:-1:1);
% i
% s ound(inv,a);
%Izquierda
esfase_iz=300000;
% d
% v ec1=y(desfase_iz:1:r);
% s ound(vec1,a);
%Derecha
% desfase_der=300000;
%
% vec_des=zeros(length(y),1);
% j=0;
% for i=desfase_der:length(y)
% j=j+1;
% vec_des(i)=y(j);
% end
% sound(vec_des,a);
%ECO
% for i=2:6;
% sound(10*x,a);
% pause(t2-2.8)
% x=x*(1/i);
% end
%REBERVERACIN
% vec_t=zeros(length(x),1);
% for i=2:length(x);
% vec_t(i,1)=vec_t(i-1,1)+1/b;
% end
%
% for i=2:6;
% plot(vec_t,x);
% sound(8*x,b);
% pause(t2-3.1)
% x=x*(1/i);
% hold on
% end
%Grabar audio
grabacion=audiorecorder(44100,16,1);
msgbox('Grabando');
recordblocking(grabacion,2);
msgbox('Grabacion finalizada');
grabacion=getaudiodata(grabacion);
wavwrite(grabacion,44100,uiputfile({'*.wav'},'guardar como'));
[y a]=audioread('Hola.wav');
sound(Hola);
*******************
FILTRO ECO
load('cancion_preg.mat');
CANCION=fft(cancion);
f=linspace(0,Fs,length(CANCION));
Hjw=(1+((a*(1-b)).*exp((-j*D).*f)))./(1-((a*b).*exp((-j*D).*f)));
HECANCION=CANCION.*Hjw;
hecancion=real(ifft(HECANCION));
ht=real(ifft(Hjw));
t=linspace(0,Fs,length(ht));
****************************
%PROYECTO DJ
sound(y,a);
%5 Terminator
[x b]=audioread('4.wav');
% sound(x,b);
% plot(x(:,1))
%Longitud audio 1
r=length(y);
% MEZCLA
% Igualar tamao de vectores
% if length(x)<r
% x1=zeros(r,1);
% x1(1:length(x),1)=x(:,1);
% end
%
% z=x1+y;
% sound(z,a);
%
% subplot(3,1,3)
% plot(z);
% title('Seal 1+2')
%
% subplot(3,1,1)
% plot(x1)
% title('Seal 1')
%
% subplot(3,1,2)
% plot(y)
% title('Seal 2')
%Tiempo de duracin
t1=size(y,1)/a;
T(1)=t1;
for i=2:r
T(i)=t1+T(i-1);
end
plot(T,y);
%ELONGACIN DE LA SEAL
% el=2;
% lento = zeros(el*r,1);
% lento(1:el:el*r,1)=y;
%
% % frecuencia lento
% f= a/el;
%
% subplot(2,1,1)
% plot(lento)
% title('Seal elongada')
%
% subplot(2,1,2)
% plot(y)
% title('Seal original')
%
% sound(5*lento,a);
%COMPRESION DE LA SEAL
% co=2;
% sound(y(1:co:r),a);
%
% subplot(2,1,1)
% plot(y(1:co:r))
% title('Seal comprimida')
%
% subplot(2,1,2)
% plot(y)
% title('Seal original')
%INVERSIN
% inv=y(end:-1:1);
% sound(inv,a);
%Izquierda
% desfase_iz=300000;
% vec1=y(desfase_iz:1:r);
% sound(vec1,a);
%Derecha
% desfase_der=300000;
%
% vec_des=zeros(length(y),1);
% j=0;
% for i=desfase_der:length(y)
% j=j+1;
% vec_des(i)=y(j);
% end
% sound(vec_des,a);
%ECO
% for i=2:6;
% sound(10*x,a);
% pause(t2-2.8)
% x=x*(1/i);
% end
%REBERVERACIN
% vec_t=zeros(length(x),1);
% for i=2:length(x);
% vec_t(i,1)=vec_t(i-1,1)+1/b;
% end
%
% for i=2:6;
% plot(vec_t,x);
% sound(8*x,b);
% pause(t2-3.1)
% x=x*(1/i);
% hold on
% end
%ENTREGA NUMERO 2:
trans_f=fft(y);
f(1)=0;
for i=2:length(T)
f(i)=f(i-1)+1;
end
plot(f,trans_f);
le=length(trans_f);
display(le);
*******************************
++++++++++++++++++++++++++++++
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = proyecto2_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
[g a]=audioread('2.mp3');
y=g(:,1);
sound(y,a);
plot(y);
[x b]=audioread('1.mp3');
sound(x,b);
plot(x(:,1))
subplot(3,1,3)
plot(z);
title('Seal 1+2')
subplot(3,1,1)
plot(x1)
title('Seal 1')
subplot(3,1,2)
plot(y)
title('Seal 2')
% hObject handle to C (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% ELONGACIN DE LA SEAL
% Frecuencia
a=44100
% lee audio1
[g a]=audioread('2.mp3');
y=g(:,1);
% lee audio2
[x b]=audioread('1.mp3');
% longitud audio1
r=length(y);
el=2;
lento = zeros(el*r,1);
lento(1:el:el*r,1)=y;
% frecuencia lento
f= a/el;
subplot(2,1,1)
plot(lento)
title('Seal elongada')
subplot(2,1,2)
plot(y)
title('Seal original')
sound(5*lento,a);
% hObject handle to D (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%COMPRESION DE LA SEAL
[g a]=audioread('2.mp3');
y=g(:,1);
% lee audio2
[x b]=audioread('1.mp3');
% longitud audio1
r=length(y);
a=44100;
co=2;
sound(y(1:co:r),a);
subplot(2,1,1)
plot(y(1:co:r))
title('Seal comprimida')
subplot(2,1,2)
plot(y)
title('Seal original')
[g a]=audioread('2.mp3');
y=g(:,1);
%INVERSIN
inv=y(end:-1:1);
sound(inv,a);
subplot(2,1,1)
plot(y(end:-1:1))
title('Seal invertida')
subplot(2,1,2)
plot(y)
title('Seal original')
[g a]=audioread('2.mp3');
y=g(:,1);
%Derecha
desfase_der=50000;
r=length(y);
vec_des=zeros(r,1);
j=0;
for i=desfase_der:length(y)
j=j+1;
vec_des(i)=y(j);
end
sound(vec_des,a);
% hObject handle to H (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Izquierda
a=44100;
[g a]=audioread('2.mp3');
y=g(:,1);
r=length(y);
desfase_iz=30000;
vec1=y(desfase_iz:1:r);
sound(vec1,a);
plot(vec1);
t2=size(x,1)/a;
%ECO
i=0;
for i=2:6;
sound(10*x,a);
pause(t2-2.8)
x=x*(1/i);
end
t2=size(x,1)/a;
vec_t=zeros(length(x),1);
for i=2:length(x);
vec_t(i,1)=vec_t(i-1,1)+1/b;
end
for i=2:6;
plot(vec_t,x);
sound(8*x,b);
pause(t2-3.1)
x=x*(1/i);
hold on
end
+++++++++++++++++++++++++++++++++++++++++++++++++++++++