Après mon merge héroïque
[valse.git] / reports / bazar Emilie / ondelettes.m
CommitLineData
3f62d540 1%Dessin ondelettes
2%script
3figure(1)
4courbe = X2(:,1)-mean(X2(:,1));
5[C,L] = wavedec(courbe, 4,'haar');
6
7subplot(6,1,1)
8plot(1:7,courbe(1:7),'b','LineWidth',2)
9axis([0 48 -1.6 1.6])
10hold on
11plot(8:48,courbe(8:48),'b','LineWidth',2)
12%plot(waverec([C(1:12)',zeros(1,36)],L,'haar'),'b--','LineWidth',2)
13%courbe2 = X2(:,1);
14%[C2,L2] = wavedec(courbe2,4,'haar');
15%plot(waverec([zeros(1,3),C2(4:12)',zeros(1,36)],L2,'haar'),'b-.','LineWidth',2)
16hold off
17ylabel('z','FontSize', 30)
18set(gca, 'FontSize', 20)
19subplot(6,1,2)
20A4=zeros(1,48);
21Coeff = zeros(5,48);
22for r=1:16
23 A4(r)=C(1)/power(2,5/2);
24 A4(r+16)=C(2)/power(2,5/2);
25 A4(r+32) = C(3)/power(2,5/2);
26end
27Coeff(5,8)=C(1);
28Coeff(5,24) = C(2);
29Coeff(5,40) = C(3);
30stairs(A4,'b','LineWidth',2)
31axis([0 48 -0.5 0.5])
32ylabel('A_4','FontSize', 30)
33set(gca, 'FontSize', 20)
34subplot(6,1,3)
35D4=zeros(1,48);
36for r=1:8
37 D4(r) = C(4)/power(2,4/2);
38 D4(r+8) = -C(4)/power(2,4/2);
39 D4(r+16) = C(5)/power(2,4/2);
40 D4(r+24) = -C(5)/power(2,4/2);
41 D4(r+32) = C(6)/power(2,4/2);
42 D4(r+40) = -C(6)/power(2,4/2);
43end
44Coeff(4,8) = C(4);
45Coeff(4,24) = C(5);
46Coeff(4,40) = C(6);
47stairs(D4,'b','LineWidth',2)
48axis([0 48 -0.9 0.9])
49ylabel('D_4','FontSize', 30)
50 set(gca, 'FontSize', 20)
51subplot(6,1,4)
52D3=zeros(1,48);
53for k=1:12
54 for r=1:4
55 D3(r+4*(k-1)) = (-1)^(k+1) *C(7+floor((k-1)/2))/power(2,3/2);
56 end
57end
58stairs(D3,'b','LineWidth',2)
59ylabel('D_3','FontSize', 30)
60axis([0 48 -0.5 0.5])
61 set(gca, 'FontSize', 20)
62subplot(6,1,5)
63D2=zeros(1,48);
64for k=1:24
65 for r=1:2
66 D2(r+2*(k-1)) = (-1)^(k+1) *C(13+floor((k-1)/2))/power(2,2/2);
67 end
68end
69stairs(D2,'b','LineWidth',2)
70ylabel('D_2','FontSize', 30)
71axis([0 48 -0.8 0.8])
72 set(gca, 'FontSize', 20)
73subplot(6,1,6)
74D1=zeros(1,48);
75for k=1:48
76 for r=1
77 D1(r+1*(k-1)) = (-1)^(k+1) *C(25+floor((k-1)/2))/power(2,1/2);
78 end
79end
80plot(D1,'b','LineWidth',2);
81axis([0 48 -0.9 0.9])
82ylabel('D_1','FontSize', 30)
83set(gca, 'FontSize', 20)