-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliasing.m
79 lines (68 loc) · 1.41 KB
/
aliasing.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
%% Echantillonage de g1000 et g2250
fig_g = figure('Name', 'Fonction g1000(t)');
plotg(1000)
saveas(fig_g, 'figures/fig_g1.png')
fig_g2 = figure('Name', 'Fonction g2250(t)');
plotg(2250)
saveas(fig_g2, 'figures/fig_g2.png')
%% Valeurs de f donnant un simple sinus
a = -5;
b = 5;
N = 32768;
Te = (b-a)/N;
fe = 1/Te;
range = a:Te:b-Te;
freq = -fe/2:fe/N:(fe/2 - fe/N);
nbPics = 0;
disp('Fréquences pour lesquelles gf(t) est un simple sinus')
for f=0:16380
g = gf(f, range);
spectre = imag(tfour(g));
%plot(freq, spectre)
nbPics = 0;
for i=1:N
if(abs(spectre(1,i)) >= 1)
nbPics = nbPics + 1;
end
if(nbPics > 2)
break
end
end
if(nbPics == 2)
disp(f)
end
%disp(nbPics)
end
%% Fréquences intéressantes
%plotg(8117)
%plotg(16309)
%3201.8
%3226.8
f16334 = figure('Name', 'Valeur de f donnant un simple sinus');
plotg(16334)
saveas(f16334, 'figures/fig_f16334.png')
f_sin = figure('Name', 'Repliement de spectre');
a = -5;
b = 5;
N = 32768;
Te = (b-a)/N;
fe = 1/Te;
range = a:Te:b-Te;
freq = -fe/2:fe/N:(fe/2 - fe/N);
f = 8142;
g = gf(f, range);
plot(range, g)
axis([-0.02 0.02 -5 5])
title('Fonction g(t)')
hold on
N = 0.5*32768;
Te = (b-a)/N;
fe = 1/Te;
range = a:Te:b-Te;
freq = -fe/2:fe/N:(fe/2 - fe/N);
g = gf(f, range);
plot(range, g)
axis([-0.02 0.02 -5 5])
title('Fonction g(t)')
hold off
saveas(f_sin, 'figures/fig_sin.png')