Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
%escuchar la seal
sound(muestras,Fs)
%muestras alteradas
k=2;
muestras_alteradas=k*muestras;
Ejemplo 1
duracion = 5;
f = 100;
T = 1/f;
% tiempo entre muestras
Ts = 0.1*T;
Fs=1/Ts;
% eje de tiempo
t=Ts:Ts:duracion;
%vector de muestras o de amplitudes
vector_muestras=sin(2*pi*f*t);
%graficas
stem(t,vector_muestras);
plot(t,vector_muestras,'--o')
%Datos
Fo=100;
To=1/Fo;
Dur=30;
%Calculos
Ts=0.01*To;
Fs=1/Ts;
t=Ts:Ts:Dur;
;%Determina el ancho de cada onda cuadrada
ciclo_util=50
%Grafica
vector_muestra=square(2*pi*Fo*t,ciclo_util);
plot(t,vector_muestra)
f=str2double(get(handles.edit1,'String'));
D=str2double(get(handles.edit2,'String'));
a=str2double(get(handles.edit3,'String'));
porcentaje=str2double(get(handles.edit5,'String'));
Diente de sierra
f=str2double(get(handles.edit1,'String'));
D=str2double(get(handles.edit2,'String'));
a=str2double(get(handles.edit3,'String'));
f=str2double(get(handles.edit1,'String'));
D=str2double(get(handles.edit2,'String'));
a=str2double(get(handles.edit3,'String'));
porcentaje=str2double(get(handles.edit5,'String'));
t=1/f; %encontramos el periodo
ts=0.1*t; %establecemos el tiempo entre muestras
T=ts:ts:D; %establecemos el eje del tiempo
Y=a*sin(2*pi*f*T); % establecemos la funcion cuadrada
ny=length(Y);
for i=1:ny
if Y(i)>=0
Y(i)= Y(i)
else
Y(i)=0
end
i=i+1;
end
plot(T,Y)
Rectidicador de onda completa
f=str2double(get(handles.edit1,'String'));
D=str2double(get(handles.edit2,'String'));
a=str2double(get(handles.edit3,'String'));
porcentaje=str2double(get(handles.edit5,'String'));
t=1/f; %encontramos el periodo
ts=0.1*t; %establecemos el tiempo entre muestras
T=ts:ts:D; %establecemos el eje del tiempo
Y=a*sin(2*pi*f*T); % establecemos la funcion cuadrada
ny=length(Y);
for i=1:ny
if Y(i)>=0
Y(i)= Y(i)
else
Y(i)= -Y(i)
end
i=i+1;
end
plot(T,Y),grid,title('funcion'),xlabel('Tiempo'),ylabel('Amplitud')
axes(handles.axes1)
sound (Y)
%SEAL SENO
y=sin(2*pi*fo*t); %eje de amplitudes
end
%GRAFICACION
plot(t,y);
ylim([-0.5 1.5]);%poner limites al eje Y
grid on; %activar el mallado
xlabel('Tiempo [s]'); ylabel('amplitud'); %nombres a los ejes
title('SENAL COMBINADA'); %colocar titulo a la grafica
CDIGO
clc
closeall
clearall
t=0:.02:4*3.14;
y=zeros(10,length(t));
x=zeros(size(t));
%pasosparaaumentarlosarmnicos
fork=1:2:10
x=x+sin(k*t)/k;
end
plot(x)
title('construirlaondacuadradaconelfenomenodeGibbs')
Fs=1/Ts;
t=Ts:Ts:duracion;
v1=sin(2*pi*f1*t);
v2=sin(2*pi*f2*t);
vt=[v1;v2];%no hay problema si son vectores filas o columnas
vt = vt';
sound(vt,Fs)
FUNCION SINC
clc
clear all
close all
t=-10:0.01:10;
y1=sinc(t);
y2=sinc(pi*t)./(pi*t);
figure
stem(t,y1)
figure
stem(t,y2)
Fs>2*fmax
Ejemplo
1. Y1= sent(1Hz)
2. Fs>2*fmaz(1Hz)=2muestras/seg
Fs >2*AB=200 [muestras/seg]
DEMOSTRACIN DEL EFECTO DE ALIASING:
Teniendo 3 tonos (de 150, 340 y 460 Hz), suponemos intencionalmente
que la Fmax es 200 para ver qu ocurre en el momento del muestreo:
figure
plot (ta, xa2)
hold on
stem(tn,xn2,'r')
xlabel('t(segundos)')
title('Seal analgica 2 (f1 = 340 Hz) muestreada a 400 Hz -->
INCUMPLE')
figure
plot (ta, xa3)
hold on
stem(tn,xn3,'r')
xlabel('t(segundos)')
title('Seal analgica 3 (f1 = 460 Hz) muestreada a 400 Hz -->
INCUMPLE')