tomwalters@0
|
1 % tool
|
tomwalters@0
|
2 %
|
tomwalters@0
|
3 % INPUT VALUES:
|
tomwalters@0
|
4 %
|
tomwalters@0
|
5 % RETURN VALUE:
|
tomwalters@0
|
6 %
|
tomwalters@0
|
7 %
|
bleeck@3
|
8 % (c) 2011, University of Southampton
|
bleeck@3
|
9 % Maintained by Stefan Bleeck (bleeck@gmail.com)
|
bleeck@3
|
10 % download of current version is on the soundsoftware site:
|
bleeck@3
|
11 % http://code.soundsoftware.ac.uk/projects/aimmat
|
bleeck@3
|
12 % documentation and everything is on http://www.acousticscale.org
|
bleeck@3
|
13
|
tomwalters@0
|
14
|
tomwalters@0
|
15 function cdat=coolregion(current_frame,cdat,peak)
|
tomwalters@0
|
16
|
tomwalters@0
|
17 % Ich geh von einer Colormap aus, die Farben pro Wert zwischen 0 und 1
|
tomwalters@0
|
18 % unterschiedlich darstellt. 0=schwarz, und dann z.B zirkeln wie in prism
|
tomwalters@0
|
19
|
tomwalters@0
|
20
|
tomwalters@0
|
21
|
tomwalters@0
|
22 fre_val=peak.spektral_profile.position;
|
tomwalters@0
|
23 int_val=peak.interval_profile.position;
|
tomwalters@0
|
24
|
tomwalters@0
|
25 % current_frame_handle=peak.current_frame_handle;
|
tomwalters@0
|
26
|
tomwalters@0
|
27 vals=getvalues(current_frame);
|
tomwalters@0
|
28 % cdat=get(current_frame_handle,'cdata');
|
tomwalters@0
|
29 % erst mal alle erhaltenen Werte auf Null setzen
|
tomwalters@0
|
30 ca=cdat;
|
tomwalters@0
|
31
|
tomwalters@0
|
32 % wie weit die spektrale Summe runterskaliert werden muss, damit die Zahlen vernünftigt werden
|
tomwalters@0
|
33 norm_spektralhight=1.5/1e5;
|
tomwalters@0
|
34 fresumme=getfrequencysum(current_frame);
|
tomwalters@0
|
35 fresumme=fresumme*norm_spektralhight;
|
tomwalters@0
|
36 gauss=signal(fresumme);
|
tomwalters@0
|
37 maxmaxpos=fre_val;
|
tomwalters@0
|
38 maxmaxhight=1;
|
tomwalters@0
|
39 sigma=peak.spektral_profile.sigma;
|
tomwalters@0
|
40 gauss=generategauss(gauss,maxmaxpos,maxmaxhight,sigma);
|
tomwalters@0
|
41
|
tomwalters@0
|
42
|
tomwalters@0
|
43 from_fre=fre_val-sigma;
|
tomwalters@0
|
44 to_fre=fre_val+sigma;
|
tomwalters@0
|
45 maxbin=length(cdat);
|
tomwalters@0
|
46 minbin=1;
|
tomwalters@0
|
47 maxchan=getnrchannels(current_frame);
|
tomwalters@0
|
48 minchan=1;
|
tomwalters@0
|
49
|
tomwalters@0
|
50 from_fre=min(from_fre,maxchan);
|
tomwalters@0
|
51 from_fre=max(from_fre,minchan);
|
tomwalters@0
|
52 to_fre=max(to_fre,minchan);
|
tomwalters@0
|
53 to_fre=min(to_fre,maxchan);
|
tomwalters@0
|
54 sr=getsr(current_frame);
|
tomwalters@0
|
55
|
tomwalters@0
|
56 for i=from_fre:to_fre
|
tomwalters@0
|
57 sig=getsinglechannel(current_frame,i);
|
tomwalters@0
|
58 [maxpos,minpos,maxs,mins]=getminmax(sig);
|
tomwalters@0
|
59
|
tomwalters@0
|
60 % Die Intervalle zwischen den Minima links und rechts vom Maximum werden eingefärbt
|
tomwalters@0
|
61 from_int=getminimumleftof(int_val,maxpos,minpos,maxs,mins);
|
tomwalters@0
|
62 to_int=getminimumrightof(int_val,maxpos,minpos,maxs,mins);
|
tomwalters@0
|
63 % frombin=displaytime2bin(current_frame,from_int);
|
tomwalters@0
|
64 % tobin=displaytime2bin(current_frame,to_int);
|
tomwalters@0
|
65 frombin=time2bin(from_int,sr);
|
tomwalters@0
|
66 tobin=time2bin(to_int,sr);
|
tomwalters@0
|
67 frombin=min(frombin,maxbin);
|
tomwalters@0
|
68 frombin=max(frombin,minbin);
|
tomwalters@0
|
69 tobin=max(tobin,minbin);
|
tomwalters@0
|
70 tobin=min(tobin,maxbin);
|
tomwalters@0
|
71
|
tomwalters@0
|
72 tob=floor(maxbin-frombin);
|
tomwalters@0
|
73 fromb=floor(maxbin-tobin+1);
|
tomwalters@0
|
74
|
tomwalters@0
|
75 % ca(fromb:tob,i)=getbinvalue(gauss,i)*peak.spektralhight;
|
tomwalters@0
|
76 ca(fromb:tob,i)=peak.source_color;
|
tomwalters@0
|
77 % ca(fromb:tob,i)=floor(rand(1)*10);
|
tomwalters@0
|
78 end
|
tomwalters@0
|
79
|
tomwalters@0
|
80 cdat=ca; |