0% found this document useful (0 votes)
49 views17 pages

Universidad Técnica Particular de Loja: Estudiante: Materia

The document contains code for analyzing signals in the time and frequency domains using MATLAB. It includes code to plot various signals over time like pulses, steps, and sinusoids. It also contains code calculating the Fourier transforms of these signals and plotting the results. The goal is to understand and analyze different signals and their representations in both the time and frequency domains.

Uploaded by

Leonardo Sarango
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views17 pages

Universidad Técnica Particular de Loja: Estudiante: Materia

The document contains code for analyzing signals in the time and frequency domains using MATLAB. It includes code to plot various signals over time like pulses, steps, and sinusoids. It also contains code calculating the Fourier transforms of these signals and plotting the results. The goal is to understand and analyze different signals and their representations in both the time and frequency domains.

Uploaded by

Leonardo Sarango
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Universidad técnica particular de Loja

Estudiante: Leonardo Sarango.


Materia: Procesamiento de señales analógicas y digitales.
%señal en el dominio del
tiempo
%d(t)
t = (-5:0.01:5)';
l = zeros(size(t));
l(t==0) = 2*pi;
figure (1);
plot(t,l);
grid on;

%Transformada de Fourier

y1 = 1;
y2 = 1;
x1 = -10;
x2 = 10;
figure (2);
plot ([x1,x2],[y1,y2])
grid on;
%Escalon unitario
t = (-1:0.01:5)';
unitstep =
zeros(size(t));
unitstep(t>=1) = 1;
figure(1);
plot(t,unitstep)
axis([-1 5 -2 2])
grid on;

%Transformada de
Fourier
x = -10:0.1:30;
y = abs(x);
z=1./y;
x1 = (-10:0.01:30)';
y1 = zeros(size(x1));
y1(x1==0) = 6.32;
figure(2);
plot(x,z,x1,y1)
axis([ -10 10 -1
10]);
grid on;
%tiempo
n=-15:0.1:15;
e=exp(-0.1.*n);
a =
sin(2*pi.*n/15);
s_a=e.*a;
figure (1);
plot(-n,s_a);
grid on;

%transformada
t = (-5:0.01:5)';
l = zeros(size(t));
l(t==0) = 2*pi;
figure (2);
plot(t,l);
grid on;
%señal en el dominio
del tiempo
%x(t)
y1 = 1;
y2 = 1;
x1 = -10;
x2 = 10;
figure (1);
plot
([x1,x2],[y1,y2])
grid on;

%transformada
t = (-5:0.01:5)';
l = zeros(size(t));
l(t==0) = 2*pi;
figure (2);
plot(t,l);
grid on;
%x(t)
x = -10:0.1:10;
a = 1;
b = -a;
t = -10:0.1:10;
unitstep = t >=0;
y =
exp(b.*x).*unitstep;
figure (1);
plot (x,y);
axis ( [-10 10 0 1]);
grid on;

%transformada de
fourier
l = -5:0.1:5;
m = 1;
s = 1./( m+i*l);
figure (2);
plot (l,abs(s));
grid on;
%tiempo
x = -10:0.1:10;
a = 1;
b = -a;
y = x.*exp(b.*x);
figure (1);
plot (x,y);
axis ( [0 10 0 0.4]);
grid on;

%frecuencia
l = -5:0.1:5;
m = 1;
s = 1./(m + abs(l)).^2;
figure (2);
plot (l,s);
grid on;
axis ( [-4 4 0 1]);
%tiempo
x = -10:0.1:10;
a = 1;
b = -a;
y = exp(b.*(abs(x)));
figure (1);
plot (x,y);
axis ( [-10 10 0 1]);
grid on;

%frecuencia
l = -5:0.1:5;
m = 1;
k = 1;
s = (2*k)./(m^2 +
l.^2);
figure (2);
plot (l,s);
grid on;
axis ( [-5 5 0 2]);
%tiempo
l=-2:0.1:2;
m=exp(-pi*l.^2);
figure(1)
plot(l,m);
grid on

%frecuencia
s=-2:0.1:2;
u=exp(-
(s.^2)./(4*pi));
figure(2);
plot(s,u);
grid on
%rectangular tiempo
fs = 10;
t = -5:0.1/10:5;
x2 = rectpuls(t,1);
figure (2);
plot(t,x2);
axis([-5 5 -0 1]);
grid on;

%seno cardinal al
cuadrado w/2*pi
l = -20:0.1:20;
v = sinc(l./(2.*pi));
figure (1);
plot(l,v);
axis ([-20 20 -0.5 1]);
grid on;
%triangular t
t= -10:.001:10;
f1= t+1;
f2= -t+1;
f=f1.*(-1<=t & t<0)
+ f2.*(0<=t & t<=1);
figure (2);
plot(t, f);
grid on;

%seno cardinal al
cuadrado w/2*pi
l = -20:0.1:20;
v =
(sinc(l./(2.*pi))).^2;
figure (1);
plot(l,v);
axis ([-20 20 -0.5
1]);
grid on;
%tiempo
x = -10:0.1:10;
y = sinc (x);
figure (1);
plot(x,y);
grid on;

%frecuencia
syms x1;
figure(2);
fplot(rect
angularPulse
(x1/(2*pi)), [-5
5]);
grid on;
%tiempo
x = -
10:0.1:10;
w = 1;
y = sin
(w.*x);
plot(x,y);
grid on;

%frecuencia
t = (-5:0.01:5);
l =
zeros(size(t));
l(t==1) = pi;
m =
zeros(size(t));
m(t==-1) = pi;
figure (2);
plot(t,l,t,-m);
grid on;
%tiempo
x = -10:0.1:10;
w = 1;
y = cos (w.*x);
figure(1)
plot(x,y);
grid on;

%frecuencia
t = (-5:0.01:5);
l = zeros(size(t));
l(t==1) = 2*pi;
m = zeros(size(t));
m(t==-1) = 2*pi;
figure (2);
plot(t,l,t,m);
grid on;
%tiempo
x1 = [-3 -
eps(1) 0
eps(1) 3];
y1 =
sign(x1);
plot(x1,y1)
axis([ -5 5 -
3 3]);
grid on;

%frecuencia
x = linspace(-1,1);
z=2./(i.*x);
figure(2);
plot(x,abs(z));
grid on;
%tiempo

t = (-6:6);
l = [zeros(1,0)
ones(1,length(t))];
figure (1);
stem(t,l);
grid on;
axis([-10 10 -1 2])

%frecuencia
l1 = [zeros(1,0)
ones(1,length(t))];
figure (2);
stem(t,(2*pi*l1));
grid on;
axis([-10 10 -1 7])
%tiempo
l=-10:0.1:10;
a=2;
b=3;
unitstep=l>=0;
m=(exp(-
a.*l)).*cos((2*pi*b).*l)
.*unitstep;
plot(l,m);
grid on

%frecuencia
x=-40:0.1:40;
y=(a+i.*x)./((a^2-x.^2)
+(2*pi*b)^2);
figure (2)
plot(x,abs(y));
%tiempo
l=-10:0.1:10;
a=2;
b=3;
unitstep=l>=0;
m=(exp(-
a.*l)).*sin((2*pi*b)
.*l).*unitstep;
plot(l,m);
grid on

%frecuencia
s= -40:0.1:40;
y=(2*pi*b)./(((a+i.*s)
.^2)+(2*pi*b)^2);
figure(2);
plot(s,abs(y))
clear

You might also like