Move tp1 into its own dir, split matlab files
This commit is contained in:
parent
6d199e82ac
commit
5c07598316
8 changed files with 66 additions and 54 deletions
|
@ -1,54 +0,0 @@
|
|||
% 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));
|
||||
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));
|
||||
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 = "";
|
15
theorie-signal/exercices/tp1/Makefile
Normal file
15
theorie-signal/exercices/tp1/Makefile
Normal file
|
@ -0,0 +1,15 @@
|
|||
timestamp=$(shell date +%Y-%m-%d_%H:%M)
|
||||
|
||||
all: tp1
|
||||
|
||||
tp1: tp1.tex
|
||||
@latexmk -pdf tp1.tex
|
||||
@if ! cmp --silent build/tp1.pdf tp1_*.pdf; then \
|
||||
touch tp1_tmp.pdf; \
|
||||
rm tp1*.pdf; \
|
||||
cp build/tp1.pdf tp1_${timestamp}.pdf; \
|
||||
echo "Updated"; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
@rm -rf build 2>/dev/null
|
8
theorie-signal/exercices/tp1/x1_frequentiel.m
Normal file
8
theorie-signal/exercices/tp1/x1_frequentiel.m
Normal file
|
@ -0,0 +1,8 @@
|
|||
% x1 frequentiel
|
||||
X=fft(x);
|
||||
Frq = [];
|
||||
figure
|
||||
plot(Frq,abs(X));
|
||||
xlabel = "f";
|
||||
ylabel = "Sx1(f)";
|
||||
Title = "DSP de x1";
|
17
theorie-signal/exercices/tp1/x1_temporel.m
Normal file
17
theorie-signal/exercices/tp1/x1_temporel.m
Normal file
|
@ -0,0 +1,17 @@
|
|||
% x1 temporel
|
||||
f0 = 2;
|
||||
for N = [2,5,20,100]; % nombre delements de la DSF
|
||||
fe = 50*N*f0;
|
||||
Tps = [0 :1/fe: 1-1/fe];
|
||||
a0 = 1/2;
|
||||
x = a0 * ones(1,length(Tps));
|
||||
for n = 1:N
|
||||
an = (2/(n*pi)^2)*(-cos(n*pi) + 1);
|
||||
x = x + a0 + an*cos(n*2*pi*f0*Tps);
|
||||
end
|
||||
figure
|
||||
plot(Tps,x);
|
||||
xlabel = "t";
|
||||
ylabel = "x1(t)";
|
||||
Title = "DSF de x1";
|
||||
end
|
8
theorie-signal/exercices/tp1/x2_frequentiel.m
Normal file
8
theorie-signal/exercices/tp1/x2_frequentiel.m
Normal file
|
@ -0,0 +1,8 @@
|
|||
% x2 freqentiel
|
||||
X=fft(x);
|
||||
Frq = [];
|
||||
figure
|
||||
plot(Frq,abs(X));
|
||||
xlabel = "f";
|
||||
ylabel = "Sx2(f)";
|
||||
Title = "DSP de x2";
|
18
theorie-signal/exercices/tp1/x2_temporel.m
Normal file
18
theorie-signal/exercices/tp1/x2_temporel.m
Normal file
|
@ -0,0 +1,18 @@
|
|||
% x2 temporel
|
||||
r = 1/2;
|
||||
f0 = 2;
|
||||
for N = [2,5,20,100]; % nombre delements de la DSF
|
||||
fe = 50*N*f0;
|
||||
Tps = [0 :1/fe: 1-1/fe];
|
||||
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
|
||||
figure
|
||||
plot(Tps,x);
|
||||
xlabel = "t";
|
||||
ylabel = "x2(t)";
|
||||
Title = "DSF de x2";
|
||||
end
|
Loading…
Reference in a new issue