0% found this document useful (0 votes)
4 views16 pages

Lab7 Victor Viveros

The document is a lab report from the Universidad Tecnológica de Panamá, focusing on signals and systems, specifically sampling theorem and overlap. It includes various analytical and graphical analyses of signals using MATLAB, demonstrating concepts such as sampling, reconstruction, and filtering. The report is structured into multiple sections, each detailing different experiments and their results, with plots illustrating the findings.

Uploaded by

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

Lab7 Victor Viveros

The document is a lab report from the Universidad Tecnológica de Panamá, focusing on signals and systems, specifically sampling theorem and overlap. It includes various analytical and graphical analyses of signals using MATLAB, demonstrating concepts such as sampling, reconstruction, and filtering. The report is structured into multiple sections, each detailing different experiments and their results, with plots illustrating the findings.

Uploaded by

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

Universidad Tecnológica de Panamá

Facultad de ingeniería eléctrica

Ing. En control y automatización

Pertenece a: Víctor Viveros

C.I.P 8-854-324

Profesora: DR. Carlos Medina

Asignatura: Señales y sistemas

Tema: Lab.#7

Fecha de entrega 22 noviembre de 2021


P01. ANALITICO
P02. Teorema de muestreo y traslape

%P02.

df= 1;

N = 1024;

at = [0 0.03];

af = [-600 600];

Fs= 2000; %f nyquist dt = 1/Fs;

t =(0:N-1)*dt;

x = 2*cos(400*pi*t + pi/4) + 4*cos(1000*pi*t); subplot(5,2,1);plot(t,x);grid;axis(at)

title('P02. x(t) frecuencia de Nyquist');xlabel('t'); X = fft(x); Xabs = abs(X);

f = Fs/2*linspace(-1,1,N); subplot(5,2,2);plot(f,fftshift(Xabs));grid;axis(af) title('P02. X(jw)


frecuencia de Nyquist');xlabel('f');
dt1 = 0.5*10^-3; %i Fs1= 1/dt1;

t1 =(0:N-1)*dt1;

x1 = 2*cos(400*pi*t1 + pi/4) + 4*cos(1000*pi*t1); subplot(5,2,3);plot(t1,x1);grid;axis(at)

title('P02.i x(t) T = 0.5ms');xlabel('t'); X = fft(x1); Xabs = abs(X);

f = Fs1/2*linspace(-1,1,N); subplot(5,2,4);plot(f,fftshift(Xabs));grid;axis(af) title('P02.i X(jw) T =


0.5ms');xlabel('f');

dt1 = 0.95*10^-3; %ii Fs1= 1/dt1;

t1 =(0:N-1)*dt1;

x1 = 2*cos(400*pi*t1 + pi/4) + 4*cos(1000*pi*t1); subplot(5,2,5);plot(t1,x1);grid;axis(at)

title('P02.ii x(t) T = 0.95ms');xlabel('t'); X = fft(x1); Xabs = abs(X);

f = Fs1/2*linspace(-1,1,N); subplot(5,2,6);plot(f,fftshift(Xabs));grid;axis(af) title('P02.ii X(jw) T =


0.95ms');xlabel('f');

dt1 = 1.5*10^-3; %iii Fs1= 1/dt1;

t1 =(0:N-1)*dt1;

x1 = 2*cos(400*pi*t1 + pi/4) + 4*cos(1000*pi*t1);

subplot(5,2,7);plot(t1,x1);grid;axis(at) title('P02.iii x(t) T = 1.5ms');xlabel('t'); X = fft(x1); Xabs =


abs(X);

f = Fs1/2*linspace(-1,1,N); subplot(5,2,8);plot(f,fftshift(Xabs));grid;axis(af) title('P02.iii X(jw) T =


1.5ms');xlabel('f');

dt1 = 2*10^-3; %iv Fs1= 1/dt1;

t1 =(0:N-1)*dt1;

x1 = 2*cos(400*pi*t1 + pi/4) + 4*cos(1000*pi*t1); subplot(5,2,9);plot(t1,x1);grid;axis(at)

title('P02.iv x(t) T = 2.0ms');xlabel('t'); X = fft(x1); Xabs = abs(X);

f = Fs1/2*linspace(-1,1,N); subplot(5,2,10);plot(f,fftshift(Xabs));grid;axis(af) title('P02.iv X(jw) T =


2.0ms');xlabel('f');
P03.teorema de muestreo

%P03.

Fs = 10*10^3;

t = -5*10^-3:1/Fs:5*10^-3; at = [-5*10^-3 5*10^-3]; af = [-3000 3000];

xi = 1 +cos(1000*pi*t) +sin(2500*pi*t); xii = sinc(1700*t);

xiii = (2).*(sin(625*pi*t +pi/3)).^2;

Fs1 = 5500*pi; Fs2 = 3740; Fs3 = 2750*pi; t1 = -5*10^-3:1/Fs1:5*10^-3;

t2 = -5*10^-3:1/Fs2:5*10^-3; t3 = -5*10^-3:1/Fs3:5*10^-3;
f = Fs/2*linspace(-1,1,length(t));

f1 = Fs1/2*linspace(-1,1,length(t1)); f2 = Fs2/2*linspace(-1,1,length(t2)); f3 = Fs3/2*linspace(-


1,1,length(t3));

x1 = 1 +cos(1000*pi*t1) +sin(2500*pi*t1); x2 = sinc(1700*t2);

x3 = (2).*(sin(625*pi*t3 +pi/3)).^2;

Xiabs = fftshift(abs(fft(xi)));Xiiabs = fftshift(abs(fft(xii)));Xiiiabs = fftshift(abs(fft(xiii))); X1abs =


fftshift(abs(fft(x1)));X2abs = fftshift(abs(fft(x2)));X3abs = fftshift(abs(fft(x3)));

subplot(3,2,1);plot(t,xi,'-k','linewidth',4,t1,x1,'linewidth',2,'-r'); grid;axis(at); title('P03. xi(t) 10kHz y


Freq. Nyquist (rojo)');xlabel('t'); subplot(3,2,3);plot(t,xii,'-k','linewidth',4,t2,x2,'linewidth',2,'-
g');grid;axis(at); title('P03. xii(t) 10kHz y Freq. Nyquist (verde)');xlabel('t'); subplot(3,2,5);plot(t,xiii,'-
k','linewidth',4,t3,x3,'linewidth',2,'-m');grid;axis(at); title('P03. xiii(t) 10kHz y Freq. Nyquist
(rosado)');xlabel('t');

subplot(3,2,2);plot(f,Xiabs,'-k','linewidth',4,f1,X1abs,'linewidth',2,'-r'); grid;axis(af); title('P03. Xi(jw)


10kHz y Freq. Nyquist (rojo)');xlabel('t'); subplot(3,2,4);plot(f,Xiiabs,'-
k','linewidth',4,f2,X2abs,'linewidth',2,'-g'); grid;axis(af); title('P03. Xii(jw) 10kHz y Freq. Nyquist
(verde)');xlabel('t'); subplot(3,2,6);plot(f,Xiiiabs,'-k','linewidth',4,f3,X3abs,'linewidth',2,'-m');
grid;axis(af); title('P03. Xiii(jw) 10kHz y Freq. Nyquist (rosado)');xlabel('t');
P04. Muestreo y reconstrucción continua

Fs = 1000;

t = 0:1/Fs:0.601;

x1 = cos(20*pi*t +pi/4);

x2 = x1 + cos(20*pi*t -79*pi/4); x3 = -20*pi*sin(20*pi*t +pi/4); x4 = x1.*cos(80*pi*t);

x1 = x1/max(x1); x1 = x1(1:end-1); x2 = x2/max(x2); x2 = x2(1:end-1); x3 = x3/max(x3); x3 =


x3(1:end-1); x4 = x4/max(x4); x4 = x4(1:end-1); t = t(1:end-1);

xs1 = x1(1:0.05*Fs:end); xs1 = upsample(xs1(1:end-1),0.05*Fs); xs1 = [xs1 0]; xs2 =


x2(1:0.05*Fs:end); xs2 = upsample(xs2(1:end-1),0.05*Fs); xs2 = [xs2 0]; xs3 = x3(1:0.05*Fs:end);
xs3 = upsample(xs3(1:end-1),0.05*Fs); xs3 = [xs3 0];
xs4 = x4(1:0.02*Fs:end); xs4 = upsample(xs4(1:end-1),0.05*Fs); xs4 = [xs1 0]; [b1,a1] =
butter(8,20/Fs,'low'); [b2,a2] = butter(8,100/Fs,'low');

xr1 = 49*filter(b1,a1,xs1); xr2 = 49*filter(b1,a1,xs2); xr3 = 49*filter(b1,a1,xs3); xr4 =


49*filter(b2,a2,xs4); a =[0 0.6];

subplot(4,2,1);plot(t,x1,'-r','linewidth',3);grid;hold on;

stem(t(1:0.05*Fs:end),xs1(1:0.05*Fs:end),'-b');grid;grid;axis(a); title('P04. x(t)');

subplot(4,2,2);plot(t,xr1,'linewidth',3,'-m');grid;axis(a); title('P04. x(t) filtrado butterworth');


subplot(4,2,3);plot(t,x2,'-g','linewidth',3);grid;hold on;

stem(t(1:0.05*Fs:end),xs2(1:0.05*Fs:end),'-k');grid;grid;axis(a); title('P04. x(t) + x(t-1)');

subplot(4,2,4);plot(t,xr2,'linewidth',3,'-r');grid;axis(a); title('P04. x(t) + x(t-1) filtrado butterworth');


subplot(4,2,5);plot(t,x3,'-b','linewidth',3);grid;hold on;

stem(t(1:0.05*Fs:end),xs3(1:0.05*Fs:end),'-m');grid;grid;axis(a); title('P04. dx(t)/dt');

subplot(4,2,6);plot(t,xr3,'linewidth',3,'-g');grid;axis(a); title('P04. dx(t)/dt filtrado butterworth');


subplot(4,2,7);plot(t,x4,'-m','linewidth',3);grid;hold on;

stem(t(1:0.05*Fs:end),xs4(1:0.05*Fs:end),'-k');grid;grid;axis(a); title('P04. x(t)cos(80*pi*t)');

subplot(4,2,8);plot(t,xr4(1:end-1),'linewidth',3,'-b');grid;axis(a); title('P04. x(t)cos(80*pi*t) filtrado


butterworth');
P05. Teorema de muestreo (solo analítico)
P06. Traslape y perdida de información

x = 0;

for k=0:5;

x1 = ((1/2)^k)*sin(k*pi*t); x = x + x1;

endfor

ts = -6:T:6;

y = downsample(x,10); h = sinc(ts.*pi/T);

g = conv(y,h,'same');

Xabs = abs(fft(x)); Yabs = abs(fft(y)); Habs = abs(fft(h));Gabs = abs(fft(g));

f = Fs/2*linspace(-1,1,length(t));
fs = Fs1/2*linspace(-1,1,length(ts)); af = [-3 3];

subplot(2,2,1);plot(t,x,'-r','linewidth',3,ts,g,'-b');grid;

title('P06. x(t)(rojo) y g(t)(azul)');xlabel('t');

subplot(2,2,2);plot(f,fftshift(Xabs),'-k');grid;axis(af)

title('P06. X(jw)');xlabel('w');

subplot(2,2,3);plot(ts,y,'linewidth',3,'-g');grid;

title('P06. y(t)');xlabel('t');

subplot(2,2,4);plot(fs,fftshift(Yabs),'-k',fs,fftshift(Habs),'-b','linewidth',2);grid;axis(af) title('P06.
Y(jw) y H(jw)');xlabel('w');
P07.Insección de ceros y decimación
n = -10:10;

w1 = 2*pi/5; w2 = 4*pi/5;

x1 = sinc(w1*n); x2 = sinc(w2*n); subplot(4,2,1);stem(n,x1);grid;title('P08. x[n] w1 =


2pi/5');xlabel('n');

subplot(4,2,2);stem(n,x2);grid;title('P08. x[n] w1 = 4pi/5');xlabel('n');

n = -30:32;

x1 = upsample(x1,3); x2 = upsample(x2,3); a = [-10 10];

subplot(4,2,3);stem(n,x1);grid;title('P08. x1[n] w1 = 2pi/5');xlabel('n');axis(a)

subplot(4,2,4);stem(n,x2);grid;title('P08. x1[n] w1 = 4pi/5');xlabel('n');axis(a)

h = sinc(pi*n/5);

wn1 = conv(x1,h,'same'); wn2 = conv(x2,h,'same'); n = -29:33;


subplot(4,2,5);stem(n,wn1);grid;title('P08. w[n] w1 = 2pi/5');xlabel('n');axis(a)

subplot(4,2,6);stem(n,wn2);grid;title('P08. w[n] w1 = 4pi/5');xlabel('n');axis(a)

n = -6:6;

y1 = decimate(wn1,5); y2 = decimate(wn2,5); subplot(4,2,7);stem(n,y1);grid;title('P08. y[n] w1 =


2pi/5');xlabel('n');

subplot(4,2,8);stem(n,y2);grid;title('P08. y[n] w1 = 4pi/5');xlabel('n');


P08. Inserción de ceros y decimación

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy