Add matlab file
This commit is contained in:
parent
fbe2a3f76f
commit
64e5d2d484
1 changed files with 54 additions and 0 deletions
54
theorie-signal/exercices/tp1.m
Normal file
54
theorie-signal/exercices/tp1.m
Normal file
|
@ -0,0 +1,54 @@
|
|||
% x1
|
||||
A = ;
|
||||
f0 = ;
|
||||
N = ; % nombre delements de la DSF
|
||||
fe = 50*N*f0;
|
||||
Tps = [0 :1/fe: 1-1/fe];
|
||||
a0 = 1/2;
|
||||
an = (2/(n*n*pi*pi))(-cos(n*pi) + 1)
|
||||
x = a0 * ones(1,length(Tps)); % a0 est a remplacer par la valeur calculee
|
||||
for n = 1:N
|
||||
x = x + a0 + an*cos(n*2*pi*f0*Tps);
|
||||
end
|
||||
figure
|
||||
plot(Tps,x);
|
||||
xlabel = "t"
|
||||
ylabel = "x(t)"
|
||||
Title = ""
|
||||
|
||||
% freqentielle
|
||||
X=fft(x);
|
||||
Frq = [];
|
||||
figure
|
||||
plot(Frq,abs(X));
|
||||
xlabel = "";
|
||||
ylabel = "";
|
||||
Title = "";
|
||||
|
||||
% x2
|
||||
A = ;
|
||||
r = ;
|
||||
f0 = ;
|
||||
N = ; % nombre delements de la DSF
|
||||
fe = 50*N*f0;
|
||||
Tps = [0 :1/fe: 1-1/fe];
|
||||
a0 = r;
|
||||
an = 2* (sin(n*pi*r))/(n*pi);
|
||||
x = a0 * ones(1,length(Tps)); % a0 est a remplacer par la valeur calculee
|
||||
for n = 1:N
|
||||
x = x + a0 + an*cos(n*2*pi*f0*Tps)+;
|
||||
end
|
||||
figure
|
||||
plot(Tps,x);
|
||||
xlabel = "t"
|
||||
ylabel = "x(t)"
|
||||
Title = ""
|
||||
|
||||
% freqentielle
|
||||
X=fft(x);
|
||||
Frq = [];
|
||||
figure
|
||||
plot(Frq,abs(X));
|
||||
xlabel = "";
|
||||
ylabel = "";
|
||||
Title = "";
|
Loading…
Reference in a new issue