Mercurial > hg > audiostuff
comparison spandsp-0.0.3/spandsp-0.0.3/tests/echo_dump.m @ 5:f762bf195c4b
import spandsp-0.0.3
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 16:00:21 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4:26cd8f1ef0b1 | 5:f762bf195c4b |
---|---|
1 % echo_dump.m | |
2 % David Rowe 23 Dec 2006 | |
3 % | |
4 % Plots echo can dump file values | |
5 | |
6 load dump.txt | |
7 load level.txt | |
8 st = 1; | |
9 en = length(dump); | |
10 %st=8000*0+1; en=8000*2; | |
11 tx = dump(st:en,1); | |
12 rx = dump(st:en,2); | |
13 ec = dump(st:en,4); | |
14 Ltx = dump(st:en,5); | |
15 Lrx = dump(st:en,6); | |
16 Lec = dump(st:en,7); | |
17 dtd = -9900 + 800*dump(st:en,8); | |
18 adapt = -9900 + 800*dump(st:en,9); | |
19 Lbgec = dump(st:en,10); | |
20 | |
21 figure(1); | |
22 plot(tx,"r;tx;", rx,"g;rx;", ec,"b;ec;", dtd,"g;dtd;"); | |
23 %plot(tx,"r;tx;", rx,"g;rx;", dtd,"w;dtd;"); | |
24 axis([0 en-st -1E4 1E4]); | |
25 | |
26 %__gnuplot_set__ terminal png size 450,338 | |
27 %__gnuplot_set__ output "~/Desktop/fxo_oslec.png" | |
28 %__gnuplot_set__ terminal png size 800,600 | |
29 %__gnuplot_set__ output "~/Desktop/fxo_oslec_large.png" | |
30 %replot; | |
31 | |
32 LtxdB = 20*log10(Ltx+1); | |
33 LrxdB = 20*log10(Lrx+1); | |
34 LecdB = 20*log10(Lec+1); | |
35 LbgecdB = 20*log10(Lbgec+1); | |
36 | |
37 figure(2); | |
38 plot(LtxdB,"r;LtxdB;", LrxdB,"g;LrxdB;", LtxdB-LrxdB,"w;LtxdB-LrxdB;", LtxdB-LecdB,"b;LtxdB-LecdB;", 80+5*dump(st:en,9), "w;adapt;", LtxdB-LbgecdB,"c;LtxdB-LbgecdB;", 90+5*dump(st:en,8), "r;dtd;"); | |
39 axis([0 en-st 0 100]); | |
40 grid; | |
41 | |
42 %__gnuplot_set__ terminal png size 800,600 | |
43 %__gnuplot_set__ output "~/Desktop/levels.png" | |
44 %replot; | |
45 | |
46 figure(3); | |
47 LRin = level(st:en,1); | |
48 LSin = level(st:en,2); | |
49 LSout = level(st:en,3); | |
50 LSgen = level(st:en,4); | |
51 axis([0 en-st -100 0]); | |
52 plot(LRin,"r;LRindB;", LSin,"g;LSindB;", LSout,"w;LSoutdB;", LSgen,"b;LSgendB;"); | |
53 | |
54 figure(4) | |
55 plot(dump(st:en,11), "r;Pstates;") | |
56 axis | |
57 figure(5) | |
58 plot(dump(st:en,12), "g;factor;") | |
59 figure(6) | |
60 plot(dump(st:en,13), "g;shift;") |