annotate aim-mat/tools/@signal/modtuningtilt.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 % method of class @signal
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
tomwalters@0 14
tomwalters@0 15 function sig=modtuningtilt(sig)
tomwalters@0 16
tomwalters@0 17 sig=antitilt(sig,0.04); % mache die Neigung rückgängig
tomwalters@0 18
tomwalters@0 19
tomwalters@0 20 sig=tilt(sig,0.08); % tilte, aber etwas weniger
tomwalters@0 21
tomwalters@0 22
tomwalters@0 23
tomwalters@0 24 vals=sig.werte;
tomwalters@0 25
tomwalters@0 26
tomwalters@0 27 cutoff=500; % Hz
tomwalters@0 28 drop=0.002; % Falle bis auf Null in 2 ms
tomwalters@0 29 durationtotilt=1/cutoff;
tomwalters@0 30
tomwalters@0 31 tiltstart=time2bin(sig,-durationtotilt); % Hier gehts los
tomwalters@0 32 tiltend=time2bin(sig,-durationtotilt+drop); % und hier hörts schon wieder auf
tomwalters@0 33 tiltnr=tiltend-tiltstart;
tomwalters@0 34 ti=linspace(1,0,tiltnr);
tomwalters@0 35
tomwalters@0 36 vals(tiltstart+1:tiltend)=vals(tiltstart+1:tiltend).*ti(:);
tomwalters@0 37 vals(tiltend:end)=0;
tomwalters@0 38 % figure
tomwalters@0 39 % subplot(2,1,1)
tomwalters@0 40 % plot(sig);
tomwalters@0 41 sig.werte=vals;
tomwalters@0 42 % subplot(2,1,2)
tomwalters@0 43 % plot(sig);
tomwalters@0 44