2022-01-06 23:32:52 +01:00
|
|
|
% x2 freqentiel
|
2022-01-06 23:59:42 +01:00
|
|
|
|
|
|
|
N = 20;
|
|
|
|
fe = 50*N*f0;
|
|
|
|
Tps = [0 :1/fe: 1-1/fe];
|
|
|
|
for r = [1/2,1/3,1/4]
|
|
|
|
a0 = r;
|
|
|
|
x = a0 * ones(1,length(Tps));
|
|
|
|
for n = 1:N
|
|
|
|
an = 2*sin(n*pi*r)/(n*pi);
|
|
|
|
x = x + a0 + an*cos(n*2*pi*f0*Tps);
|
|
|
|
end
|
|
|
|
X=fft(x);
|
|
|
|
Frq = [0 : fe/length(x) : fe - fe/length(x)];
|
|
|
|
figure
|
|
|
|
plot(Frq,abs(X));
|
|
|
|
xlabel = "f";
|
|
|
|
ylabel = "Sx2(f)";
|
|
|
|
Title = "DSP de x2";
|
|
|
|
end
|