tomwalters@0
|
1 % method of class @signal
|
tomwalters@0
|
2 % INPUT VALUES:
|
tomwalters@0
|
3 % RETURN VALUE:
|
tomwalters@0
|
4 % sig: @signal
|
tomwalters@0
|
5 %
|
bleeck@3
|
6 % This external file is included as part of the 'aim-mat' distribution package
|
bleeck@3
|
7 % (c) 2011, University of Southampton
|
bleeck@3
|
8 % Maintained by Stefan Bleeck (bleeck@gmail.com)
|
bleeck@3
|
9 % download of current version is on the soundsoftware site:
|
bleeck@3
|
10 % http://code.soundsoftware.ac.uk/projects/aimmat
|
bleeck@3
|
11 % documentation and everything is on http://www.acousticscale.org
|
bleeck@3
|
12
|
tomwalters@0
|
13
|
tomwalters@0
|
14 function sig=complexfilter(sig,formant_fre,formant_fre_width,formant_amp)
|
tomwalters@0
|
15 % creates an vocal by filtering the signal (wich probably is a clicktrain)
|
tomwalters@0
|
16 % in different formants
|
tomwalters@0
|
17
|
tomwalters@0
|
18 nr_formants=length(formant_fre);
|
tomwalters@0
|
19
|
tomwalters@0
|
20 for i=1:nr_formants
|
tomwalters@0
|
21 fre=formant_fre(i);
|
tomwalters@0
|
22 wid=formant_fre_width(i);
|
tomwalters@0
|
23 fsig(i)=bandpass(sig,fre-wid,fre+wid,wid/10);
|
tomwalters@0
|
24 % play(fsig(i));
|
tomwalters@0
|
25 end
|
tomwalters@0
|
26 % plot(powerspectrum(fsig(1)),[10,13000],'b')
|
tomwalters@0
|
27 % hold on
|
tomwalters@0
|
28 % plot(powerspectrum(fsig(2)),[10,13000],'r')
|
tomwalters@0
|
29 % plot(powerspectrum(fsig(3)),[10,13000],'g')
|
tomwalters@0
|
30 % plot(powerspectrum(fsig(4)),[10,13000],'c')
|
tomwalters@0
|
31
|
tomwalters@0
|
32 sumsig=fsig(1)*formant_amp(1);
|
tomwalters@0
|
33 for i=2:nr_formants
|
tomwalters@0
|
34 sumsig=sumsig+fsig(i)*formant_amp(i);
|
tomwalters@0
|
35 end
|
tomwalters@0
|
36 % plot(powerspectrum(sumsig),[10,13000],'k')
|
tomwalters@0
|
37 sig=sumsig;
|