Está en la página 1de 3

t=0:0.

01:1;

x=0.8*sin(2*pi*3*t);
subplot(511)
plot(t,x)
title('x=0.8*sin(2*pi*3*t)')
%xlabel('')

x1=0.2*sin(2*pi*9*t);
subplot(512)
plot(t,x1)
title('x1=0.2*sin(2*pi*9*t)')

x2=2*sin(2*pi*4.5*t);
subplot(513)
plot(t,x2)
title('x2=2*sin(2*pi*4.5*t')

xt=x+x1+x2;
subplot(514)
plot(t,xt)
title('SUMA X,X1,X2')

xt1= downsample(xt,9);
subplot(515)
plot(xt1)

clear
close

figure(3)
subplot(311)
plot(k,y,'.-')
[p1 f]=max(y);
nr=y/p1;
subplot(312)
plot(k,nr)
axis([0,20,-1,1])

inv1=y(tam:-1:(tam-tam+1));
subplot(313)
plot(k,inv1)
%sound(inv1,Fs);

figure(4)
plot(k2,y2,'.-')
%%axis([3.76,3.79,-0.5,0.5])

%sound(l1,Fs2/2);
%sound(r1,Fs/2);

[y,Fs] = audioread('Track04.wav');
[y2,Fs2] = audioread('Track02.wav');
%%sound(y,Fs)
y= y(:,1);
y2= y2(:,1);

tam=length(y);
tam2=length(y2);

k=0:(1/Fs):((tam-1)/Fs);
k2=0:(1/Fs2):((tam2-1)/Fs2);

figure(1)
subplot(311)
plot(k,y)
axis

r1=downsample(y,2);
axis
r2=downsample(k,2);
axis
subplot(312)
plot(r1)
subplot(313)
plot(r2)

figure(2)
subplot(311)
plot(k2,y2)
axis
l1=downsample(y2,2);
axis
l2=downsample(k2,2);
axis
subplot(312)
plot(l1)
subplot(313)
plot(l2)

sound(l1,Fs2/2);
sound(r1,Fs/2);

%plot
%axis

clear
close all

%lectura de archivos.wav.
[y,Fs] = audioread('Track04.wav');
[y2,Fs2] = audioread('Track02.wav');

%reproducion.
%sound(y,Fs)
%sound(y2,Fs2)

%selecion de canales.
y= y(:,1); %Track04
y2= y2(:,1); %Track02

%medida de las cancion.


tam=length(y); %Track04
tam2=length(y2); %Track02

% frecuenciade muestreo
k=0:(1/Fs):((tam-1)/Fs); %Track04
k2=0:(1/Fs2):((tam2-1)/Fs2); %Track02

figure(1) %graficas de muestreo de Track04


subplot(311)% grafica Track04
plot(k,y,'.-')
subplot(312) %grafica de una muestra Track04
plot(k,y,'.-')
axis([6.05,6.1,-0.6,0.6])

r1=downsample(y,6); %Disminuye la frecuencia de muestreo en un factor de 6


subplot(313)
plot(r1,'.-')
axis([60500,61000,-0.6,0.6])
%sound(r1);

También podría gustarte