You are on page 1of 9

UNIVERSIDAD EL BOSQUE

CENTRO DE DESARROLLO TECNOLÓGICO


FACULTAD DE
INGENIERÍA
PROGRAMA DE INGENIERÍA ELECTRÓNICA
INFORME DE LABORATORIO

Asignatura: Tratamiento de señales Fecha: 6/08/23

Nombre de la práctica: Señales en Tiempo Discreto

Nombre estudiantes: Alejandro Navarrete Rojas

Objetivos:
Implementing Fourier Series in Matlab.

Marco Teórico:

Metodología y equipos:
Procedimiento

Resultados

EXERCISE 1
● Consider a periodic signal 𝒙(𝒕), with fundamental Period 𝑻 = 𝟐, that is expressed
as:
Código matlab:
%%TALLER

%%Ejercicio 1

%%Grafico

figure(1)

t1=0:0.01:6;

f=@(t1) (heaviside(t1)-heaviside(t1-1));

x=f(mod(t1,2));

plot(t1,x)

xlabel('t')

ylabel('x(t)')

title('Serie de Fourier de una Señal Cuadratica')

% SERIES DE FOURIER

syms t
T=2;

w0=(2*pi)/T;

f=heaviside(t)-heaviside(t-1);

% DC COMPONENT

a0_syms=(1/T)*int(f,t,0,T)

a0=double(a0_syms)

fnum=a0;

tnum=0:0.01:6;

% AK AND BK

figure (2)

for k=1:1:10;

ak_syms(k)=(2/T)*int(f*cos(w0*k*t),t,0,T);

bk_syms(k)=(2/T)*int(f*sin(w0*k*t),t,0,T);

ak(k)=double(ak_syms(k));

bk(k)=double(bk_syms(k));

fharmonic=ak(k)*cos(w0*k*tnum)+bk(k)*sin(w0*k*tnum);

fnum=fharmonic+fnum;

plot(tnum,fnum)

end
● What’s the value of the DC component of the signal?
RTA//
% DC COMPONENT

a0_syms=(1/T)*int(f,t,0,T)

a0=double(a0_syms)

fnum=a0;

tnum=0:0.01:6;

● Express the signal as a Fourier Series as an infinite sum of sines and cosines.
RTA//
% AK AND BK

figure (2)

for k=1:1:10;

ak_syms(k)=(2/T)*int(f*cos(w0*k*t),t,0,T);

bk_syms(k)=(2/T)*int(f*sin(w0*k*t),t,0,T);

ak(k)=double(ak_syms(k));

bk(k)=double(bk_syms(k));

fharmonic=ak(k)*cos(w0*k*tnum)+bk(k)*sin(w0*k*tnum);

fnum=fharmonic+fnum;

plot(tnum,fnum)

end
EXERCISE 2
● Consider a periodic signal 𝒙(𝒕), with fundamental Period 𝑻 = 𝟐, that is expressed
as:
RTA//

Código matlab:
%%Ejercicio 2

%%Grafico

figure(1)

t1=0:0.01:6;

f=@(t1)(t1.*(heaviside(t1)-heaviside(t1-1)));

x=f(mod(t1,2));

plot(t1,x)

xlabel('t')

ylabel('x(t)')

title('Serie de Fourier de una Señal Sierra')

% SERIES DE FOURIER
syms t

T=2;

w0=(2*pi)/T;

f=t.*(heaviside(t)-heaviside(t-1));

% DC COMPONENT

a0_syms=(1/T)*int(f,t,0,T)

a0=double(a0_syms)

fnum=a0;

tnum=0:0.01:6;

% AK AND BK

figure (2)

for k=1:1:100;

ak_syms(k)=(2/T)*int(f*cos(w0*k*t),t,0,T);

bk_syms(k)=(2/T)*int(f*sin(w0*k*t),t,0,T);

ak(k)=double(ak_syms(k));

bk(k)=double(bk_syms(k));

fharmonic=ak(k)*cos(w0*k*tnum)+bk(k)*sin(w0*k*tnum);

fnum=fharmonic+fnum;

plot(tnum,fnum)

end

● What’s the value of the DC component of the signal?


RTA//
% DC COMPONENT

a0_syms=(1/T)*int(f,t,0,T)

a0=double(a0_syms)

fnum=a0;

tnum=0:0.01:6;

● Express the signal as a Fourier Series as an infinite sum of sines and cosines.
RTA//
% AK AND BK

figure (2)

for k=1:1:100;

ak_syms(k)=(2/T)*int(f*cos(w0*k*t),t,0,T);

bk_syms(k)=(2/T)*int(f*sin(w0*k*t),t,0,T);

ak(k)=double(ak_syms(k));

bk(k)=double(bk_syms(k));

fharmonic=ak(k)*cos(w0*k*tnum)+bk(k)*sin(w0*k*tnum);

fnum=fharmonic+fnum;

plot(tnum,fnum)

end

You might also like