#include <syllable.h>
Collaboration diagram for syllable:
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<phon> | phonVec |
the phones the syllable consists of. | |
uint | phonNum |
number of phones. | |
uint | meanF0 |
avr. val of all f0Vals. | |
ACCENT_TYPE | accent |
type of stress. |
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.
00139 {phonNum=0;} |
|
returns the strss type.
00073 {return accent;} |
|
returns average F0 of all F0-Vals from voiced phones in syllable (debugging).
00080 { 00081 return meanF0; 00082 } |
|
returns num of phones.
00076 { 00077 return phonNum; 00078 } |
|
returns list of phones.
00072 { 00073 return phonVec; 00074 } |
|
appends new phon at end of phonVec, sideeffect: increments phonNum;.
00033 { 00034 00035 phonVec.push_back(newPhon); 00036 phonNum++; 00037 00038 } |
|
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 } |
|
change the mean Intensity by dBVal. affects only vowels
00118 { 00119 for (uint pho=0; pho<phonNum; pho++) 00120 phonVec[pho].changeAvrInt(dBVal); 00121 } |
|
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
00108 { 00109 for (uint pho=0; pho<phonNum; pho++) 00110 phonVec[pho].changeF0Range(rate, meanF0); 00111 calcMeanF0(); 00112 } |
|
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
00103 { 00104 for (uint pho=0; pho<phonNum; pho++) 00105 phonVec[pho].changeF0Range(rate, mean); 00106 calcMeanF0(); 00107 } |
|
raise or lower f0-contour by rate in percent.
00113 { 00114 for (uint pho=0; pho<phonNum; pho++) 00115 phonVec[pho].changeMeanF0(rate); 00116 calcMeanF0(); 00117 } |
|
clears list of phons sideeffect: phonNum=0.
00097 { 00098 phonVec.erase(phonVec.begin(), phonVec.end()); 00099 phonNum = 0; 00100 } |
|
erases phone at location loc sideeffect: changes phonNum.
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 } |
|
returns phone at location loc.
|
|
prints names of phons to outFile (debugging).
00026 { 00027 for (unsigned int i=0; i<phonVec.size(); i++) { 00028 phonVec[i].printName(outFile); 00029 outFile << " "; 00030 } 00031 } |
|
replaces phone at location loc.
00040 { 00041 if (phonNum > loc) { 00042 phonVec[loc] = newPhon; 00043 } else { 00044 error ("attempt to replace nonexistent phone in syllable\n", -3); 00045 } 00046 } |
|
sets the strss type to accent.
00066 {accent = newAccent;} |
|
type of stress.
|
|
avr. val of all f0Vals.
|
|
number of phones.
|
|
the phones the syllable consists of.
|