Mercurial > hg > aimmat
annotate aim-mat/tools/show_pitch_spiral.m @ 4:537f939baef0 tip
various bug fixes and changed copyright message
author | Stefan Bleeck <bleeck@gmail.com> |
---|---|
date | Tue, 16 Aug 2011 14:37:17 +0100 |
parents | 20ada0af3d7d |
children |
rev | line source |
---|---|
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 % This external file is included as part of the 'aim-mat' distribution package |
bleeck@3 | 9 % (c) 2011, University of Southampton |
bleeck@3 | 10 % Maintained by Stefan Bleeck (bleeck@gmail.com) |
bleeck@3 | 11 % download of current version is on the soundsoftware site: |
bleeck@3 | 12 % http://code.soundsoftware.ac.uk/projects/aimmat |
bleeck@3 | 13 % documentation and everything is on http://www.acousticscale.org |
bleeck@3 | 14 |
tomwalters@0 | 15 |
tomwalters@0 | 16 function show_pitch_spiral(frame) |
tomwalters@0 | 17 |
tomwalters@0 | 18 cls; |
tomwalters@0 | 19 s=getallnotes; |
tomwalters@0 | 20 |
tomwalters@0 | 21 min_fre=abs(1000/frame.time_minus); |
tomwalters@0 | 22 max_fre=abs(1000/frame.time_plus); |
tomwalters@0 | 23 max_fre=2000; |
tomwalters@0 | 24 |
tomwalters@0 | 25 sp=spiral(min_fre,max_fre); |
tomwalters@0 | 26 sp=adddots(sp,s); |
tomwalters@0 | 27 |
tomwalters@0 | 28 frame.search_type='best_n'; |
tomwalters@0 | 29 frame.nr_search_maxima=50; |
tomwalters@0 | 30 |
tomwalters@0 | 31 [pitches,s]=findpitch(frame); |
tomwalters@0 | 32 |
tomwalters@0 | 33 sp=adddots(pitches,s); |
tomwalters@0 | 34 plot(sp); |
tomwalters@0 | 35 set(gca,'Position',[0 0.2 1 0.8]); |
tomwalters@0 | 36 % |
tomwalters@0 | 37 % % and the sum |
tomwalters@0 | 38 rect=[-0.04 0 1 0.2]; |
tomwalters@0 | 39 mysubplot(1,1,1,rect,1); |
tomwalters@0 | 40 |
tomwalters@0 | 41 nr_bins=24; |
tomwalters@0 | 42 tones=pitch_radar(sp,nr_bins); % here it is calculated |
tomwalters@0 | 43 h=plot(tones,'.-'); |
tomwalters@0 | 44 set(gca,'yticklabel','') |
tomwalters@0 | 45 axis([0.5 nr_bins+0.5 0 3]); |
tomwalters@0 | 46 tix=1:nr_bins/12:nr_bins; |
tomwalters@0 | 47 ti=['a ';'a#';'h ';'c ';'c#';'d ';'d#';'e ';'f ';'f#';'g ';'g#']; |
tomwalters@0 | 48 set(gca,'XTick',tix); |
tomwalters@0 | 49 set(gca,'XTickLabel',ti); |
tomwalters@0 | 50 |
tomwalters@0 | 51 |
tomwalters@0 | 52 return; |