Bonjour
J'ai realisé l'étape décrite dans la discussion : http://www.developpez.net/forums/d33...lettes-matlab/. Mais comment faire pour compresser un signal par cette méthode des ondelettes ?

voila ce que j'ai fait pour le moment.
Merci


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
fid1 = fopen('sig.txt', 'r');
V1=fscanf(fid1,'%f', [1 Inf]);
  figure (1); plot(V1)
title('sig');
N = length(V1) ;
[c,l]=wavedec(V1,4,'db2');
ap4=appcoef(c,l,'db2',4);
ap3=appcoef(c,l,'db2',3);
ap2=appcoef(c,l,'db2',2);
ap1=appcoef(c,l,'db2',1);
[d1,d2,d3,d4] = detcoef(c,l,[1 2 3 4]);
figure (2) ;
subplot(4,2,1) ; plot(ap1)
title('ap1')
subplot(4,2,2) ; plot(d1)
title('d1')
subplot(4,2,3) ; plot(ap2)
title('ap2')
subplot(4,2,4) ; plot(d2)
title('d2')
subplot(4,2,5) ; plot(ap3)
title('ap3')
subplot(4,2,6) ; plot(d3)
title('d3')
subplot(4,2,7) ; plot(ap4)
title('ap4')
subplot(4,2,8) ; plot(d4)
title('d4')
recap1=wrcoef('a',c,l,'db2',1) ;
title('recap1')
recap2=wrcoef('a',c,l,'db2',2) ;
title('recap2')
recap3=wrcoef('a',c,l,'db2',3) ;
title('recap3')
recd1=wrcoef('d',c,l,'db2',1) ;
title('recd1')
recd2=wrcoef('d',c,l,'db2',2) ;
title('recd2')
recd3=wrcoef('d',c,l,'db2',3) ;
title('recd3')
figure(3) ;
subplot(6,1,1) ; plot(recap3); title('approximation a1');
subplot(6,1,2) ; plot(recap3); title('approximation a2');
subplot(6,1,3) ; plot(recap3); title('approximation a3');
subplot(6,1,4) ; plot(recd1); title('details d1');
subplot(6,1,5) ; plot(recd2); title('details d2');
subplot(6,1,6) ; plot(recd3); title('details d3');
rec=waverec(c,l,'db2');
figure (4);
plot(rec);
 err= (V1-rec) ;
figure(5) ;plot(err)