Académique Documents
Professionnel Documents
Culture Documents
ÑALESÑALES614
1
ESCUELA POLITECNICA NACIONAL
1. DEBER 1
1.1. Realizar la implementacion directa del archivo.m
Instrucciones
Para las siguientes seniales, graficar
a) Senial en tiempo x[n]
b) Espectro de magnitud bilateral
c) Espectro de fase bilateral
b) Espectro de magnitud unilateral
c) Espectro de fase unilateral
c) Parte real bilateral
c) Parte imaginaria bilateral
c) Senial en tiempo calculada con ifft
Observaciones:
1. Use fft e ifft
2. Use fftshift para obtener las graficas bilaterales
2
1. x[n] = δ[n] para N = 64
3
49 title ('Parte imaginaria bilateral')
50 xlabel('k')
51 ylabel('Imag[X[k]]')
52 x_ifft=ifft(X)*N
53 subplot(4,2,8)
54 stem(t(1:64), x_ifft(1:64))
55 title (' S e al en tiempo calculada con ifft')
56 xlabel('t')
57 axis([-3 68 0 1.2])
1.2. GRAFICA
mod[X[k]]
1
0.01
0.5
0 0
0 20 40 60 -40 -20 0 20 40
n k
Espectro de fase bilateral Espectro de magnitud unilateral
1
Mod[X[k]]
Arg[X[k]]
0.02
0
-1 0
-40 -20 0 20 40 0 0.1 0.2 0.3 0.4 0.5
k k
Espectro de fase unilateral Parte real bilateral
1
Arg[X[k]]
Re[X[k]]
0.01
0
-1 0
0 0.1 0.2 0.3 0.4 0.5 -40 -20 0 20 40
k k
Parte imaginaria bilateral Señal en tiempo calculada con ifft
Imag[X[k]]
1
1
0 0.5
-1 0
-40 -20 0 20 40 0 20 40 60
k t
4
2. x[n] = 1 para N = 64
1 % % x[n] = 1 para N = 64
2 clear all
3 close all
4 clc
5 N = 64;
6 n = 0:N-1;
7 k=n;
8 Fs=1;
9 t=n*Fs;
10 x = ones(1,N);
11 X = fft(x)/N;
12 X_unilateral=X(1:floor(N/2)+1);
13 subplot(4,2,1)
14 stem(n, x)
15 title (' S e al en tiempo x[n]')
16 xlabel('n')
17 subplot(4,2,2)
18 stem(linspace(-N/2,N/2-1,N), abs(fftshift(X)))
19 title ('Espectro de magnitud Bilateral')
20 xlabel('k')
21 ylabel('mod[X[k]]')
22 subplot(4,2,3)
23 stem(linspace(-N/2,N/2-1,N), angle(fftshift(X)))
24 title ('Espectro de fase bilateral')
25 xlabel('k')
26 ylabel('Arg[X[k]]')
27 subplot(4,2,4)
28 stem(linspace(0, Fs/2, floor(N/2)+1), abs(X_unilateral))
29 title ('Espectro de magnitud unilateral')
30 xlabel('k')
31 ylabel('Mod[X[k]]')
32 axis([-1 0.7 0 1.2])
33 subplot(4,2,5)
34 stem(linspace(0, Fs/2, floor(N/2)+1), angle(X_unilateral))
35 title ('Espectro de fase unilateral')
36 xlabel('k')
37 ylabel('Arg[X[k]]')
38
39 subplot(4,2,6)
40 stem(linspace(-N/2,N/2-1,N), real(fftshift(X))) %N par
41 title ('Parte real bilateral')
42 xlabel('k')
43 ylabel('Re[X[k]]')
44 subplot(4,2,7)
45 stem(linspace(-N/2,N/2-1,N), imag(fftshift(X))) %N par
46 title ('Parte imaginaria bilateral')
47 xlabel('k')
48 ylabel('Imag[X[k]]')
49 x_ifft=ifft(X)*N
50 subplot(4,2,8)
5
51 stem(t(1:64), x_ifft(1:64))
52 title (' S e al en tiempo calculada con ifft')
53 xlabel('t')
2.2. GRAFICA
mod[X[k]]
0.5 0.5
0 0
0 20 40 60 -40 -20 0 20 40
n k
Espectro de fase bilateral Espectro de magnitud unilateral
1
Mod[X[k]]
Arg[X[k]]
1
0 0.5
-1 0
-40 -20 0 20 40 -1 -0.5 0 0.5
k k
Espectro de fase unilateral Parte real bilateral
1 1
Arg[X[k]]
Re[X[k]]
0 0.5
-1 0
0 0.1 0.2 0.3 0.4 0.5 -40 -20 0 20 40
k k
Parte imaginaria bilateral Señal en tiempo calculada con ifft
Imag[X[k]]
1 1
0 0.5
-1 0
-40 -20 0 20 40 0 20 40 60
k t
6
3. x[n] = 3cos(2πn/16) para N = 64
7
51 stem(t(1:64), x_ifft(1:64))
52 title (' S e al en tiempo calculada con ifft')
53 xlabel('t')
3.2. GRAFICA
mod[X[k]]
2
1
0
0.5
-2
0
0 20 40 60 -40 -20 0 20 40
n k
Espectro de fase bilateral Espectro de magnitud unilateral
3
Mod[X[k]]
Arg[X[k]]
2
2
0
1
-2
0
-40 -20 0 20 40 0 0.1 0.2 0.3 0.4 0.5
k k
Espectro de fase unilateral Parte real bilateral
1.5
Arg[X[k]]
Re[X[k]]
5
1
0
0.5
-5 0
0 0.1 0.2 0.3 0.4 0.5 -40 -20 0 20 40
k k
10-15
Parte imaginaria bilateral Señal en tiempo calculada con ifft
Imag[X[k]]
1
2
0 0
-2
-1
-40 -20 0 20 40 0 20 40 60
k t
8
4. x[n] = 3cos(2πn/16 + 3π) para N = 64
9
51 xlabel('k')
52 ylabel('Imag[X[k]]')
53
54 x_ifft=ifft(X)*N
55
56 subplot(4,2,8)
57 stem(t(1:64), x_ifft(1:64))
58 title (' S e al en tiempo calculada con ifft')
59 xlabel('t')
4.2. GRAFICA
mod[X[k]]
2
1
0
0.5
-2
0
0 20 40 60 -40 -20 0 20 40
n k
Espectro de fase bilateral Espectro de magnitud unilateral
Mod[X[k]]
Arg[X[k]]
2
2
0
1
-2
0
-40 -20 0 20 40 0 0.1 0.2 0.3 0.4 0.5
k k
Espectro de fase unilateral Parte real bilateral
0
Arg[X[k]]
Re[X[k]]
5
-0.5
0
-1
-5
0 0.1 0.2 0.3 0.4 0.5 -40 -20 0 20 40
k k
10-15
Parte imaginaria bilateral Señal en tiempo calculada con ifft
Imag[X[k]]
1 2
0 0
-1 -2
-40 -20 0 20 40 0 20 40 60
k t
10
5. x[n] = 3cos(2πn/10) para N = 65 (ojo N es impar)
11
50 ylabel('Imag[X[k]]')
51 x_ifft=ifft(X)*N
52 subplot(4,2,8)
53 stem(t(1:65), x_ifft(1:65))
54 title (' S e al en tiempo calculada con ifft')
55 xlabel('t')
5.2. GRAFICA
mod[X[k]]
2
0 0.5
-2
0
0 20 40 60 80 0 20 40 60 80
n k
Espectro de fase bilateral Espectro de magnitud unilateral
2 2
Mod[X[k]]
Arg[X[k]]
0 1
-2 0
0 20 40 60 80 0 0.1 0.2 0.3 0.4 0.5
k k
Espectro de fase unilateral Parte real bilateral
2 0.05
Arg[X[k]]
Re[X[k]]
-2 0
0 0.1 0.2 0.3 0.4 0.5 0 20 40 60 80
k k
Parte imaginaria bilateral Señal en tiempo calculada con ifft
Imag[X[k]]
1
2
0 0
-2
-1
0 20 40 60 80 0 20 40 60 80
k t
12
6. x[n] = 1 para 0 <= n <= 3,N = 65 (ojo N es impar)
13
51 subplot(4,2,8)
52 stem(t(1:65), x_ifft(1:65))
53 title (' S e al en tiempo calculada con ifft')
54 xlabel('t')
6.2. GRAFICA
mod[X[k]]
0.5 0.5
0 0
0 1 2 3 0 1 2 3
n k
Espectro de fase bilateral Espectro de magnitud unilateral
1
Mod[X[k]]
Arg[X[k]]
1
0 0.5
-1 0
0 1 2 3 -1 -0.5 0 0.5
k k
Espectro de fase unilateral Parte real bilateral
1 1
Arg[X[k]]
0 Re[X[k]] 0.5
-1 0
0 0.1 0.2 0.3 0.4 0.5 0 1 2 3
k k
Parte imaginaria bilateral Señal en tiempo calculada con ifft
Imag[X[k]]
1 1
0 0.5
-1 0
0 1 2 3 0 1 2 3
k t
14
2. DEBER 2
2.1. Consultar sobre el zero padding
Zero Padding o El relleno cero es un concepto simple; simplemente se refiere a agregar ceros al
final de una señal de dominio de tiempo para aumentar su longitud.Las formas de onda sinusoidales
que se utilizan como ejemplo son de 1 MHz y 1,05 MHz respectivamente a continuacion se muestra
la grafica:
La longitud del dominio del tiempo de esta forma de onda es de 1000 muestras. A la frecuencia de
muestreo de 100 MHz, es una duración de 10 us. Si ajustamos a cero la forma de onda con 1000
muestras adicionales (o 10 datos de datos), se produce la forma de onda resultante:
Hay algunas razones por las que puede querer rellenar los datos del dominio del tiempo. La razón
más común es hacer que una forma de onda tenga una potencia de dos muestras.
15
3. DEBER 3
3.1. Consultar como estimar directamente la amplitud
El relleno cero le permite obtener estimaciones de amplitud más precisas de los componentes
de señal que se pueden resolver. Por otro lado, el relleno cero no mejora la resolución espectral
(frecuencia) de la DFT. La resolución está determinada por el número de muestras y la frecuencia de
muestreo.
16
4. ANEXOS
17
Table of Contents
INSTRUCCIONES .............................................................................................................. 1
x[n] =\delta[n] para N = 64 .................................................................................................. 1
x[n] = 1 para N = 64 ........................................................................................................... 3
x[n] = 3cos(2\pi n/16) para N=64 .......................................................................................... 5
x[n] = 3cos(2\pi n/16 + \pi 3) para N=64 ................................................................................ 7
x[n] = 3cos(2\pi n/10) para N = 65 (ojo N es impar) ................................................................. 9
x[n] = 1 para 0 <= n <= 3. N = 65 (ojo N es impar) ................................................................ 11
INSTRUCCIONES
%Para las siguientes seniales, graficar
% a) Senial en tiempo x[n]
% b) Espectro de magnitud bilateral
% c) Espectro de fase bilateral
% b) Espectro de magnitud unilateral
% c) Espectro de fase unilateral
% c) Parte real bilateral
% c) Parte imaginaria bilateral
% c) Senial en tiempo calculada con ifft
%
% OBservaciones:
% 1. Use fft e ifft
% 2. Use fftshift para obtener las graficas bilaterales
subplot(4,2,2) % magnitud
stem(linspace(-N/2,N/2-1,N), abs(fftshift(X))) % aplicacion de
fftshift para la obtencion del espectro bilateral
1
title ('Espectro de magnitud Bilateral')
xlabel('k')
ylabel('mod[X[k]]')
subplot(4,2,3) %fase
stem(linspace(-N/2,N/2-1,N), angle(fftshift(X)))
title ('Espectro de fase bilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,4)
stem(linspace(0, Fs/2, floor(N/2)+1), 2*abs(X_unilateral)) % grafica
unilateral
title ('Espectro de magnitud unilateral')
xlabel('k')
ylabel('Mod[X[k]]')
subplot(4,2,5)
stem(linspace(0, Fs/2, floor(N/2)+1), 2*angle(X_unilateral))
title ('Espectro de fase unilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,6)
stem(linspace(-N/2,N/2-1,N), real(fftshift(X))) %N par
title ('Parte real bilateral')
xlabel('k')
ylabel('Re[X[k]]')
subplot(4,2,7)
stem(linspace(-N/2,N/2-1,N), imag(fftshift(X))) %N par
title ('Parte imaginaria bilateral')
xlabel('k')
ylabel('Imag[X[k]]')
x_ifft=ifft(X)*N;
subplot(4,2,8)
stem(t(1:64), x_ifft(1:64))
title ('Señal en tiempo calculada con ifft')
xlabel('t')
axis([-3 68 0 1.2])
2
x[n] = 1 para N = 64
clear all
close all
clc
N = 64;
n = 0:N-1;
k=n;
Fs=1;
t=n*Fs;
x = ones(1,N);
X = fft(x)/N;
X_unilateral=X(1:floor(N/2)+1);
subplot(4,2,1)
stem(n, x)
title ('Señal en tiempo x[n]')
xlabel('n')
subplot(4,2,2)
stem(linspace(-N/2,N/2-1,N), abs(fftshift(X)))
title ('Espectro de magnitud Bilateral')
xlabel('k')
ylabel('mod[X[k]]')
subplot(4,2,3)
stem(linspace(-N/2,N/2-1,N), angle(fftshift(X)))
title ('Espectro de fase bilateral')
3
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,4)
stem(linspace(0, Fs/2, floor(N/2)+1), abs(X_unilateral))
title ('Espectro de magnitud unilateral')
xlabel('k')
ylabel('Mod[X[k]]')
axis([-1 0.7 0 1.2])
subplot(4,2,5)
stem(linspace(0, Fs/2, floor(N/2)+1), angle(X_unilateral))
title ('Espectro de fase unilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,6)
stem(linspace(-N/2,N/2-1,N), real(fftshift(X))) %N par
title ('Parte real bilateral')
xlabel('k')
ylabel('Re[X[k]]')
subplot(4,2,7)
stem(linspace(-N/2,N/2-1,N), imag(fftshift(X))) %N par
title ('Parte imaginaria bilateral')
xlabel('k')
ylabel('Imag[X[k]]')
x_ifft=ifft(X)*N;
subplot(4,2,8)
stem(t(1:64), x_ifft(1:64))
title ('Señal en tiempo calculada con ifft')
xlabel('t')
4
x[n] = 3cos(2\pi n/16) para N=64
clear all
close all
clc
N = 64;
n = 0:N-1;
k=n;
Fs=1;
t=n*Fs;
x = 3*cos(2*pi*n/16);
X = fft(x)/N;
X_unilateral=X(1:floor(N/2)+1);
subplot(4,2,1)
stem(n, x)
title ('Señal en tiempo x[n]')
xlabel('n')
subplot(4,2,2)
stem(linspace(-N/2,N/2-1,N), abs(fftshift(X))) %N par
title ('Espectro de magnitud Bilateral')
xlabel('k')
ylabel('mod[X[k]]')
subplot(4,2,3)
stem(linspace(-N/2,N/2-1,N), angle(fftshift(X))) %N par
title ('Espectro de fase bilateral')
5
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,4)
stem(linspace(0, Fs/2, floor(N/2)+1), 2*abs(X_unilateral))
title ('Espectro de magnitud unilateral')
xlabel('k')
ylabel('Mod[X[k]]')
subplot(4,2,5)
stem(linspace(0, Fs/2, floor(N/2)+1), 2*angle(X_unilateral))
title ('Espectro de fase unilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,6)
stem(linspace(-N/2,N/2-1,N), real(fftshift(X))) %N par
title ('Parte real bilateral')
xlabel('k')
ylabel('Re[X[k]]')
subplot(4,2,7)
stem(linspace(-N/2,N/2-1,N), imag(fftshift(X))) %N par
title ('Parte imaginaria bilateral')
xlabel('k')
ylabel('Imag[X[k]]')
x_ifft=ifft(X)*N;
subplot(4,2,8)
stem(t(1:64), x_ifft(1:64))
title ('Señal en tiempo calculada con ifft')
xlabel('t')
6
x[n] = 3cos(2\pi n/16 + \pi 3) para N=64
clear all
close all
clc
N = 64;
n = 0:N-1;
k=n;
Fs=1;
t=n*Fs;
x = 3*cos(2*pi*n/16 + 3*pi);
X = fft(x)/N;
X_unilateral=X(1:floor(N/2)+1);
subplot(4,2,1)
stem(n, x)
title ('Señal en tiempo x[n]')
xlabel('n')
subplot(4,2,2)
stem(linspace(-N/2,N/2-1,N), abs(fftshift(X))) %N par
title ('Espectro de magnitud Bilateral')
xlabel('k')
ylabel('mod[X[k]]')
subplot(4,2,3)
7
stem(linspace(-N/2,N/2-1,N), angle(fftshift(X))) %N par
title ('Espectro de fase bilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,4)
stem(linspace(0, Fs/2, floor(N/2)+1), 2*abs(X_unilateral))
title ('Espectro de magnitud unilateral')
xlabel('k')
ylabel('Mod[X[k]]')
subplot(4,2,5)
stem(linspace(0, Fs/2, floor(N/2)+1), 2*angle(X_unilateral))
title ('Espectro de fase unilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,6)
stem(linspace(-N/2,N/2-1,N), real(fftshift(X))) %N par
title ('Parte real bilateral')
xlabel('k')
ylabel('Re[X[k]]')
subplot(4,2,7)
stem(linspace(-N/2,N/2-1,N), imag(fftshift(X))) %N par
title ('Parte imaginaria bilateral')
xlabel('k')
ylabel('Imag[X[k]]')
x_ifft=ifft(X)*N;
subplot(4,2,8)
stem(t(1:64), x_ifft(1:64))
title ('Señal en tiempo calculada con ifft')
xlabel('t')
8
x[n] = 3cos(2\pi n/10) para N = 65 (ojo N es im-
par)
clear all
close all
clc
N = 65;
n = 0:N-1;
k=n;
Fs=1;
t=n*Fs; %vector de tiempo para la ifft
x = 3*cos(2*pi*n/10);
X = fft(x)/N;
X_unilateral=X(1:floor(N/2)+1); %formula general sea N par o impar
X_unilateral(2:end) = 2*X_unilateral(2:end); % al ser N impar no se
resta uno
subplot(4,2,1)
stem(n, x)
title ('Señal en tiempo x[n]')
xlabel('n')
subplot(4,2,2)
stem(k, abs(fftshift(X)))
title ('Espectro de magnitud Bilateral')
xlabel('k')
9
ylabel('mod[X[k]]')
subplot(4,2,3)
stem(k, angle(fftshift(X)))
title ('Espectro de fase bilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,4)
stem(linspace(0, Fs/2, floor(N/2)+1), abs(X_unilateral))
title ('Espectro de magnitud unilateral')
xlabel('k')
ylabel('Mod[X[k]]')
subplot(4,2,5)
stem(linspace(0, Fs/2, floor(N/2)+1), angle(X_unilateral))
title ('Espectro de fase unilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,6)
stem(k, real(fftshift(X)))
title ('Parte real bilateral')
xlabel('k')
ylabel('Re[X[k]]')
subplot(4,2,7)
stem(k, imag(fftshift(X)))
title ('Parte imaginaria bilateral')
xlabel('k')
ylabel('Imag[X[k]]')
x_ifft=ifft(X)*N;
subplot(4,2,8)
stem(t(1:65), x_ifft(1:65))
title ('Señal en tiempo calculada con ifft')
xlabel('t')
10
x[n] = 1 para 0 <= n <= 3. N = 65 (ojo N es im-
par)
clear all
close all
clc
N = 65;
n = linspace(0,3,65);
k=n;
Fs=1;
t=n*Fs;
x = ones(1,N);
X = fft(x)/N;
X_unilateral=X(1:floor(N/2)+1);
X_unilateral(2:end)=2*X_unilateral(2:end);
subplot(4,2,1)
stem(n, x)
title ('Señal en tiempo x[n]')
xlabel('n')
subplot(4,2,2)
stem(k, abs(fftshift(X)))
title ('Espectro de magnitud Bilateral')
xlabel('k')
ylabel('mod[X[k]]')
11
subplot(4,2,3)
stem(k, angle(fftshift(X)))
title ('Espectro de fase bilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,4)
stem(linspace(0, Fs/2, floor(N/2)+1), abs(X_unilateral))
title ('Espectro de magnitud unilateral')
xlabel('k')
ylabel('Mod[X[k]]')
axis([-1 0.7 0 1.2])
subplot(4,2,5)
stem(linspace(0, Fs/2, floor(N/2)+1), angle(X_unilateral))
title ('Espectro de fase unilateral')
xlabel('k')
ylabel('Arg[X[k]]')
subplot(4,2,6)
stem(k, real(fftshift(X)))
title ('Parte real bilateral')
xlabel('k')
ylabel('Re[X[k]]')
subplot(4,2,7)
stem(k, imag(fftshift(X)))
title ('Parte imaginaria bilateral')
xlabel('k')
ylabel('Imag[X[k]]')
x_ifft=ifft(X)*N;
subplot(4,2,8)
stem(t(1:65), x_ifft(1:65))
title ('Señal en tiempo calculada con ifft')
xlabel('t')
12
Published with MATLAB® R2018b
13