Documentos de Académico
Documentos de Profesional
Documentos de Cultura
function [y1,y2]=rotacion(n,a)
x1=rand(n);
y1=fft(x1)
if a==1
x2=rot90(x1,1)
elseif a==2
x2=rot90(x1,2)
elseif a==3
x2=rot90(x1,3)
end
y2=fft(x2)
figure(1)
plot(x2)
end
>> rotacion(2,3)
y1 =
1.9224
1.1282
-0.0074 -0.8130
x2 =
0.9649
0.9575
0.9706
0.1576
y2 =
1.9355
1.1151
-0.0057
0.7999
ans =
1.9224
1.1282
-0.0074 -0.8130
>>
function [y1,y2]=escalado(n)
m1=round(1+3*rand(n,1));
m2=round(2+5*rand(n,1));
m3=round(3+2*rand(n,1));
z1=zeros(n,2);
z2=zeros(n,2);
d1=[m1 z1 m2 z2 m3];
x1=[m1 m2 m3]
A1=d1(1:1,1:7);
A2=d1(2:2,1:7);
A3=d1(3:3,1:7);
z=zeros(2,n+4);
A=[A1;z];
B=[A2;z];
C=[A;B];
x2=[C;A3]
%******* Hallando las transformadas de furier ***********
X11=fft(x1)
y1=det(X11)
X22=fft(x2)
y2=det(X22)
x1 =
3
3
2
5
3
6
3
4
3
3
0
0
3
0
0
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
x2 =
5
0
0
3
0
0
6
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
0
4
0
0
3
X11 =
8.0000 + 0.0000i
0.5000 - 0.8660i
0.5000 + 0.8660i
14.0000 + 0.0000i
0.5000 + 2.5981i
0.5000 - 2.5981i
10.0000 + 0.0000i
-0.5000 - 0.8660i
-0.5000 + 0.8660i
y1 =
-0.0000 -72.7461i
X22 =
Columns 1 through 3
8.0000
1.5441
4.4254
0.5305
+
+
+
-
0.0000i
0.2620i
4.2954i
2.0570i
0.0000
0.0000
0.0000
0.0000
+
+
+
+
0.0000i
0.0000i
0.0000i
0.0000i
0.0000
0.0000
0.0000
0.0000
+
+
+
+
0.0000i
0.0000i
0.0000i
0.0000i
0.5305 + 2.0570i
4.4254 - 4.2954i
1.5441 - 0.2620i
0.0000 + 0.0000i
0.0000 + 0.0000i
0.0000 + 0.0000i
0.0000 + 0.0000i
0.0000 + 0.0000i
0.0000 + 0.0000i
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
Columns 4 through 6
14.0000
6.0380
5.5353
-1.0734
-1.0734
5.5353
6.0380
+
+
+
+
-
0.0000i
3.3893i
8.1951i
0.3215i
0.3215i
8.1951i
3.3893i
+
+
+
+
+
+
+
0.0000i
0.0000i
0.0000i
0.0000i
0.0000i
0.0000i
0.0000i
+
+
+
+
+
+
+
0.0000i
0.0000i
0.0000i
0.0000i
0.0000i
0.0000i
0.0000i
Column 7
10.0000
1.2666
4.8264
-0.5930
-0.5930
4.8264
1.2666
+
+
+
+
-
0.0000i
0.6100i
6.0521i
2.5981i
2.5981i
6.0521i
0.6100i
y2 =
0
ans =
-0.0000 -72.7461i
>>
3. Comprobar: PROPIEDAD DE RELLENADO CON CEROS en la
Transformada de Fourier
En este caso, la funcin generada ser [y1, y2]=rellenado(n,
n1) que intenta comprobar que con un rellenado con ceros se
mantiene el mismo espectro, aunque con mas muestras que el de
la imagen sin rellenar. Para su construccin habr que
efectuar las siguientes operaciones:
a) Crear una imagen aleatoria x1 de tamao nxn
b) Calcular su espectro y1.
>> rellenado(2,3)
x1 =
0
x2 =
0
Y1 =
4
-4
Y2 =
Columns 1 through 3
4.0000 + 0.0000i 5.0000 + 0.0000i 0.0000 + 0.0000i
2.0000 - 3.4641i 4.0000 - 1.7321i 0.0000 + 0.0000i
-2.0000 - 3.4641i 2.0000 - 1.7321i 0.0000 + 0.0000i
-4.0000 + 0.0000i 1.0000 + 0.0000i 0.0000 + 0.0000i
-2.0000 + 3.4641i 2.0000 + 1.7321i 0.0000 + 0.0000i
2.0000 + 3.4641i 4.0000 + 1.7321i 0.0000 + 0.0000i
Columns 4 through 6
>>