cosmetics
[valse.git] / reports / bazar_Emilie / ondelettes.m
1 %Dessin ondelettes
2 %script
3 figure(1)
4 courbe = X2(:,1)-mean(X2(:,1));
5 [C,L] = wavedec(courbe, 4,'haar');
6
7 subplot(6,1,1)
8 plot(1:7,courbe(1:7),'b','LineWidth',2)
9 axis([0 48 -1.6 1.6])
10 hold on
11 plot(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)
16 hold off
17 ylabel('z','FontSize', 30)
18 set(gca, 'FontSize', 20)
19 subplot(6,1,2)
20 A4=zeros(1,48);
21 Coeff = zeros(5,48);
22 for 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);
26 end
27 Coeff(5,8)=C(1);
28 Coeff(5,24) = C(2);
29 Coeff(5,40) = C(3);
30 stairs(A4,'b','LineWidth',2)
31 axis([0 48 -0.5 0.5])
32 ylabel('A_4','FontSize', 30)
33 set(gca, 'FontSize', 20)
34 subplot(6,1,3)
35 D4=zeros(1,48);
36 for 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);
43 end
44 Coeff(4,8) = C(4);
45 Coeff(4,24) = C(5);
46 Coeff(4,40) = C(6);
47 stairs(D4,'b','LineWidth',2)
48 axis([0 48 -0.9 0.9])
49 ylabel('D_4','FontSize', 30)
50 set(gca, 'FontSize', 20)
51 subplot(6,1,4)
52 D3=zeros(1,48);
53 for 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
57 end
58 stairs(D3,'b','LineWidth',2)
59 ylabel('D_3','FontSize', 30)
60 axis([0 48 -0.5 0.5])
61 set(gca, 'FontSize', 20)
62 subplot(6,1,5)
63 D2=zeros(1,48);
64 for 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
68 end
69 stairs(D2,'b','LineWidth',2)
70 ylabel('D_2','FontSize', 30)
71 axis([0 48 -0.8 0.8])
72 set(gca, 'FontSize', 20)
73 subplot(6,1,6)
74 D1=zeros(1,48);
75 for 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
79 end
80 plot(D1,'b','LineWidth',2);
81 axis([0 48 -0.9 0.9])
82 ylabel('D_1','FontSize', 30)
83 set(gca, 'FontSize', 20)