Main Page   Compound List   File List   Compound Members   File Members   Related Pages  

syllable Class Reference

a syllable manages a list of phones. More...

#include <syllable.h>

Collaboration diagram for syllable:

Collaboration graph

[legend]
List of all members.

Public Methods

void setAccent (ACCENT_TYPE newAccent)
 sets the strss type to accent. More...

ACCENT_TYPE Accent ()
 returns the strss type. More...

void addPhon (phon newPhon)
 appends new phon at end of phonVec, sideeffect: increments phonNum;. More...

void replacePhon (phon newPhon, uint loc)
 replaces phone at location loc. More...

void erasePhon (uint loc)
 erases phone at location loc sideeffect: changes phonNum. More...

phon getPhon (uint loc)
 returns phone at location loc. More...

void printPhonVec (ostream &outFile)
 prints names of phons to outFile (debugging). More...

vector<phon>& PhonVec ()
 returns list of phones. More...

uint MeanF0 ()
 returns average F0 of all F0-Vals from voiced phones in syllable (debugging). More...

void calcMeanF0 ()
 calculates the mean f0-value, should be done after intonation change.

uint PhonNum ()
 returns num of phones. More...

void clearPhonVec ()
 clears list of phons sideeffect: phonNum=0.

 syllable ()
 constructor.

void changeF0Range (uint rate, uint mean)
 change the f0-range with reference-value mean. More...

void changeF0Range (uint rate)
 change the f0-range. More...

void changeMeanF0 (uint rate)
 raise or lower f0-contour by rate in percent. More...

void changeAvrInt (int dBVal)
 change the mean Intensity by dBVal. More...


Private Attributes

vector<phonphonVec
 the phones the syllable consists of.

uint phonNum
 number of phones.

uint meanF0
 avr. val of all f0Vals.

ACCENT_TYPE accent
 type of stress.


Detailed Description

a syllable manages a list of phones.

It's needed because many rules can be expressed using syllables. In fact it would be nice to have an even higher concept, like accent would designate all the syllables around a stressed one containing an intonation group


Constructor & Destructor Documentation

syllable::syllable ( ) [inline]
 

constructor.

00139             {phonNum=0;}


Member Function Documentation

ACCENT_TYPE syllable::Accent ( ) [inline]
 

returns the strss type.

Returns:
ACCENT_TYPE accent
00073                        {return accent;}

uint syllable::MeanF0 ( )
 

returns average F0 of all F0-Vals from voiced phones in syllable (debugging).

Returns:
uint meanF0
00080                       {
00081   return meanF0;
00082 }

uint syllable::PhonNum ( )
 

returns num of phones.

Returns:
uint number of phones
00076                        {
00077   return phonNum;
00078 }

vector< phon >& syllable::PhonVec ( )
 

returns list of phones.

Returns:
vector<phon>
00072                                 {
00073   return phonVec;
00074 }

void syllable::addPhon ( phon newPhon )
 

appends new phon at end of phonVec, sideeffect: increments phonNum;.

Parameters:
phon   newPhon
00033                                    {
00034 
00035   phonVec.push_back(newPhon);
00036   phonNum++;
00037 
00038 }

void syllable::calcMeanF0 ( )
 

calculates the mean f0-value, should be done after intonation change.

00083                           {
00084   uint f0Sum=0, f0Num=0;
00085   for (uint i=0; i<phonVec.size(); i++) {
00086     if (phonVec[i].Voiced()) {
00087       for (uint j=0; j<phonVec[i].F0Vec().size(); j++) {
00088         f0Sum += phonVec[i].F0Vec()[j];
00089       }
00090       f0Num +=  phonVec[i].FrameNum();
00091     }
00092   }
00093   meanF0 = f0Num>0 ? (uint) f0Sum/f0Num : 0;
00094 }

void syllable::changeAvrInt ( int dBVal )
 

change the mean Intensity by dBVal.

affects only vowels

Parameters:
uint   dBVal
00118                                       {
00119   for (uint pho=0; pho<phonNum; pho++) 
00120     phonVec[pho].changeAvrInt(dBVal);
00121 }

void syllable::changeF0Range ( uint rate )
 

change the f0-range.

In fact all f0-values get expaned or compressed around syllable f0-mean, like in a contrast algorithm in fact all f0-values get expaned or compressed around the mean f0, like in a contrast algorithm

See also:
phon::changeF0Range()
Parameters:
uint   rate
00108                                        {
00109   for (uint pho=0; pho<phonNum; pho++) 
00110     phonVec[pho].changeF0Range(rate, meanF0);
00111   calcMeanF0();
00112 }

void syllable::changeF0Range ( uint rate,
uint mean )
 

change the f0-range with reference-value mean.

In fact all f0-values get expaned or compressed around reference value, like in a contrast algorithm

Parameters:
uint   rate gives the max amount of displacement (percent of distance between each val and reference)
uint   mean
00103                                                   {
00104   for (uint pho=0; pho<phonNum; pho++) 
00105     phonVec[pho].changeF0Range(rate, mean);
00106   calcMeanF0();
00107 }

void syllable::changeMeanF0 ( uint rate )
 

raise or lower f0-contour by rate in percent.

See also:
phrase::changeMeanF0() , phon::changeMeanF0()
Parameters:
uint   rate
00113                                       {
00114   for (uint pho=0; pho<phonNum; pho++) 
00115     phonVec[pho].changeMeanF0(rate);
00116   calcMeanF0();
00117 }

void syllable::clearPhonVec ( )
 

clears list of phons sideeffect: phonNum=0.

00097                             {
00098   phonVec.erase(phonVec.begin(), phonVec.end());
00099   phonNum = 0;
00100 }

void syllable::erasePhon ( uint loc )
 

erases phone at location loc sideeffect: changes phonNum.

Parameters:
uint   loc
00058                                  {
00059   vector <phon> tmpVec(0);
00060   if (loc >= phonNum|| loc < 0) 
00061     error ("attempt to erase nonexistent phone in syllable\n", -3);
00062   else {
00063     for (uint i=0; i<loc; i++)
00064       tmpVec.push_back(phonVec[i]);
00065     for (uint i=loc+1; i<phonNum; i++)
00066       tmpVec.push_back(phonVec[i]);
00067   }
00068   phonVec = tmpVec;
00069   phonNum--;
00070 }

phon syllable::getPhon ( uint loc )
 

returns phone at location loc.

Parameters:
uint   loc should be < phonNum
Returns:
phon
00048                                {
00049   phon returnPhon;
00050   if (phonNum > loc) {
00051     returnPhon = phonVec[loc];
00052   } else {
00053     error ("attempt to get nonexistent phone in syllable\n", -3);
00054   }
00055   return returnPhon;
00056 }

void syllable::printPhonVec ( ostream & outFile )
 

prints names of phons to outFile (debugging).

Parameters:
ostream   &outFile
00026                                             {
00027   for (unsigned int i=0; i<phonVec.size(); i++) {
00028     phonVec[i].printName(outFile);
00029     outFile << " ";
00030   }
00031 }

void syllable::replacePhon ( phon newPhon,
uint loc )
 

replaces phone at location loc.

Parameters:
phon   newPhon
uint   loc should be < phonNum
00040                                                  {
00041   if (phonNum > loc) {
00042     phonVec[loc] = newPhon;
00043   } else {
00044     error ("attempt to replace nonexistent phone in syllable\n", -3);
00045   }
00046 }

void syllable::setAccent ( ACCENT_TYPE newAccent ) [inline]
 

sets the strss type to accent.

Parameters:
ACCENT_TYPE   newAccent
00066                                         {accent = newAccent;}


Member Data Documentation

ACCENT_TYPE syllable::accent [private]
 

type of stress.

uint syllable::meanF0 [private]
 

avr. val of all f0Vals.

uint syllable::phonNum [private]
 

number of phones.

vector< phon > syllable::phonVec [private]
 

the phones the syllable consists of.


The documentation for this class was generated from the following files: generated by doxygen