Professional Documents
Culture Documents
Escuela Superior Politécnica de Chimborazo: Facultad de Informática Y Electrónica
Escuela Superior Politécnica de Chimborazo: Facultad de Informática Y Electrónica
CHIMBORAZO
LABORATORIO 1
>> x=0:10:360;
y=cosd(x);
plot(x,y);
grid on
title('y=cos(x)');
xlabel('x');
ylabel('y')
>> x=0:5:360;
y=cosd(x);
plot(y,x);
title('x=cos(y)');
xlabel('y');
ylabel('x')
grid on
>> x=0:0.02:2*pi;
y=cos(x);
plot(x,y);
set(gca,'Xtick',0:pi/2:2*pi);
set(gca,'Ytick',-1:0.25:1)
grid on
>> x=0:0.02:2*pi;
y=cos(x);
plot(x,y)
set(gca,'Xtick',0:pi/2:2*pi)
set(gca,'Ytick',-1:0.25:1)
set(gca,'Xticklabel',{'0','pi/2','pi','3pi/2','2pi'})
grid on
>> x=0:0.02:2*pi;
>> y=cos(x);
>> plot(x,y)
>> set(gca,'Xtick',0:pi/2:2*pi)
>> set(gca,'Ytick',-1:0.25:1)
>> set(gca,'Xticklabel',{'0','pi/2','pi','3pi/2','2pi'})
>> grid on
>> t=0:0.001:1;
y=sin(2*pi*100*t);
plot(t(1:50),y(1:50))
grid on
>> title('Funcion Seno');
>> xlabel('Frecuencia(Hz)')
>> plot(t(1:75),y(1:75))
>> plot(t(1:25),y(1:25))
FUNCION SENO CON RUIDO
>> t=0:0.001:1;
>> y=0.5*randn(size(t));
>> plot(t(1:50),y(1:50))
SEÑAL CUADRADA
>> A=1;
w=10*pi;
r=0.5;
t=0:0.001:1;
sq=A*square(w*t+r);
plot(t,sq)
>> A=0.5;
w=20*pi;
r=0.5;
t=0:0.001:1;
sq=A*square(w*t+r);
plot(t,sq)
EJERCICIO
>> fm=1000;
>> t=0:0.0001:1;
>> x=square(2*pi*50*t);
>> plot(t,x)
>> axis([0 0.08 -2 2])
>> fm=1000;
t=0:0.0001:1;
x=square(2*pi*50*t,70);
plot(t,x)
axis([0 0.08 -2 2])
grid on
SEÑAL TRIANGULAR
>> fs=10000;
>> t=0:1/fs:2;
>> x=sawtooth(2*pi*100*t);
>> plot(t,x),axis([0 0.2 -1 1])
>> fs=100;
t=0:1/fs:1;
x=sawtooth(2*pi*10*t);
plot(t,x),axis([0 0.2 -1 1])
>> grid on
EJERCICIO
>> T=10*(1/50);
>> Fs=1000;
>> dt=1/Fs;
>> t=0:dt:T-dt;
>> x=sawtooth(2*pi*50*t);
>> plot(t,x)
>> grid on
>> Fs=100;
dt=1/Fs;
t=0:dt:T-dt;
x=sawtooth(2*pi*20*t);
plot(t,x)
grid on