diff options
author | Karl Berry <karl@freefriends.org> | 2012-03-13 22:39:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-03-13 22:39:05 +0000 |
commit | 649d975f9fdc7400e017fe94445d9faf338fa8df (patch) | |
tree | d282681dbe272cb6fd771f33b8bcc62259fab99b /Master/texmf-dist/doc/latex/vocaltract | |
parent | b92609b93bc7e9649fd001bd7a0c9585da130691 (diff) |
new pstricks package vocaltract (13mar12)
git-svn-id: svn://tug.org/texlive/trunk@25629 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/vocaltract')
9 files changed, 428 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/vocaltract/README b/Master/texmf-dist/doc/latex/vocaltract/README new file mode 100644 index 00000000000..adac23dfda8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/README @@ -0,0 +1,83 @@ +Vocal Tract Latex package +--------------------------- +by Dr. Dimitrios Ververidis + +The manuscript related to this package can be found on PRACTex journal 2012/1 +URL: http://dw.tug.org/pracjourn/2012-1/ververidis/ververidis.pdf + +Please cite as: + + "Dimitrios Ververidis, Daniel Schneider, and Joachim Koehler, "The vocal tract LATEX package," PracTeX journal, no 1, 2012." + +Package tested for Miktex 2.8 and 2.9 and Matlab 7.5 under Windows + + + +The software is licensed as FREE under APACHE 2.0 licence: +http://www.apache.org/licenses/LICENSE-2.0.html + + + +Using the package: +-------------------- + +Examples + +1st Example - Simple Figure from Latex compiling +------------------------------------------------- + + Create a figure in PS or PDF by compiling with latex the file: + + vtLatex_FigureDemo.tex + + +2nd Example - Animation from Latex compiling +--------------------------------------------- + + Create an animation in PDF by compiling with latex the file: + + vtLatex_AnimationDemo.tex + + +3rd Example - Simple Figure or Animation compiling from Matlab +-------------------------------------------------------------- + + Create a simple Figure or Animation by compiling from Matlab the function + + vtMainVisual.m + + as + >> vtMainVisual(VocalTractVecToTime, SWPDForBMP) + + where + + 1. "VocalTractVecToTime" is the CELL of vocal set up through time. See the codebook of german phonemes in the VocalTract.sty. + + For Example + + VocalTractVecToTime = ... + {[ 0.5, -2, 1 , -2 , 1, -1 , 0, 0, 0, 0], 'i' ; + [ 0.5, -2, 1 , -2 , 0, 2 , 0, 0, 0, 0], 'y(\"u)' ; + [-1 , -1, 1 , -2 , 1, -0.5, 0, 0, 0, 0], 'e' }; + + 2. "SWPDForBMP" is the string either 'bmp' or 'pdf' to define the output format. + + In case of 'bmp' the irfan view programm should be in current path. + From IrfanView two files are needed to be in current directory + 1. "i_view32.exe" and + 2. "/plugins/Postscript.dll" + Free download IrfanView from Irfan Skiljan, E-Mail: irfanview@gmx.net, http://www.irfanview.com + + +4th Example - Animation compiling from Matlab with phonemes as an input +------------------------------------------------------------------------ + + Create a PDF by compiling from Matlab + e.g. + + >> vtQueryVisual('zats') + + + + + diff --git a/Master/texmf-dist/doc/latex/vocaltract/vtLatex_AnimationDemo.tex b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_AnimationDemo.tex new file mode 100644 index 00000000000..c3a8bce5c8d --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_AnimationDemo.tex @@ -0,0 +1,36 @@ +%======================================= +% Vocal Tract Animation Demo +%======================================= +\documentclass{article} +\usepackage{VocalTract} +\pagestyle{empty} + +\begin{document} +%\input{vtLatex_TimeParams} % Use this file of Parameters otherwise I will use the codebook in Style file +\psset{yunit=1.5cm,xunit=1.5cm} +\begin{animateinline}[poster=first,loop,controls]{1}% +\multiframe{\Nframes}{IndexStepVocalTract=0+1}{ +\begin{pspicture}(0,-0.5)(6.5,8) +\def\BreathType{0.5} % Normal Breathing [0.1 to 0.9] +%=========== BreathTypeIncreaseLinearly ==== +%\FPset\accelerBreath{0.00556} +%\FPmul\BreathType\IndexStepVocalTract\accelerBreath +%\FPadd\BreathType\BreathType{0.1} +\SetOscAmp{\IndexStepVocalTract}{\BreathType} % For Breath +\UpdateRespOscillation % For Breath +\UpdateVocalTract{\IndexStepVocalTract} % Update Vocal Tract in the respective time +\VocalChords % Show VCords +\StomachCompartment % Show Stomach Compartment +\rput(1.75,7){\ShowPhonemesGerman{\IndexStepVocalTract}} % Show the phonemes transcriptions +\ShowPressure{\IndexStepVocalTract} % Show Pressure as Red Space +\rput(2,0){\ShowLinearTubes{\IndexStepVocalTract}\VocalChords} % The linear model next to the human +\rput(2.5,0){\ShowParameters} % Explain the parameters +%------------ Grid and Axes Labels -------------- +%\uput[45](0,8){$\times$ 10 cm} +%\uput[45](3,0){$\times$ 10 cm} +%\psgrid[gridcolor=blue,subgridcolor=gray,gridlabels=7pt,subgriddiv=10](0,0)(5,12) % subgriddiv=4,griddots=10, +%------------------------------------------------ +\end{pspicture} +} % Multiframe +\end{animateinline} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/vocaltract/vtLatex_AnimationLauncher.tex b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_AnimationLauncher.tex new file mode 100644 index 00000000000..329e01243d8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_AnimationLauncher.tex @@ -0,0 +1,35 @@ +%======================================= +% Vocal Tract Animation Launcher +%======================================= +\documentclass{article} +\usepackage{VocalTract} +\pagestyle{empty} + +\begin{document} +\input{vtLatex_TimeParams} % This is the file of Parameters generated by Matlab +\psset{yunit=2cm,xunit=2cm} +\begin{animateinline}[poster=first,loop,controls]{1}% +\multiframe{\Nframes}{IndexStepVocalTract=0+1}{ +\begin{pspicture*}(0cm,-2cm)(13cm,15.5cm) +\def\BreathType{0.5} % Normal Breathing [0.1 to 0.9] +%=========== BreathTypeIncreaseLinearly ==== +%\FPset\accelerBreath{0.00556} +%\FPmul\BreathType\IndexStepVocalTract\accelerBreath +%\FPadd\BreathType\BreathType{0.1} +\SetOscAmp{\IndexStepVocalTract}{\BreathType} % For Breath +\UpdateVocalTract{\IndexStepVocalTract} % Update Vocal Tract in the respective time +\VocalChords % Show VCords +\StomachCompartment % Show Stomach Compartment +\rput(3cm,14cm){\ShowPhonemesGerman{\IndexStepVocalTract}} % Show the phonemes transcriptions +\ShowPressure{\IndexStepVocalTract} % Show Pressure as Red Space +\rput(3cm,0cm){\ShowLinearTubes{\IndexStepVocalTract}\VocalChords} % The linear model next to the human +\rput(3.5cm,0cm){\ShowParameters} % Explain the parameters +%------------ Grid and Axes Labels -------------- +%\uput[45](0,8){$\times$ 10 cm} +%\uput[45](3,0){$\times$ 10 cm} +%\psgrid[gridcolor=blue,subgridcolor=gray,gridlabels=7pt,subgriddiv=10](0,0)(5,12) % subgriddiv=4,griddots=10, +%------------------------------------------------ +\end{pspicture*} +} % Multiframe +\end{animateinline} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureDemo.pdf b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureDemo.pdf Binary files differnew file mode 100644 index 00000000000..c6d81dc0d2a --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureDemo.pdf diff --git a/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureDemo.tex b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureDemo.tex new file mode 100644 index 00000000000..2359725be64 --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureDemo.tex @@ -0,0 +1,31 @@ +%============================================== +% Vocal Tract Figure Generator for PS or PDF +%============================================== +\documentclass{article} +\usepackage{VocalTract} +\pagestyle{empty} + +\begin{document} +%\input{vtLatex_TimeParams} % In case u want to store coordinates to a file +% or Alternative Use the inside codebook of vector in ".sty" file +\def\IndexStepVocalTract{13} % 13 corresponds to f +\psset{yunit=2cm,xunit=2cm} +\begin{pspicture*}(0cm,0cm)(13cm,18cm) +\def\BreathType{0.5} % Normal Breathing [0.1 to 0.9] +\SetOscAmp{\IndexStepVocalTract}{\BreathType} % For Breath +\UpdateRespOscillation % For Breath +\UpdateVocalTract{\IndexStepVocalTract} % Update Vocal Tract in the respective time +\VocalChords % Show VCords +\StomachCompartment % Show Stomach Compartment +%\PlotDotsVocal % Show some movable vocal tract points +\rput(3cm,14cm){\ShowPhonemesGerman{\IndexStepVocalTract}} % Show the phonemes transcriptions +\ShowPressure{\IndexStepVocalTract} % Show Pressure as Red Space +\rput(3cm,0cm){\ShowLinearTubes{\IndexStepVocalTract}\VocalChords} % The linear model next to the human +\rput(3.5cm,0cm){\ShowParameters} % Explain the parameters +%------------ Grid and Axes Labels -------------- +%\uput[45](0,8){$\times$ 10 cm} +%\uput[45](3,0){$\times$ 10 cm} +%\psgrid[gridcolor=blue,subgridcolor=gray,gridlabels=7pt,subgriddiv=10](0,0)(5,12) % subgriddiv=4,griddots=10, +%------------------------------------------------ +\end{pspicture*} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureLauncher.tex b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureLauncher.tex new file mode 100644 index 00000000000..eb0ed2c8b03 --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_FigureLauncher.tex @@ -0,0 +1,29 @@ +%======================================= +% Vocal Tract Figure Generator +%======================================= +\documentclass{article} +\usepackage{VocalTract} +\pagestyle{empty} + +\begin{document} +\input{vtLatex_TimeParams} % Parameters stored in a file +\def\IndexStepVocalTract{1} +\psset{yunit=2cm,xunit=2cm} +\begin{pspicture*}(0cm,0cm)(13cm,18cm) +\def\BreathType{0.5} % Normal Breathing [0.1 to 0.9] +\SetOscAmp{\IndexStepVocalTract}{\BreathType} % For Breath +\UpdateVocalTract{\IndexStepVocalTract} % Update Vocal Tract in the respective time +\VocalChords % Show VCords +\StomachCompartment % Show Stomach Compartment +%\PlotDotsVocal % Show movable vocal tract points +\rput(3cm,14cm){\ShowPhonemesGerman{\IndexStepVocalTract}} % Show the phonemes transcriptions +\ShowPressure{\IndexStepVocalTract} % Show Pressure as Red Space +\rput(3cm,0cm){\ShowLinearTubes{\IndexStepVocalTract}\VocalChords} % The linear model next to the human +\rput(3cm,0cm){\ShowParameters} % Explain the parameters +%------------ Grid and Axes Labels -------------- +%\uput[45](0,8){$\times$ 10 cm} +%\uput[45](3,0){$\times$ 10 cm} +%\psgrid[gridcolor=blue,subgridcolor=gray,gridlabels=7pt,subgriddiv=10](0,0)(5,12) % subgriddiv=4,griddots=10, +%------------------------------------------------ +\end{pspicture*} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/vocaltract/vtLatex_TimeParams.tex b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_TimeParams.tex new file mode 100644 index 00000000000..706036591be --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/vtLatex_TimeParams.tex @@ -0,0 +1 @@ +\newarray\SpeakVec\readarray{SpeakVec}{ 2.5&0&0&0.4&0&0&0&-1&0&0&z&-1.5&2.5&0&-0.5&0.5&-0.5&0&0&0&0&a&0&-0.5&-1&2.3&0&0&0&-3&-3&-3&t&2.5&0&0&0.4&0&0&0&-3&-3&-3&s& } \dataheight=11 \def\Nframes{5}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/vocaltract/vtMAINVisual.m b/Master/texmf-dist/doc/latex/vocaltract/vtMAINVisual.m new file mode 100644 index 00000000000..6356cb7f66b --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/vtMAINVisual.m @@ -0,0 +1,99 @@ +function vtMAINVisual(VocalTractVecToTime,SWPDForBMP) + +if nargin < 2 + SWPDForBMP = 'BMP'; % PDF, BMP + %======================================================================================== + % 1. Jaw Position 4. Tongue Apex 7. Larynx Height 10. Nasal Cavity + % 2. Tongue Position 5. Lip Aperture 8. Glottal Aperture 11. Phoneme Label + % 3. Tongue Shape 6. Lip Protrusion 9. Glottal Frequency + %======================================================================================== + % 1 2 3 4 5 6 7 8 9 10 11 + % JW TP TS TA LA LP LH GA FX NS + % 3 3 3 3 3 3 3 3 3 3 Max + % 0 0 0 0 0 0 0 0 0 0 Relax + % -3 3 -3 -3 -3 -3 -3 -3 -3 -3 Min + %======================================================================================== + VocalTractVecToTime = ... + {[ 0.5, -2, 1 , -2 , 1, -1 , 0, 0, 0, 0], 'i' ; + [ 0.5, -2, 1 , -2 , 0, 2 , 0, 0, 0, 0], 'y(\"u)' ; + [-1 , -1, 1 , -2 , 1, -0.5, 0, 0, 0, 0], 'e' }; +end + +% if you want a BMP Figure (not a PDF Animation) use first line +if strcmp(SWPDForBMP,'BMP') && size(VocalTractVecToTime,1)>1 + VocalTractVecToTime = VocalTractVecToTime(1,1:2); +end + + +NumberOfTimeFrames = size(VocalTractVecToTime,1); +VocalTractVecToTimeSTR = Mat2StrCustom(VocalTractVecToTime); + +%---------------- Add some commands before and after --------------- +LatexDefCommandsOfCordsPre = ['\newarray\SpeakVec' ... + '\readarray{SpeakVec}{']; + +LatexDefCommandsOfCordsPost = ['}'... + ' \dataheight=11' ... + ' \def\Nframes{' num2str(NumberOfTimeFrames+1) '}']; + +% %------- Create the Coordinates file ---------------- +fid = fopen('vtLatex_TimeParams.tex', 'w'); + +fwrite(fid,sprintf('%s %s %s',LatexDefCommandsOfCordsPre,... + VocalTractVecToTimeSTR,... + LatexDefCommandsOfCordsPost),'char'); +fclose(fid); + +%---------------- START the Compilers ----------------------------- + +if strcmp(SWPDForBMP,'BMP') + %-- tex2dvi + !latex -interaction=nonstopmode vtLatex_FigureLauncher.tex + %--- view dvi + %!"C:/Program Files/MiKTeX 2.8/miktex/bin/yap.exe" vtLatex_FigureLauncher.dvi + %--- dvi2ps + !dvips -o vtLatex_FigureLauncher.ps vtLatex_FigureLauncher.dvi + + %--- ps2bmp + strpwd = lower(pwd); + eval(['!i_view32.exe "' strpwd '\vtLatex_FigureLauncher.ps"' ... + ' /crop=(130,250,550,600) /convert="' ... + strpwd '\vtLatex_FigureLauncher.bmp" ']); + + %--- read and show + a = imread('vtLatex_FigureLauncher.bmp'); + imshow(a); +elseif strcmp(SWPDForBMP,'PDF') + %-- tex2dvi + !latex -interaction=nonstopmode vtLatex_AnimationLauncher.tex + %--- view dvi + %!"C:/Program Files/MiKTeX 2.8/miktex/bin/yap.exe" vtLatex_AnimationLauncher.dvi + %--- dvi2ps + !dvips -o vtLatex_AnimationLauncher.ps vtLatex_AnimationLauncher.dvi + %---- ps2pdf + !ps2pdf vtLatex_AnimationLauncher.ps + %--- view pdf + !AcroRd32.exe vtLatex_AnimationLauncher.pdf +end + + + + +%=================================================================== +% Matrix to a String Ordering with & intervening +%=================================================================== +function STR = Mat2StrCustom(Matr) + +R = size(Matr,1); +C = length(Matr{1,1}); + +STR = []; +for IndRow= 1:R + for IndCol = 1:C + STR = [STR num2str(Matr{IndRow,1}(IndCol)) '&']; + end + STR = [STR Matr{IndRow,2} '&']; +end +STR = STR(1:end-1); + + diff --git a/Master/texmf-dist/doc/latex/vocaltract/vtQueryVisual.m b/Master/texmf-dist/doc/latex/vocaltract/vtQueryVisual.m new file mode 100644 index 00000000000..f0b05abc9d9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/vocaltract/vtQueryVisual.m @@ -0,0 +1,114 @@ +function vtQueryVisual(STRQuery) + +%======================================================================================== +% 1. Jaw Position 4. Tongue Apex 7. Larynx Height 10. Nasal Cavity +% 2. Tongue Position 5. Lip Aperture 8. Glottal Aperture 11. Phoneme Label +% 3. Tongue Shape 6. Lip Protrusion 9. Glottal Frequency +%======================================================================================== +% 1 2 3 4 5 6 7 8 9 10 11 +% JW TP TS TA LA LP LH GA FX NS +% 3 3 3 3 3 3 3 3 3 3 Max +% 0 0 0 0 0 0 0 0 0 0 Relax +% -3 3 -3 -3 -3 -3 -3 -3 -3 -3 Min +%======================================================================================== +VocalTractVecToTimeCodeBook = ... + {[ 0.5, -2 , 1 ,-2 , 1 , -1 , 0 , 0, 0, 0], 'i' ; % 1 + [ 0.5, -2 , 1 ,-2 , 0 , 2 , 0 , 0, 0, 0], 'y' ; % 2 (\"u) + [-1 , -1 , 1 ,-2 , 1 ,-0.5 , 0 , 0, 0, 0], 'e' ; % 3 + [-1 , -1 , 1 ,-2 , 0 , 2 , 0 , 0, 0 , 0 ], '2' ; % 4 (\"o) + [-1.5, 2.5, 0 ,-0.5 , 0 , 2 , 0 , 0, 0 , 0 ], 'E' ; % 5 (\"a) + [-1.5, 1.5, 0 , 0.5 , 0.5, -0.5 , 0 , 0, 0 , 0 ], '@' ; % 6 (Schwa) + [-1.5, 2.5, 0 ,-0.5 , 0.5, -0.5 , 0 , 0, 0 , 0 ], 'a' ; % 7 + [0.5 , 2 , 1.5 ,-2 ,-1 , 1.5 , 0 , 0, 0 , 0 ], 'u' ; % 8 + [-0.4, 3.0, 1.5 , 0 ,-0.3, 0 , 0 , 0, 0 , 0 ], 'o' ; % 9 +... %-------------------------------------------------------------------Unvoiced Cons.-------- + [0 , 0 , 0 , 0 ,-3 , 0 , 0 ,-3 , -3 , -3 ], 'p' ; % 10 % UPlosives + [0 , -0.5 ,-1 , 2.3 , 0 , 0 , 0 ,-3 , -3 , -3 ], 't' ; % 11 + [0 , -1.5 , 3 , -3 , 0 , 0 , 0 ,-3 , -3 , -3 ], 'k' ; % 12 + [2 , 1 , 0 , 0 ,-1.5, -2 , 0 ,-3 , -3 , -3 ], 'f' ; % 13 % UFricatives + [2.5 , 0 , 0 , 0.4 , 0 , 0 , 0 ,-3 , -3 , -3 ], 's' ; % 14 + [0 , -1 , 3 , -3 , 0 , 0 , 0 ,-3 , -3 , -3 ], 'x' ; % 15 +...%----------------------------------------------------------------- Voiced Cons. -------- + [0 , 0 , 0 , 0 ,-3 , 0 ,-1 , -1 , 0 , -3 ], 'b' ; % 16 % VPlosives + [0 , -0.5 ,-1 , 2.3 , 0 , 0 , 0 , -1 , 0 , -3 ], 'd' ; % 17 + [0 , -1.5 , 3 , -3 , 0 , 0 , 0 , -1 , 0 , -3 ], 'g' ; % 18 + [1 , 0 , 0 , 3 , 0 , 0 , 0 , -1 , 0 , 0 ], 'r' ; % 19 % Rolled + [0 , -2 , 3 , 3 , 0 , 0 , 0 , -1 , 0 , 0 ], 'l' ; % 20 % Lateral + [0 , 2.3 , 2.5 , -2 , 0 , 0 , 0 , -1 , 0 , 0 ], 'R' ; % 21 % Approximants + [1 , 0 , 2 , 0 , 0 , 0 , 0 , -1 , 0 , 0 ], 'j' ; % 22 + [2 , 1 , 0 , 0 ,-1.5, -2 , 0 , -1 , 0 , 0 ], 'v' ; % 23 % VFricatives + [2.5 , 0 , 0 , 0.4 , 0 , 0 , 0 , -1 , 0 , 0 ], 'z' ; % 24 + [0 , 0 , 0 , 0 ,-3 , -1 , 0 , -1 , 0 , 0 ], 'm' ; % 25 % Nasals + [0.5 , 0 , 0 , 3 , 0 , 0 , 0 , -1 , 0 , 0 ], 'n' }; % 26 + + + +VocalTractVecToTime = FindVectorsFromCodeBook(VocalTractVecToTimeCodeBook, STRQuery); + +NumberOfTimeFrames = size(VocalTractVecToTime,1); +VocalTractVecToTimeSTR = Mat2StrCustom(VocalTractVecToTime); + +%---------------- Add some commands before and after --------------- +LatexDefCommandsOfCordsPre = ['\newarray\SpeakVec' ... + '\readarray{SpeakVec}{']; + +LatexDefCommandsOfCordsPost = ['}'... + ' \dataheight=11' ... + ' \def\Nframes{' num2str(NumberOfTimeFrames+1) '}']; + +% %------- Create the Coordinates file ---------------- +fid = fopen('vtLatex_TimeParams.tex', 'w'); + +fwrite(fid,sprintf('%s %s %s',LatexDefCommandsOfCordsPre,... + VocalTractVecToTimeSTR,... + LatexDefCommandsOfCordsPost),'char'); +fclose(fid); + +%---------------- START the Compilers ----------------------------- + %-- tex2dvi + !latex -interaction=nonstopmode vtLatex_AnimationLauncher.tex + %--- dvi2ps + !dvips -o vtLatex_AnimationLauncher.ps vtLatex_AnimationLauncher.dvi + %---- ps2pdf + !ps2pdf vtLatex_AnimationLauncher.ps + %--- view pdf + !AcroRd32 vtLatex_AnimationLauncher.pdf + + +%=================================================================== +% Matrix to a String Ordering with & intervening +%=================================================================== +function STR = Mat2StrCustom(Matr) + +R = size(Matr,1); +C = length(Matr{1,1}); + +STR = []; +for IndRow= 1:R + for IndCol = 1:C + STR = [STR num2str(Matr{IndRow,1}(IndCol)) '&']; + end + STR = [STR Matr{IndRow,2} '&']; +end +%STR = STR(1:end-1); + +%=================================================================== +% QUERY CODEBOOK +%=================================================================== +function OutVecs = FindVectorsFromCodeBook(InVecs, STRQuery) + +NPhonemes = length(STRQuery); + +NumericBookPhonemes = zeros(1,NPhonemes); + +BookOfPhonemes = InVecs(:,2); + +for iPhoneme = 1:NPhonemes, + NumericBookPhonemes(iPhoneme) = find(strcmp(BookOfPhonemes,STRQuery(iPhoneme))); +end + +OutVecs = InVecs(NumericBookPhonemes,:); +return + + + |