manual_dwtools.cpp 313 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605
  1. /* manual_dwtools.cpp
  2. *
  3. * Copyright (C) 1993-2018 David Weenink
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*
  19. djmw 20020313 GPL
  20. djmw 20130620 Latest modification
  21. */
  22. #include "espeak_ng_version.h"
  23. #include "ManPagesM.h"
  24. #include "Sound_extensions.h"
  25. #include "TableOfReal_extensions.h"
  26. #include "Table_extensions.h"
  27. #include "Configuration.h"
  28. #include "Discriminant.h"
  29. static autoTableOfReal getStandardizedLogFrequencyPolsData (bool includeLevels) {
  30. autoTableOfReal me = TableOfReal_create_pols1973 (includeLevels);
  31. for (integer i = 1; i <= my numberOfRows; i ++) {
  32. for (integer j = 1; j <= 3; j++) {
  33. my data [i] [j] = log10 (my data [i] [j]);
  34. }
  35. }
  36. TableOfReal_standardizeColumns (me.get());
  37. TableOfReal_setColumnLabel (me.get(), 1, U"standardized log (%F__1_)");
  38. TableOfReal_setColumnLabel (me.get(), 2, U"standardized log (%F__2_)");
  39. TableOfReal_setColumnLabel (me.get(), 3, U"standardized log (%F__3_)");
  40. if (includeLevels) {
  41. TableOfReal_setColumnLabel (me.get(), 4, U"standardized %L__1_");
  42. TableOfReal_setColumnLabel (me.get(), 5, U"standardized %L__1_");
  43. TableOfReal_setColumnLabel (me.get(), 6, U"standardized %L__3_");
  44. }
  45. return me;
  46. }
  47. static void drawPolsF1F2_log (Graphics g) {
  48. autoTableOfReal me = getStandardizedLogFrequencyPolsData (0);
  49. Graphics_setWindow (g, -2.9, 2.9, -2.9, 2.9);
  50. TableOfReal_drawScatterPlot (me.get(), g, 1, 2, 0, 0, -2.9, 2.9, -2.9, 2.9, 10, 1, U"+", 1);
  51. }
  52. static void drawPolsF1F2ConcentrationEllipses (Graphics g) {
  53. autoTableOfReal me = getStandardizedLogFrequencyPolsData (0);
  54. autoDiscriminant d = TableOfReal_to_Discriminant (me.get());
  55. Discriminant_drawConcentrationEllipses (d.get(), g, 1, 0, nullptr, 0, 1, 2, -2.9, 2.9, -2.9, 2.9, 12, 1);
  56. }
  57. static void drawPolsDiscriminantConfiguration (Graphics g) {
  58. autoTableOfReal me = getStandardizedLogFrequencyPolsData (0);
  59. autoDiscriminant d = TableOfReal_to_Discriminant (me.get());
  60. autoConfiguration c = Discriminant_TableOfReal_to_Configuration (d.get(), me.get(), 2);
  61. Configuration_draw (c.get(), g, 1, 2, -2.9, 2.9, -2.9, 2.9, 0, 1, U"", 1);
  62. }
  63. static void drawBoxPlot (Graphics g) {
  64. double q25 = 25, q50 = 50, q75 = 60, mean = 45;
  65. double hspread = q75 - q25, r = 0.05, w = 0.2;
  66. double lowerInnerFence = q25 - 1.5 * hspread;
  67. double upperInnerFence = q75 + 1.5 * hspread;
  68. double upperOuterFence = q75 + 3.0 * hspread;
  69. double lowerWhisker = lowerInnerFence + 0.1 * hspread;
  70. double upperWhisker = upperInnerFence - 0.5 * hspread;
  71. double ymin = lowerWhisker - 0.1 * hspread, ymax = q75 + 4 * hspread;
  72. double x = 0, dx = 0.01, xar = x + 0.7, xtl = xar + dx;
  73. double xal1 = x + r + dx, xal2 = x + w + r, y;
  74. Graphics_setWindow (g, -1, 2, ymin, ymax);
  75. Graphics_setInner (g);
  76. Graphics_setTextAlignment (g, Graphics_LEFT, Graphics_HALF);
  77. Graphics_line (g, x - r, lowerWhisker, x + r, lowerWhisker);
  78. Graphics_line (g, x, lowerWhisker, x, q25);
  79. Graphics_line (g, x - w, q25, x + w, q25);
  80. Graphics_line (g, x - w, q50, x + w, q50);
  81. Graphics_line (g, x - w, q75, x + w, q75);
  82. Graphics_line (g, x - w, q25, x - w, q75);
  83. Graphics_line (g, x + w, q25, x + w, q75);
  84. Graphics_line (g, x, q75, x, upperWhisker);
  85. Graphics_line (g, x - r, upperWhisker, x + r, upperWhisker);
  86. y = q75 + 2.5 * hspread;
  87. Graphics_text (g, x, y, U"*");
  88. Graphics_arrow (g, xar, y, xal1, y);
  89. Graphics_text (g, xtl, y, U"outlier > %%upperInnerFence%");
  90. y = q75 + 3.5 * hspread;
  91. Graphics_text (g, x, y, U"o");
  92. Graphics_arrow (g, xar, y, xal1, y);
  93. Graphics_text (g, xtl, y, U"outlier > %%upperOuterFence%");
  94. y = upperOuterFence;
  95. Graphics_setLineType (g, Graphics_DOTTED);
  96. Graphics_line (g, -xtl, y, xtl, y);
  97. Graphics_text (g, xtl, y, U"%%upperOuterFence%");
  98. y = upperInnerFence;
  99. Graphics_line (g, -xtl, y, xtl, y);
  100. Graphics_text (g, xtl, y, U"%%upperInnerFence%");
  101. Graphics_line (g, x - w, mean, x + w, mean);
  102. Graphics_setLineType (g, Graphics_DRAWN);
  103. y = upperWhisker;
  104. Graphics_arrow (g, xar, y, xal2, y);
  105. Graphics_text (g, xtl, y, U"%%upperWhisker%");
  106. y = lowerWhisker;
  107. Graphics_arrow (g, xar, y, xal2, y);
  108. Graphics_text (g, xtl, y, U"%%lowerWhisker%");
  109. y = q75;
  110. Graphics_arrow (g, xar, y, xal2, y);
  111. Graphics_text (g, xtl, y, U"%%q75%");
  112. y = q25;
  113. Graphics_arrow (g, xar, y, xal2, y);
  114. Graphics_text (g, xtl, y, U"%%q25%");
  115. y = q50;
  116. Graphics_arrow (g, xar, y, xal2, y);
  117. Graphics_text (g, xtl, y, U"%%q50%");
  118. y = mean;
  119. Graphics_arrow (g, xar, y, xal2, y);
  120. Graphics_text (g, xtl, y, U"%%mean%");
  121. Graphics_unsetInner (g);
  122. }
  123. static void drawPartionedMatrix (Graphics g) {
  124. double min = 0, max = 10, x1, x2, y1, y2;
  125. Graphics_setWindow (g, min, max, min, max);
  126. x1 = 0; x2 = max; y1 = y2 = 7;
  127. Graphics_setLineType (g, Graphics_DOTTED);
  128. Graphics_line (g, x1, y1, x2, y2);
  129. x1 = x2 = 3; y1 = 0; y2 = max;
  130. Graphics_line (g, x1, y1, x2, y2);
  131. Graphics_setLineType (g, Graphics_DRAWN);
  132. x1 = 1.5; y1 = 7+3/2;
  133. Graphics_setFontSize (g, 14);
  134. Graphics_setTextAlignment (g, Graphics_CENTRE, Graphics_HALF);
  135. Graphics_text (g, x1, y1, U"##S__yy_#");
  136. x1 = 3 + 7/2;
  137. Graphics_text (g, x1, y1, U"##S__yx_#");
  138. y1 = 7/2;
  139. Graphics_text (g, x1, y1, U"##S__xx_#");
  140. x1 = 1.5;
  141. Graphics_text (g, x1, y1, U"##S__xy_#");
  142. }
  143. void manual_dwtools_init (ManPages me);
  144. void manual_dwtools_init (ManPages me) {
  145. MAN_BEGIN (U"AffineTransform", U"djmw", 20010927)
  146. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  147. NORMAL (U"An affine transform is a combination of a linear transformation #%A "
  148. "and a translation #%t that transforms a vector #%x to a new vector #%y "
  149. "in the following way:")
  150. FORMULA (U"#%y = #%A x + #%t")
  151. MAN_END
  152. MAN_BEGIN (U"AffineTransform: Invert", U"djmw", 20011008)
  153. INTRO (U"Get the inverse of the selected @AffineTransform object.")
  154. NORMAL (U"The inverse from")
  155. FORMULA (U"#%y = #%A x + #%t")
  156. NORMAL (U"is:")
  157. FORMULA (U"#%x = #%A^^-1^ - #%A^^-1^#%t.")
  158. MAN_END
  159. MAN_BEGIN (U"band filtering in the frequency domain", U"djmw", 20010404)
  160. INTRO (U"We describe how band filtering in the frequency domain is performed.")
  161. NORMAL (U"We start with a @Sound and end with a filter bank representation of "
  162. "this sound. We assume a standard analysis context: a sound divided into "
  163. "frames according to a certain %%window length% and %%time step%. We will "
  164. "simulate a filterbank with %N filters.")
  165. NORMAL (U"The algorithm for each sound frame proceeds in the following way:")
  166. LIST_ITEM (U"1. Apply a Gaussian window to the sound frame.")
  167. LIST_ITEM (U"2. Convert the windowed frame into a @Spectrum object.")
  168. LIST_ITEM (U"3. Convert the spectral amplitudes to %energy values by squaring "
  169. "the real and imaginary parts and multiplying by %df, the frequency "
  170. "distance between two successive frequency points in the spectrum. "
  171. "Since the Spectrum object only contains positive frequencies, "
  172. "we have to multiply all energy values, except the first and the last "
  173. "frequency, by another factor of 2 to compensate for negative frequencies.")
  174. LIST_ITEM (U"4. For each of the %N filters in the filter bank: determine the "
  175. "inner product of its filter function with the energies as determined in "
  176. "the previous step. The result of each inner product is the energy in the "
  177. "corresponding filter.")
  178. LIST_ITEM (U"5. Convert the energies in each filter to power by dividing by "
  179. "the %%window length%.")
  180. LIST_ITEM (U"6. Correct the power, due to the windowing of the frame, by dividing "
  181. "by the integral of the %squared windowing function.")
  182. LIST_ITEM (U"7. Convert all power values to %dB's according to 10 * log10 "
  183. "(%power / 4 10^^-10^).")
  184. MAN_END
  185. MAN_BEGIN (U"Bonferroni correction", U"djmw", 20011107)
  186. NORMAL (U"In general, if we have %k independent significance tests "
  187. "at the %\\al level, the probability %p that we will get no significant "
  188. "differences in all these tests is simply the product of the individual "
  189. "probabilities: (1 - %\\al)^^%k^. "
  190. "For example, with %\\al = 0.05 and %k = 10 we get %p = 0.95^^10^ = 0.60. "
  191. "This means, however, we now have a 40\\% chance that one of these 10 "
  192. "tests will turn out significant, despite each individual test only being "
  193. "at the 5\\% level. "
  194. "In order to guarantee that the overall significance test is still at the "
  195. "%\\al level, we have to adapt the significance level %\\al\\'p of the "
  196. "individual test. ")
  197. NORMAL (U"This results in the following relation between the overall and the "
  198. "individual significance level:")
  199. FORMULA (U"(1 - %\\al\\'p)^^%k%^ = 1 - %\\al.")
  200. NORMAL (U"This equation can easily be solved for %\\al\\'p:")
  201. FORMULA (U"%\\al\\'p = 1 - (1-%\\al)^^1/%k^,")
  202. NORMAL (U"which for small %\\al reduces to:")
  203. FORMULA (U"%\\al\\'p = %\\al / %k")
  204. NORMAL (U"This is a very simple recipe: If you want an overall significance "
  205. "level %\\al and you perform %k individual tests, simply divide %\\al "
  206. "by %k to obtain the significance level for the individual tests.")
  207. MAN_END
  208. MAN_BEGIN (U"box plot", U"djmw", 20111010)
  209. INTRO (U"A box plot provides a simple graphical summary of data. These plots "
  210. "originate from the work of @@Tukey (1977)@.")
  211. ENTRY (U"Definitions")
  212. NORMAL (U"The following figure shows an annotated box plot.")
  213. PICTURE (5.0, 5.0, drawBoxPlot)
  214. NORMAL (U"To understand the box plot we need the following definitions:")
  215. LIST_ITEM (U"%%q25% = lower quartile, 25\\% of the data lie below this value")
  216. LIST_ITEM (U"%%q50% = median, 50\\% of the data lie below this value")
  217. LIST_ITEM (U"%%q75% = upper quartile, 25\\% of the data lie above this value")
  218. NORMAL (U"The following definitions all depend on these quantiles:")
  219. LIST_ITEM (U"%%hspread% = |%%q75% \\-- %%q25%| (50\\% interval)")
  220. LIST_ITEM (U"%%lowerOuterFence% = %%q25% \\-- 3.0 * %%hspread% (not in figure)")
  221. LIST_ITEM (U"%%lowerInnerFence% = %%q25% \\-- 1.5 * %%hspread% (not in figure)")
  222. LIST_ITEM (U"%%upperInnerFence% = %%q75% + 1.5 * %%hspread%")
  223. LIST_ITEM (U"%%upperOuterFence% = %%q75% + 3.0 * %%hspread%")
  224. LIST_ITEM (U"%%lowerWhisker% = smallest data value larger then %%lowerInnerFence%")
  225. LIST_ITEM (U"%%upperWhisker% = largest data value smaller then %%upperInnerFence%")
  226. NORMAL (U"The box plot is a summary of the data in which:")
  227. LIST_ITEM (U"\\bu the horizontal lines of the rectangle correspond to "
  228. " %%q25%, %%q50% and %%q75%, respectively.")
  229. LIST_ITEM (U"\\bu the dotted line corresponds to the mean.")
  230. LIST_ITEM (U"\\bu the outliers outside the %%outerFences% are drawn with an 'o'.")
  231. LIST_ITEM (U"\\bu the outliers in the intervals (%%lowerOuterFence%, %%lowerInnerFence%) "
  232. "and (%%upperInnerFence%, %%upperOuterFence%) are drawn with an '*'.")
  233. LIST_ITEM (U"\\bu the whisker lines outside the rectangle connect %%q25% with %%lowerWhisker%, and, "
  234. "%%q75% with %%upperWhisker%, respectively. With no outliers present, the "
  235. "whiskers mark minimum and/or maximum of the data.")
  236. MAN_END
  237. MAN_BEGIN (U"BarkFilter", U"djmw", 20141023)
  238. INTRO (U"A #deprecated @@types of objects|type of object@ in P\\s{RAAT}. It is replaced by @@BarkSpectrogram@.")
  239. NORMAL (U"An object of type BarkFilter represents an acoustic time-frequency "
  240. "representation of a sound: the power spectral density %P(%z, %t), expressed "
  241. "in dB's as 10*log10(power/4e-10)). In the now preferred BarkSpectrogram the power is represented instead of its dB value."
  242. "It is sampled into a number of points around equally spaced times %t__%i_ "
  243. "and frequencies %z__%j_ (on a Bark scale).")
  244. ENTRY (U"Inside a BarkFilter")
  245. NORMAL (U"With @Inspect you will see that this type contains the same attributes a @Matrix object.")
  246. MAN_END
  247. MAN_BEGIN (U"BarkSpectrogram", U"djmw", 20141023)
  248. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  249. NORMAL (U"An object of type BarkSpectrogram represents an acoustic time-frequency "
  250. "representation of a sound: the power spectral density %P(%z, %t). "
  251. "It is sampled into a number of points around equally spaced times %t__%i_ "
  252. "and frequencies %z__%j_ (on a Bark scale).")
  253. NORMAL (U" The bark to hertz transformation is defined as:")
  254. FORMULA (U"hertz = 650.0 * sinh (bark / 7.0),")
  255. NORMAL (U"while its inverse is defined as:")
  256. FORMULA (U"bark = 7.0 * log (hertz/650 + sqrt (1 + (hertz/650)^^2^).")
  257. ENTRY (U"Inside a BarkSpectrogram")
  258. NORMAL (U"With @Inspect you will see that this type contains the same attributes a @Matrix object.")
  259. MAN_END
  260. MAN_BEGIN (U"BarkSpectrogram: Draw Sekey-Hanson auditory filters...", U"djmw", 20141023)
  261. INTRO (U"A command to draw the auditory filters defined in @@Sekey & Hanson (1984)@.")
  262. MAN_END
  263. MAN_BEGIN (U"BarkSpectrogram: Paint image...", U"djmw", 20141023)
  264. INTRO (U"A command to draw the selected @BarkSpectrogram into the @@Picture window@ in shades of grey.")
  265. MAN_END
  266. MAN_BEGIN (U"biharmonic spline interpolation", U"djmw", 20170915)
  267. INTRO (U"A biharmonic spline interpolation is an interpolation of irregularly spaced two-dimensional data points. "
  268. "The interpolating surface is a linear combination of Green functions centered at each data point. The amplitudes of "
  269. "the Green functions are found by solving a linear system of equations.")
  270. NORMAL (U"The surface %s(#%x) is expressed as")
  271. FORMULA (U"%s(#%x)=\\Si__%j%=1_^^n^ %w__%j_ %g(#%x, #%x__%j_),")
  272. NORMAL (U"where %n is the number of data points #%x__%j_ = (%x__%j_, %y__%j_), %g(#%x, #%x__%j_) is Green's function and %w__%j_ is the weight of data point %j. The weights %w__%j_ are determined by requiring that the surface %s(#%x) passes exactly through the %n data points, i.e.")
  273. FORMULA (U"%s(#%x__%i_)=\\Si__%j%=1_^^n^ %w__%j_ %g(#%x__%i_, #%x__%j_), %i = 1, 2, ..., %n.")
  274. NORMAL (U"This yields an %n\\xx%n square linear system of equations which can be solved for the %w__%j_.")
  275. NORMAL (U"For twodimensional data Green's function is:")
  276. FORMULA (U"%g(#%x__%i_, #%x__%j_) = |#%x__%i_ - #%x__%j_|^^2^ (ln |#%x__%i_ - #%x__%j_| - 1.0).")
  277. NORMAL (U"See @@Sandwell (1987)@ and @@Deng & Tang (2011)@ for more information.")
  278. MAN_END
  279. MAN_BEGIN (U"bootstrap", U"djmw", 20141101)
  280. INTRO (U"The bootstrap data set is a random sample of size %n "
  281. "drawn %%with% replacement from the sample (%x__1_,...%x__n_). This "
  282. "means that the bootstrap data set consists of members of the original "
  283. "data set, some appearing zero times, some appearing once, some appearing "
  284. "twice, etc.")
  285. NORMAL (U"More information can be found in @@Efron & Tibshirani (1993)@.")
  286. MAN_END
  287. MAN_BEGIN (U"canonical variate", U"djmw", 20060328)
  288. NORMAL (U"A ##canonical variate# is a new variable (variate) formed by making a linear combination of two "
  289. "or more variates (variables) from a data set. "
  290. "A linear combination of variables is the same as a weighted sum of variables. "
  291. "Because we can in infinitely many ways choose combinations of weights between variables in a data set, "
  292. "there are also infinitely many canonical variates possible. ")
  293. NORMAL (U"In general additional constraints should be satisfied by the weights to get a meaningful canonical variate. "
  294. "For example, in @@Canonical correlation analysis|canonical correlation analyis@ a data set is split up into two parts, a %%dependent% and an %%independent% part. "
  295. "In both parts we can form a canonical variate and we choose weights that maximize the correlation between these canonical variates "
  296. "(there is an @@TableOfReal: To CCA...|algorithm@ that calculates these weights).")
  297. MAN_END
  298. MAN_BEGIN (U"Categories", U"djmw", 19960918)
  299. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  300. NORMAL (U"An object of type Categories represents an ordered collection of categories. Each "
  301. "category is a simple text string.")
  302. ENTRY (U"Categories commands")
  303. NORMAL (U"Creation:")
  304. LIST_ITEM (U"\\bu ##Create an empty Categories#")
  305. LIST_ITEM (U"\\bu @@FFNet & PatternList: To Categories...@")
  306. NORMAL (U"Viewing and editing:")
  307. LIST_ITEM (U"\\bu @CategoriesEditor")
  308. NORMAL (U"Analysis:")
  309. LIST_ITEM (U"\\bu @@Categories: To Confusion@")
  310. LIST_ITEM (U"\\bu @@Categories: Difference@")
  311. NORMAL (U"Synthesis")
  312. LIST_ITEM (U"\\bu @@Categories: Append@")
  313. LIST_ITEM (U"\\bu ##Categories: Permute...#")
  314. LIST_ITEM (U"\\bu ##Categories: To unique Categories#")
  315. ENTRY (U"Inside a Categories")
  316. NORMAL (U"With @Inspect you will see the following attributes:")
  317. TAG (U"%size")
  318. DEFINITION (U"the number of simple categories.")
  319. TAG (U"%item[]")
  320. DEFINITION (U"the categories. Each category is an object of type #SimpleString.")
  321. MAN_END
  322. MAN_BEGIN (U"Categories: Difference", U"djmw", 19960918)
  323. INTRO (U"A command to compute the difference between two selected @Categories objects.")
  324. ENTRY (U"Behaviour")
  325. NORMAL (U"Each element in the first object is compared with the corresponding "
  326. "object in the second object according to its compare method. "
  327. "The number of different %categories will be shown in the @@Info window@.")
  328. MAN_END
  329. MAN_BEGIN (U"Categories: To Confusion", U"djmw", 19960918)
  330. INTRO (U"A command to compute the @Confusion matrix from two selected "
  331. "@Categories objects.")
  332. ENTRY (U"Algorithm")
  333. NORMAL (U"A confusion matrix is constructed from both #Categories objects in "
  334. "the following way: The first Categories object is considered the stimulus "
  335. "Categories and its unique (sorted) categories "
  336. "form the row indices of the confusion matrix, the unique (sorted) "
  337. "categories of the second object form the column indices of this matrix.")
  338. NORMAL (U"Next, each element in the first #Categories object is compared with "
  339. "the corresponding object in the second object and the element in the "
  340. "confusion matrix addressed by this pair is incremented by 1.")
  341. MAN_END
  342. MAN_BEGIN (U"Categories: Append", U"djmw", 19960918)
  343. INTRO (U"You can choose this command after selecting 2 objects of type @Categories. "
  344. "A new object is created that contains the second object appended after the first.")
  345. MAN_END
  346. MAN_BEGIN (U"Categories: Edit", U"djmw", 19960918)
  347. INTRO (U"You can choose this command after selecting one #Categories. "
  348. "A @CategoriesEditor will appear on the screen, with the selected #Categories in it.")
  349. MAN_END
  350. MAN_BEGIN (U"CategoriesEditor", U"djmw", 19960918)
  351. ENTRY (U"An editor for manipulating @Categories.")
  352. NORMAL (U"To make a selection, use the left mouse button.")
  353. NORMAL (U"The Ctrl key extends a selection (discontinuously).")
  354. NORMAL (U"The Shift key extends a selection contiguously.")
  355. MAN_END
  356. MAN_BEGIN (U"CC", U"djmw", 20010219)
  357. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  358. NORMAL (U"Any object that represents cepstral coefficients as a function of "
  359. "time.")
  360. MAN_END
  361. MAN_BEGIN (U"CC: Get value in frame...", U"djmw", 20140926)
  362. INTRO (U"Get the cepstral coefficient value at a specified position in a specified frame.")
  363. MAN_END
  364. MAN_BEGIN (U"CC: Get c0 value in frame...", U"djmw", 20140926)
  365. INTRO (U"Get the zeroth cepstral coefficient value in the specified frame. For a @MFCC object this value relates to energy.")
  366. MAN_END
  367. MAN_BEGIN (U"CCA", U"djmw", 20020323)
  368. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}. ")
  369. NORMAL (U"An object of type CCA represents the @@Canonical correlation "
  370. "analysis@ of two multivariate datasets.")
  371. ENTRY (U"Commands")
  372. NORMAL (U"Creation:")
  373. LIST_ITEM (U"\\bu @@TableOfReal: To CCA...@")
  374. MAN_END
  375. MAN_BEGIN (U"CCA: Get zero correlation probability...", U"djmw", 20040407)
  376. INTRO (U"Get the probability that for the selected @CCA object the chosen "
  377. "canonical correlation coefficient is different from zero.")
  378. ENTRY (U"Setting")
  379. TAG (U"##Index")
  380. DEFINITION (U"is the index of the canonical correlation coefficient that "
  381. "you want to test.")
  382. ENTRY (U"Algorithm")
  383. NORMAL (U"Wilks' statistic: the probability that coefficient \\ro__%index_ "
  384. "differs from zero is ")
  385. FORMULA (U" %probability = chiSquareQ (\\ci^2, %ndf),")
  386. NORMAL (U"where the %%number of degrees of freedom% parameter equals")
  387. FORMULA (U"%ndf = (%n__y_ - %index +1)(%n__x_ - %index +1)")
  388. NORMAL (U"and the chi-squared parameter is")
  389. FORMULA (U"\\ci^2 = \\--(%numberOfObservations - (%n__y_ + %n__x_ +3)/2) "
  390. "log (\\La__%index_),")
  391. NORMAL (U"In the formulas above the variables %n__y_ and %n__x_ are the "
  392. "dimensions of the dependent and the independent data sets whose "
  393. "canonical correlations have been "
  394. "obtained, and Wilks' lambda is:")
  395. FORMULA (U"\\La__index_ = \\Pi__%i=%index..min(%ny,%nx)_ (1 \\-- \\ro__%i_^^2^)")
  396. MAN_END
  397. MAN_BEGIN (U"CCA & Correlation: To TableOfReal (loadings)", U"djmw", 20020525)
  398. INTRO (U"Determine from the selected @CCA and @Correlation objects the correlations "
  399. "of the canonical variables with the original variables. These correlations are "
  400. "called %%canonical factor loadings%, or also %%structure correlation "
  401. "coefficients%.")
  402. MAN_END
  403. MAN_BEGIN (U"CCA & Correlation: Get variance fraction...", U"djmw", 20060323)
  404. INTRO (U"Determine from the selected @CCA and @Correlation objects the fraction of the variance "
  405. "explained by the selected @@canonical variate@ range.")
  406. ENTRY (U"Settings")
  407. TAG (U"##%X or Y")
  408. DEFINITION (U"determines whether you select the dependent (y) or the independent (x) set.")
  409. TAG (U"##Canonical variate range")
  410. DEFINITION (U"determines the canonical variates (or canonical variables).")
  411. ENTRY (U"Remarks")
  412. NORMAL (U"1. In general the variance fractions for a particular canonical variate in the "
  413. "dependent and in the independent set are not the same.")
  414. NORMAL (U"2. In general, the variance fractions for all canonical variates do not sum to 1.")
  415. ENTRY (U"Algorithm")
  416. NORMAL (U"The formula's can be found on page 170 of @@Cooley & Lohnes (1971)@.")
  417. NORMAL (U"For example, the fraction of the variance explained by the %i^^th^ canonical "
  418. "variable in the dependent set is:")
  419. FORMULA (U"%%fractionVariance% = ((#y__i_\\'p #R__yy_\\'p #R__yy_ #y__i_) / (#y__i_\\'p #R__yy_ #y__i_)) / %n__%y_,")
  420. NORMAL (U"where #y__%i_ is the eigenvector for dependent canonical variable %i and #R__%%yy%_ is the correlation matrix for the %n__%y_ variables in the dependent set.")
  421. MAN_END
  422. MAN_BEGIN (U"CCA & Correlation: Get redundancy (sl)...", U"djmw", 20060323)
  423. INTRO (U"Determine from the selected @CCA and @Correlation objects the Stewart-Love redundancy for the "
  424. "selected canonical variates.")
  425. NORMAL (U"The Stewart-Love redundancy for a single @@canonical variate@ is the fraction of variance explained by the selected "
  426. "canonical variate in a set times the fraction of shared variance between the corresponding canonical variates in the two sets.")
  427. NORMAL (U"The Stewart-Love redundancy for a canonical variate range is the sum of the individual redundancies.")
  428. ENTRY (U"Settings")
  429. TAG (U"##X or Y")
  430. DEFINITION (U"determines whether you select the dependent (y) or the independent (x) set.")
  431. TAG (U"##Canonical variate range")
  432. DEFINITION (U"determines the canonical variates (or canonical variables).")
  433. ENTRY (U"Algorithm")
  434. NORMAL (U"The formula's can be found on page 170 of @@Cooley & Lohnes (1971)@.")
  435. NORMAL (U"For example, the redundancy of the dependent set (y) given the independent set (x) for the %i^^%%th%^ canonical "
  436. "variate can be expressed as:")
  437. FORMULA (U"%R__%i_(y) = %%varianceFraction%__%i_(y) * \\ro__%i_^2, ")
  438. NORMAL (U"where %%varianceFraction%__%i_(y) is the @@CCA & Correlation: Get variance fraction...|variance fraction@ explained "
  439. "by the %i^^%%th%^ canonical variate of the dependent set, and \\ro__%i_ is the %i^^%%th%^ canonical correlation coefficient.")
  440. NORMAL (U"The redundancy for the selected canonical variate in the dependent set shows what "
  441. "fraction of the variance in the %%dependent% set is already \"explained\" by "
  442. "the variance in the %%independent% set, i.e. this fraction could be considered as redundant.")
  443. NORMAL (U"In the same way we can measure the redundancy of the independent (x) set giving the dependent set (y).")
  444. ENTRY (U"Remark")
  445. NORMAL (U"In general %R__%i_(y) \\=/ %R__%i_(x).")
  446. MAN_END
  447. MAN_BEGIN (U"CCA & TableOfReal: To TableOfReal (loadings)", U"djmw", 20020525)
  448. INTRO (U"Determine from the selected @CCA and @TableOfReal objects the correlations "
  449. "of the canonical variables with the original variables. These correlations are "
  450. "called %%canonical factor loadings%, or also %%structure correlation "
  451. "coefficients%.")
  452. MAN_END
  453. MAN_BEGIN (U"CCA & TableOfReal: To TableOfReal (scores)...", U"djmw", 20040407)
  454. INTRO (U"Determines the scores on the dependent and the independent canonical "
  455. "variates from the selected @CCA and @TableOfReal objects.")
  456. ENTRY (U"Settings")
  457. TAG (U"##Number of canonical correlations")
  458. DEFINITION (U"determines the dimension, i.e., the number of elements of the resulting "
  459. "canonical score vectors. The newly created table will have twice this number of "
  460. "columns because we have calculated score vectors for the dependent and the "
  461. "independent variates.")
  462. ENTRY (U"Behaviour")
  463. NORMAL (U"The scores on the dependent set are determined as #T__%y_ #Y, where "
  464. "#T__%y_ is the dependent part in the table and #Y is a matrix with "
  465. "%numberOfCanonicalCorrelations eigenvectors for the dependent variate.")
  466. NORMAL (U"The scores for the independent variates are then determined in an analogous "
  467. "way as #T__%x_ #X.")
  468. NORMAL (U"The scores for the dependent data will be in the lower numbered columns, "
  469. "the scores for the independent part will be in the higher numbered columns of "
  470. "the newly created object.")
  471. MAN_END
  472. MAN_BEGIN (U"Canonical correlation analysis", U"djmw", 20170829)
  473. INTRO (U"This tutorial will show you how to perform canonical correlation "
  474. "analysis with Praat.")
  475. ENTRY (U"1. Objective of canonical correlation analysis")
  476. NORMAL (U"In canonical correlation analysis we try to find the correlations between "
  477. "two data sets. One data set is called the %dependent set, the other the "
  478. "%independent set. In P\\s{RAAT} these two sets must reside into one "
  479. "@TableOfReal object. The lower numbered columns of this table will then be "
  480. "interpreted as the dependent part, the rest of the columns as the "
  481. "independent part. "
  482. "The dimension of, i.e., the number of columns in, the dependent part may not "
  483. "exceed the dimension of the independent part.")
  484. NORMAL (U"As an example, we will use the dataset from @@Pols et al. (1973)@ "
  485. "with the frequencies and levels of the first three formants from the 12 "
  486. "Dutch monophthongal vowels as spoken in /h_t/ context by 50 male speakers. "
  487. "We will try to find the canonical correlation between formant frequencies "
  488. "(the %dependent part) and levels (the %independent part). "
  489. "The dimension of both groups of variates is 3. "
  490. "In the introduction of the "
  491. "@@discriminant analysis@ tutorial you can find how to get these data, "
  492. "how to take the logarithm of the formant frequency values and how to "
  493. "standardize them. The following script summarizes:")
  494. CODE (U"pols50m = Create TableOfReal (Pols 1973): \"yes\"")
  495. CODE (U"Formula: ~ if col < 4 then log10 (self) else self endif")
  496. CODE (U"Standardize columns")
  497. NORMAL (U"Before we start with the %canonical correlation analysis we will first have "
  498. "a look at the %Pearson correlations of this table and "
  499. "calculate the @Correlation matrix. It is given by:")
  500. CODE (U" F1 F2 F3 L1 L2 L3")
  501. CODE (U"F1 1 -0.338 0.191 0.384 -0.505 -0.014")
  502. CODE (U"F2 -0.338 1 0.190 -0.106 0.526 -0.568")
  503. CODE (U"F3 0.191 0.190 1 0.113 -0.038 0.019")
  504. CODE (U"L1 0.384 -0.106 0.113 1 -0.038 0.085")
  505. CODE (U"L2 -0.505 0.526 -0.038 -0.038 1 0.128")
  506. CODE (U"L3 -0.014 -0.568 0.019 0.085 0.128 1")
  507. NORMAL (U"The following script summarizes:")
  508. CODE (U"selectObject: pols50m")
  509. CODE (U"To Correlation")
  510. CODE (U"Draw as numbers: 1, 0, \"decimal\", 3")
  511. NORMAL (U"The correlation matrix shows that high correlations exist between some "
  512. "formant frequencies and some levels. For example, the correlation "
  513. "coefficient between F2 and L2 equals 0.526.")
  514. NORMAL (U"In a canonical correlation analysis of the dataset above, we try "
  515. "to find the linear "
  516. "combination %u__1_ of %F__1_, %F__2_ and %F__3_ that correlates maximally "
  517. "with the linear combination %v__1_ of %L__1_, %L__2_ and %L__3_. "
  518. "When we have found these %u__1_ and %v__1_ we next try to find a new "
  519. "combination %u__2_ of the formant frequencies and a new combination "
  520. "%v__2_ of the levels that have maximum correlation. These %u__2_ and "
  521. "%v__2_ should be uncorrelated with %u__1_ and %v__1_. "
  522. "When we express the above with formulas we have:")
  523. FORMULA (U"%u__1_ = %y__11_%F__1_+%y__12_%F__2_ + %y__13_%F__3_")
  524. FORMULA (U"%v__1_ = %x__11_%L__1_+%x__12_%L__2_ + %x__13_%L__3_")
  525. FORMULA (U"\\ro(%u__1_, %v__1_) = maximum, \\ro(%u__2_, %v__2_) = submaximum, ")
  526. FORMULA (U"\\ro(%u__2_, %u__1_) = \\ro (%u__2_, %v__1_) = \\ro (%v__2_, %v__1_) "
  527. "= \\ro (%v__2_, %u__1_) = 0,")
  528. NORMAL (U"where the \\ro(%u__i_, %v__i_) are the correlations between the "
  529. "@@canonical variate@s %u__i_ and %v__i_ and the %y__%ij_'s and %x__%ij_'s are"
  530. " the ##canonical coefficients# for the dependent and the independent "
  531. "variates, respectively.")
  532. ENTRY (U"2. How to perform a canonical correlation analysis")
  533. NORMAL (U"Select the TableOfReal and choose from the dynamic menu the option "
  534. "@@TableOfReal: To CCA...|To CCA...@. This command is available in the "
  535. "\"Multivariate statistics\" action button. We fill out the form and supply "
  536. "3 for %%Dimension of dependent variate%. The resulting CCA object will bear "
  537. "the same name as the TableOfReal object. The following script summarizes:")
  538. CODE (U"selectObject: pols50m")
  539. CODE (U"cca = To CCA: 3")
  540. ENTRY (U"3. How to get the canonical correlation coefficients")
  541. NORMAL (U"You can get the canonical correlation coefficients by queries of the CCA "
  542. "object. You will find that the three canonical correlation coefficients, "
  543. "\\ro(%u__1_, %v__1_), \\ro(%u__2_, %v__2_) and \\ro(%u__3_, %v__3_) are "
  544. " approximately 0.86, 0.53 and 0.07, respectively. "
  545. "The following script summarizes:")
  546. CODE (U"cc1 = Get correlation: 1")
  547. CODE (U"cc2 = Get correlation: 2")
  548. CODE (U"cc3 = Get correlation: 3")
  549. CODE (U"writeInfoLine: \"cc1 = \", cc1, \", cc2 = \", cc2, \", cc3 = \", cc3")
  550. ENTRY (U"4. How to obtain canonical scores")
  551. NORMAL (U"Canonical #scores, also named @@canonical variate@s, are the linear combinations:")
  552. FORMULA (U"%u__%i_ = %y__%i1_%F__1_+%y__%i2_%F__2_ + %y__%i3_%F__3_, and,")
  553. FORMULA (U"%v__%i_ = %x__%i1_%L__1_+%x__%i2_%L__2_ + %x__%i3_%L__3_,")
  554. NORMAL (U"where the index %i runs from 1 to the number of correlation coefficients.")
  555. NORMAL (U"You can get the canonical scores by selecting a CCA object together with "
  556. "the TableOfReal object and choose "
  557. "@@CCA & TableOfReal: To TableOfReal (scores)...|To TableOfReal (scores)...@")
  558. NORMAL (U"When we now calculate the ##Correlation# matrix of these canonical variates we "
  559. "get the following table:")
  560. CODE (U" u1 u2 u3 v1 v2 v3")
  561. CODE (U"u1 1 . . 0.860 . .")
  562. CODE (U"u2 . 1 . . 0.531 .")
  563. CODE (U"u3 . . 1 . . 0.070")
  564. CODE (U"v1 0.860 . . 1 . .")
  565. CODE (U"v2 . 0.1 . . 1 .")
  566. CODE (U"v3 . . 0.070 . . 1")
  567. NORMAL (U"The scores with a dot are zero to numerical precision. In this table the "
  568. "only correlations that differ from zero are the canonical correlations. "
  569. "The following script summarizes:")
  570. CODE (U"selectObject: cca, pols50m")
  571. CODE (U"To TableOfReal (scores): 3)")
  572. CODE (U"To Correlation")
  573. CODE (U"Draw as numbers if: 1, 0, \"decimal\", 2, ~ abs(self) > 1e-14")
  574. ENTRY (U"5. How to predict one dataset from the other")
  575. NORMAL (U"@@CCA & TableOfReal: Predict...@")
  576. NORMAL (U"Additional information can be found in @@Weenink (2003)@.")
  577. MAN_END
  578. MAN_BEGIN (U"CCA & TableOfReal: Predict...", U"djmw", 20020503)
  579. INTRO (U"")
  580. MAN_END
  581. MAN_BEGIN (U"Chebyshev polynomials", U"djmw", 19990620)
  582. INTRO (U"The Chebyshev polynomials %T__%n_(%x) of degree %n are special orthogonal polynomial functions "
  583. "defined on the domain [-1, 1].")
  584. NORMAL (U"Orthogonality:")
  585. FORMULA (U"__-1_\\in^^1^ %W(%x) %T__%i_(%x) %T__%j_(%x) %dx = \\de__%ij_")
  586. FORMULA (U"%W(%x) = (1 \\-- %x^^2^)^^\\--1/2^ (-1 < x < 1)")
  587. NORMAL (U"They obey certain recurrence relations:")
  588. FORMULA (U"%T__%n_(%x) = 2 %x %T__%n-1_(%x) \\-- %T__%n-2_(%x)")
  589. FORMULA (U"%T__0_(%x) = 1")
  590. FORMULA (U"%T__1_(%x) = %x")
  591. MAN_END
  592. MAN_BEGIN (U"ChebyshevSeries", U"djmw", 19990620)
  593. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  594. NORMAL (U"An object of type ChebyshevSeries represents a linear combination of @@Chebyshev polynomials@ "
  595. "%T__%k_(%x).")
  596. FORMULA (U"ChebyshevSeries (%x) = \\Si__%k=1..%numberOfCoefficients_ %c__%k_ %T__%k_(%x)")
  597. MAN_END
  598. MAN_BEGIN (U"ChebyshevSeries: To Polynomial", U"djmw", 19990620)
  599. INTRO (U"A command to transform the selected @ChebyshevSeries object into a @@Polynomial@ object.")
  600. NORMAL (U"We find polynomial coefficients %c__%k_ such that")
  601. FORMULA (U"\\Si__%k=1..%numberOfCoefficients_ %c__%k_ %x^^%k^ = \\Si__%k=1.."
  602. "%numberOfCoefficients_ %l__%k_ %T__%k_(%x)")
  603. NORMAL (U"We use the recurrence relation for @@Chebyshev polynomials@ to calculate these coefficients.")
  604. MAN_END
  605. MAN_BEGIN (U"ClassificationTable: To Confusion...", U"djmw", 20141030)
  606. INTRO (U"A command to create a @Confusion object from the selected @ClassificationTable object.")
  607. ENTRY (U"Settings")
  608. TAG (U"##Only class labels#")
  609. DEFINITION (U"defines whether the class labels from the ClassificationTable object will be used not only as response labels but also as stimulus labels. If checked the resulting Confusion will always have equal stimulus and response labels. If not checked the stimulus labels will be determined from the row labels of the ClassificationTable object. ")
  610. ENTRY (U"Behaviour")
  611. NORMAL (U"In obtaining a Confusion object from a ClassificationTable we explicitly use its row labels as stimulus labels.")
  612. MAN_END
  613. MAN_BEGIN (U"ClassificationTable", U"djmw", 19990525)
  614. INTRO (U"One of the @@types of objects@ in Praat.")
  615. NORMAL (U"An object of type ClassificationTable represents the result of a classification experiment. "
  616. "The numbers in a row show how well a particular input matches the classes represented by the "
  617. "column labels. The higher the number the better the match.")
  618. MAN_END
  619. MAN_BEGIN (U"concentration ellipse", U"djmw", 20071113)
  620. INTRO (U"The percentage of bivariate normally distributed data covered by an ellipse "
  621. "whose axes have a length of %numberOfSigmas\\.c\\si can be obtained by integration of the p.d.f. "
  622. "over an elliptical area. This results in the following equation as can be "
  623. "verified from equation 26.3.21 in @@Abramowitz & Stegun (1970)@:")
  624. FORMULA (U"%percentage = (1 - exp (-%numberOfSigmas^^2^/2))\\.c 100\\% ,")
  625. NORMAL (U"where the %numberOfSigmas is the radius of the \"ellipse\":")
  626. FORMULA (U"(%x/%\\si__x_)^2 + (%y/%\\si__y_)^2 = %numberOfSigmas^2.")
  627. NORMAL (U"The %numberOfSigmas = 1 ellipse covers 39.3\\% , "
  628. "the %numberOfSigmas = 2 ellipse covers 86.5\\% and "
  629. "the %numberOfSigmas = 3 ellipse covers 98.9\\% of the data.")
  630. NORMAL (U"From the formula above we can show that if we want to cover %p percent of the data, we have to " "chose %numberOfSigmas as:")
  631. FORMULA (U"%numberOfSigmas = \\Vr(-2 ln(1-%p/100)).")
  632. NORMAL (U"For covering 95\\% of the data we calculate %numberOfSigmas = 2.45.")
  633. MAN_END
  634. MAN_BEGIN (U"confidence interval", U"djmw", 20151109)
  635. INTRO (U"The confidence interval gives an estimated range of values which "
  636. "is likely to include an unknown population parameter. "
  637. "The estimated range is calculated from a given set of observations.")
  638. ENTRY (U"Examples")
  639. NORMAL (U"At the \\al level of significance a two sided confidence interval "
  640. "for the true mean \\mu for normally distributed data with mean %%mean% and "
  641. "known standard deviation %\\si can be constructed as:")
  642. FORMULA (U"%%mean% - %z__\\al/2_ \\si / \\Vr%N \\<_ \\mu \\<_ "
  643. "%%mean% + %z__\\al/2_ \\si / \\Vr%N,")
  644. NORMAL (U"where %z__\\al/2_ = invGaussQ (\\al/2) and %N is the number of observations.")
  645. NORMAL (U"If the standard deviation is %not known, we have to estimate its value (%s) "
  646. "from the data and the formula above becomes:")
  647. FORMULA (U"%%mean% - %t__%%\\al/2;N%_ %s / \\Vr%N \\<_ \\mu \\<_ "
  648. "%%mean% + %t__%%\\al/2;N%_ %s / \\Vr%N,")
  649. NORMAL (U"where %t__%%\\al/2;N%_ = invStudentQ (%\\al/2, %N-1).")
  650. NORMAL (U"For %\\al=0.05 and %N=20 we get %z__0.025_=1.96 and %t__0.025;20_=2.093. "
  651. "This shows that for a fixed value of the standard deviation the confidence interval will always be wider if we had to estimate the standard deviation's value from the data instead of its value being known beforehand.")
  652. MAN_END
  653. MAN_BEGIN (U"confidence level", U"djmw", 20011105)
  654. NORMAL (U"The confidence level is the probability value 1-\\al associated "
  655. "with a @@confidence interval@, where \\al is the level of significance. "
  656. "It can also be expressed as a percentage 100(1-\\al)\\% and is than "
  657. "sometimes called the %%confidence coefficient%.")
  658. MAN_END
  659. MAN_BEGIN (U"Confusion", U"djmw", 20110517)
  660. INTRO (U"One of the @@types of objects@ in Praat.")
  661. NORMAL (U"An object of type Confusions represents a confusion matrix, with "
  662. "stimuli as row labels and responses as column labels. The entry at "
  663. "position [%i][%j] represents the number of times response %j "
  664. "was given to the stimulus %i.")
  665. ENTRY (U"Creating a Confusion from data in a text file")
  666. NORMAL (U"Suppose you have two objects A and B. "
  667. "In one way or another, you have acquired the following "
  668. "confusions: %\\de__%AA_ = 6, %\\de__%AB_ = 2 , %\\de__%BA_ = 1, "
  669. "and %\\de__%BB_ = 7.")
  670. NORMAL (U"You can create a simple text file like the following:")
  671. CODE (U"\"ooTextFile\" ! to make Praat recognize your file")
  672. CODE (U"\"Confusion\" ! The line that tells Praat about the contents")
  673. CODE (U"2 \"A\" \"B\" ! Number of columns, and column labels")
  674. CODE (U"2 ! Number of rows")
  675. CODE (U"\"A\" 6 2 ! Row label A, A-A value, A-B value")
  676. CODE (U"\"B\" 1 7 ! Row label B, B-A value, B-B value")
  677. NORMAL (U"This text file can be read with the @@Read from file...@ command. ")
  678. ENTRY (U"Commands")
  679. NORMAL (U"Creation:")
  680. LIST_ITEM (U"\\bu @@Categories: To Confusion")
  681. LIST_ITEM (U"\\bu @@Create simple Confusion...")
  682. NORMAL (U"Drawing")
  683. LIST_ITEM (U"\\bu ##Draw as numbers...")
  684. LIST_ITEM (U"\\bu ##Draw as squares...")
  685. NORMAL (U"Query")
  686. LIST_ITEM (U"\\bu @@Confusion: Get fraction correct|Get fraction correct")
  687. LIST_ITEM (U"\\bu @@Confusion: Get stimulus sum...")
  688. LIST_ITEM (U"\\bu @@Confusion: Get response sum...")
  689. LIST_ITEM (U"\\bu ##Get grand sum")
  690. NORMAL (U"Modification")
  691. LIST_ITEM (U"\\bu ##Formula...")
  692. LIST_ITEM (U"\\bu @@Confusion: Increase...")
  693. NORMAL (U"Grouping")
  694. LIST_ITEM (U"\\bu @@Confusion: Group stimuli...@")
  695. LIST_ITEM (U"\\bu @@Confusion: Group responses...@")
  696. NORMAL (U"Analysis:")
  697. LIST_ITEM (U"\\bu @@Confusion: To Similarity...@")
  698. LIST_ITEM (U"\\bu @@Confusion: To Dissimilarity (pdf)...@")
  699. ENTRY (U"Inside a Confusion")
  700. NORMAL (U"With @Inspect you will see the following attributes:")
  701. TAG (U"%numberOfRows")
  702. DEFINITION (U"the number of stimuli.")
  703. TAG (U"%numberOfColumns")
  704. DEFINITION (U"the number of responses.")
  705. TAG (U"%rowLabels")
  706. DEFINITION (U"the names of the stimuli.")
  707. TAG (U"columnLabels")
  708. DEFINITION (U"the names of the responses.")
  709. MAN_END
  710. MAN_BEGIN (U"Create simple Confusion...", U"djmw", 20140117)
  711. INTRO (U"Creates a square @@Confusion|confusion matrix@ with equal stimulus labels and response labels.")
  712. ENTRY (U"Example")
  713. NORMAL (U"The command ##Create simple Confusion: \"simple\", \"u i a\"# results in the following Confusion:")
  714. CODE (U" u i a ! The response labels")
  715. CODE (U"u 0 0 0 ! Responses on stimulus u,")
  716. CODE (U"i 0 0 0 ! Responses on stimulus i")
  717. CODE (U"a 0 0 0 ! Responses on stimulus a")
  718. MAN_END
  719. MAN_BEGIN (U"Confusion: Increase...", U"djmw", 20140117)
  720. INTRO (U"Increases the contents of the corresponding cell in the selected @@Confusion@ by one.")
  721. ENTRY (U"Settings")
  722. TAG (U"##Stimulus# and ##Response#")
  723. DEFINITION (U"define the cell whose value will be increased by one.")
  724. ENTRY (U"Example")
  725. NORMAL (U"Given the following Confusion:")
  726. CODE (U" u i a ! The response labels")
  727. CODE (U" u 6 2 1 ! Responses on stimulus u,")
  728. CODE (U" i 3 4 2 ! Responses on stimulus i")
  729. CODE (U" a 1 4 4 ! Responses on stimulus a")
  730. NORMAL (U"The command ##Increase: \"u\", \"i\"# results in:")
  731. CODE (U" u i a ! The responses")
  732. CODE (U" u 6 3 1 ! Responses on stimulus u,")
  733. CODE (U" i 3 4 2 ! Responses on stimulus i")
  734. CODE (U" a 1 4 4 ! Responses on stimulus a")
  735. MAN_END
  736. MAN_BEGIN (U"Confusion: Group...", U"djmw", 20140117)
  737. INTRO (U"Groups a number of stimuli and responses into one new category.")
  738. ENTRY (U"Settings")
  739. TAG (U"##Stimuli & Responses")
  740. DEFINITION (U"defines the labels that will be grouped.")
  741. TAG (U"##New label")
  742. DEFINITION (U"defines the new label for the grouped labels.")
  743. TAG (U"##New label position")
  744. DEFINITION (U"the row/column number for the new group label.")
  745. ENTRY (U"Example")
  746. NORMAL (U"Given the following selected Confusion:")
  747. CODE (U" u i a ! The response labels")
  748. CODE (U" u 6 2 1 ! Responses on stimulus u,")
  749. CODE (U" i 3 4 2 ! Responses on stimulus i")
  750. CODE (U" a 1 4 4 ! Responses on stimulus a")
  751. NORMAL (U"After the command ##Group stimuli: \"u i\", \"high\", 0#, the new Confusion will be:")
  752. CODE (U" high a ! The new response labels")
  753. CODE (U" high 15 3 ! Responses on group %%high%")
  754. CODE (U" a 5 4 ! Responses on stimulus a")
  755. NORMAL (U"Instead after the command ##Group stimuli: \"u i\", \"high\", 2#, the new Confusion will be:")
  756. CODE (U" a high ! The new response labels")
  757. CODE (U" a 4 5 ! Responses on stimulus a")
  758. CODE (U" high 3 15 ! Responses on group %%high%")
  759. MAN_END
  760. MAN_BEGIN (U"Confusion: Group stimuli...", U"djmw", 20140117)
  761. INTRO (U"Groups a number of stimuli into one new category.")
  762. ENTRY (U"Settings")
  763. TAG (U"##Stimuli")
  764. DEFINITION (U"defines the stimuli that will be grouped.")
  765. TAG (U"##New label")
  766. DEFINITION (U"defines the new label for the grouped stimuli.")
  767. TAG (U"##New label position")
  768. DEFINITION (U"the row number for the new group label.")
  769. ENTRY (U"Example")
  770. NORMAL (U"Given the following selected Confusion:")
  771. CODE (U" u i a ! The response labels")
  772. CODE (U" u 6 2 1 ! Responses on stimulus u,")
  773. CODE (U" i 3 4 2 ! Responses on stimulus i")
  774. CODE (U" a 1 4 4 ! Responses on stimulus a")
  775. NORMAL (U"After the command ##Group stimuli: \"u i\", \"high\", 1#, the new Confusion will be:")
  776. CODE (U" u i a ! The response labels")
  777. CODE (U" high 9 6 3 ! Responses on stimulus group %%high%,")
  778. CODE (U" a 1 4 4 ! Responses on stimulus a")
  779. MAN_END
  780. MAN_BEGIN (U"Confusion: Group responses...", U"djmw", 20140117)
  781. INTRO (U"Groups a number of responses into one new category.")
  782. ENTRY (U"Settings")
  783. TAG (U"##Responses")
  784. DEFINITION (U"defines the responses that will be grouped.")
  785. TAG (U"##New label")
  786. DEFINITION (U"defines the new label for the grouped responses.")
  787. TAG (U"##New label position")
  788. DEFINITION (U"the column number for the new group label.")
  789. ENTRY (U"Example")
  790. NORMAL (U"Given the following selected Confusion:")
  791. CODE (U" u i a ! The response labels")
  792. CODE (U" u 6 2 1 ! Responses on stimulus u,")
  793. CODE (U" i 3 4 2 ! Responses on stimulus i")
  794. CODE (U" a 1 4 4 ! Responses on stimulus a")
  795. NORMAL (U"After the command ##Group responses: \"a i\", \"front\", 1#, the new Confusion will be:")
  796. CODE (U" front i ! The new response labels")
  797. CODE (U" u 7 2 ! Responses on stimulus u,")
  798. CODE (U" i 5 4 ! Responses on stimulus i")
  799. CODE (U" a 5 4 ! Responses on stimulus a")
  800. MAN_END
  801. MAN_BEGIN (U"Confusion: Get stimulus sum...", U"djmw", 20140117)
  802. INTRO (U"Returns the number of responses for the chosen stimulus (the sum of all the numbers in the row with this stimulus label). ")
  803. ENTRY (U"Example")
  804. NORMAL (U"Given the following selected Confusion:")
  805. CODE (U" u i a ! The response labels")
  806. CODE (U" u 6 2 1 ! Responses on stimulus u,")
  807. CODE (U" i 3 4 2 ! Responses on stimulus i")
  808. CODE (U" a 1 4 4 ! Responses on stimulus a")
  809. NORMAL (U"The command ##Get stimulus sum: \"a\"# will return the number 9.")
  810. MAN_END
  811. MAN_BEGIN (U"Confusion: Get response sum...", U"djmw", 20140117)
  812. INTRO (U"Returns the number of times the chosen response was given (the sum of all the numbers in the column with this response label).")
  813. ENTRY (U"Example")
  814. NORMAL (U"Given the following selected Confusion:")
  815. CODE (U" u i a ! The response labelss")
  816. CODE (U" u 6 2 1 ! Responses on stimulus u,")
  817. CODE (U" i 3 4 2 ! Responses on stimulus i")
  818. CODE (U" a 1 4 4 ! Responses on stimulus a")
  819. NORMAL (U"The command ##Get response sum: \"a\"# will return the number 7.")
  820. MAN_END
  821. MAN_BEGIN (U"Confusion: Condense...", U"djmw", 20130410)
  822. INTRO (U"Groups row and column labels of the selected @Confusion object in "
  823. "order to reduce its dimension. ")
  824. ENTRY (U"Settings")
  825. TAG (U"##Search")
  826. DEFINITION (U"the pattern to match.")
  827. TAG (U"##Replace")
  828. DEFINITION (U"the pattern that replaces the match(es).")
  829. TAG (U"##Replace limit")
  830. DEFINITION (U"limits the maximum number of times that a match/replace cycle "
  831. "may occur within each label.")
  832. TAG (U"##Search and replace are")
  833. DEFINITION (U"defines whether the search and replace strings are taken "
  834. "literally or as a @@Regular expressions|regular expression@.")
  835. ENTRY (U"Behaviour")
  836. NORMAL (U"First all row and column labels are changed according to the search "
  837. "and replace specification. Next all rows or columns that have the same "
  838. "labels are summed. ")
  839. MAN_END
  840. MAN_BEGIN (U"Confusion: Get fraction correct", U"djmw", 20000225)
  841. INTRO (U"A @@query@ to ask the selected @Confusion matrix for the fraction of "
  842. "correct classifications.")
  843. NORMAL (U"The \"fraction correct\" is defined as the quotient of the number "
  844. "of correct classifications and the sum of the entries in the matrix.")
  845. NORMAL (U"Correct classifications have identical row and column labels.")
  846. MAN_END
  847. MAN_BEGIN (U"Confusion & ClassificationTable: Increase confusion count", U"djmw", 201411101)
  848. INTRO (U"Increases the contents of cell(s) in the selected @@Confusion@. The cells to increase are determined by the selected "
  849. "@ClassificationTable.")
  850. ENTRY (U"Behaviour")
  851. NORMAL (U"For each row in the ClassificationTable object the contents of one cell in the Confusion we be increased by one. "
  852. "This cell is determined as follows: we start by finding the label of the column wich the largest number in it. "
  853. "This label is defined as the ##response label#. We use the corresponding row label as the ##stimulus label#. The content "
  854. "of the cell in the Confusion object whose row and column are labeled with ##stimulus label# and ##response label#, "
  855. "respectively, is increased by one.")
  856. MAN_END
  857. MAN_BEGIN (U"Confusion: To TableOfReal (marginals)", U"djmw", 20011031)
  858. INTRO (U"A new @TableOfReal object is created from the selected @Confusion "
  859. "object with one extra row and column. ")
  860. NORMAL (U"The first element of the extra row will contain the sum of the "
  861. "confusions in the the first %column, the first element of the extra "
  862. "column will contain the sum of the confusions in the the first %row, "
  863. "etc... The bottom-right element will contain the sum of all confusions.")
  864. MAN_END
  865. MAN_BEGIN (U"Correlation", U"djmw", 19990105)
  866. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  867. NORMAL (U"An object of type Correlation represents the correlation coefficients "
  868. "of a multivariate data set.")
  869. MAN_END
  870. MAN_BEGIN (U"Correlation: Confidence intervals...", U"djmw", 20040407)
  871. INTRO (U"Calculates @@confidence interval@s for the correlation coefficients "
  872. "from the selected @Correlation object(s) and saves these intervals in a "
  873. "new @TableOfReal object.")
  874. ENTRY (U"Settings")
  875. TAG (U"##Confidence level")
  876. DEFINITION (U"the @@confidence level@ you want for the confidence intervals.")
  877. TAG (U"##Number of tests")
  878. DEFINITION (U"determines the @@Bonferroni correction@ for the significance "
  879. "level. If the default value (zero) is chosen, it will be set equal "
  880. "to the number of correlations involved (a matrix of dimension %n "
  881. "has %n\\.c(%n-1)/2 correlations).")
  882. TAG (U"##Approximation")
  883. DEFINITION (U"defines the approximation that will be used to calculate the "
  884. "confidence intervals. It is either Fisher's z transformation or Ruben's "
  885. "transformation. According to @@Boomsma (1977)@, Ruben's approximation is "
  886. "more accurate than Fisher's.")
  887. ENTRY (U"Algorithm")
  888. NORMAL (U"We obtain intervals by the large-sample conservative multiple tests "
  889. "with Bonferroni inequality and the Fisher or Ruben transformation. "
  890. "We put the upper values of the confidence intervals in the upper "
  891. "triangular part of the matrix and the lower values of the confidence "
  892. "intervals in lower triangular part of the resulting TableOfReal object.")
  893. NORMAL (U"In %%Fisher's approximation%, for each element %r__%ij_ of the "
  894. "correlation matrix the confidence interval is:")
  895. FORMULA (U"#[ tanh (%z__%ij_ - %z__%\\al\\'p_ / \\Vr(%N - 3)) , "
  896. "tanh (%z__%ij_ + %z__%\\al\\'p_ / \\Vr(%N - 3)) #],")
  897. NORMAL (U"where %z__%ij_ is the Fisher z-transform of the correlation %r__%ij_:")
  898. FORMULA (U"%z__%ij_ = 1/2 ln ((1 + %r__%ij_) / (1 - %r__%ij_)), ")
  899. NORMAL (U"%z__%\\al\\'p_ the Bonferroni corrected %z-value "
  900. "%z__%\\al/(2\\.c%numberOfTests)_, ")
  901. FORMULA (U"%\\al = 1 - %confidenceLevel,")
  902. NORMAL (U"and %N the number of observations that the correlation matrix is "
  903. "based on.")
  904. NORMAL (U"In %%Ruben's approximation% the confidence interval for element %r__%ij_ "
  905. "is:")
  906. FORMULA (U"#[ %x__1_ / \\Vr(1 - %x__1_^2), %x__2_ / \\Vr(1 - %x__2_^2) #]")
  907. NORMAL (U"in which %x__1_ and %x__2_ are the smallest and the largest root from")
  908. FORMULA (U"%a %x^^2^ + %b %x + %c = 0, with")
  909. FORMULA (U"%a = 2%N - 3 - %z__%\\al\\'p_^^2^")
  910. FORMULA (U"%b = - 2 %r\\'p \\Vr((2%N - 3)(2%N - 5))")
  911. FORMULA (U"%c = (2%N - 5 - %z__%\\al\\'p_^^2^) %r\\'p^^2^ - 2%z__%\\al\\'p_^^2^, and")
  912. FORMULA (U"%r\\'p = %r__%ij_ / \\Vr(1 - %r__%ij_^2),")
  913. MAN_END
  914. MAN_BEGIN (U"Covariance", U"djmw", 19990105)
  915. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  916. NORMAL (U"An object of type Covariance represents the sums of squares and cross "
  917. "products of a multivariate data set divided by the number of observations.")
  918. NORMAL (U"An object of type Covariance contains the same attributes as an object of "
  919. "type @SSCP.")
  920. NORMAL (U"Since an object of type Covariance contains the mean values (the "
  921. "centroids), the covariances as well as the number of observations it has "
  922. "all the information necessary to be the subject of all kinds of statistical "
  923. "tests on means and variances.")
  924. MAN_END
  925. MAN_BEGIN (U"Create simple Correlation...", U"djmw", 20151230)
  926. INTRO (U"Create a @@Correlation@ matrix with its centroid.")
  927. ENTRY (U"Settings")
  928. TAG (U"##Correlations")
  929. DEFINITION (U"define the correlations. Because a correlation matrix is a symmetric matrix, only the upper triangular "
  930. "part of the matrix has to be input (row-wise). If your correlation matrix is "
  931. "of dimension %d, your input needs %d(%d+1)/2 elements. The first %d input elements are the elements of the first "
  932. "row of the correaltion matrix, the next %d-1 input elements are for the second row, then %d-2 for the third row, etc.")
  933. TAG (U"##Centroid")
  934. DEFINITION (U"defines the centroid. ")
  935. TAG (U"##Number of observations")
  936. DEFINITION (U"defines the number of observations.")
  937. MAN_END
  938. MAN_BEGIN (U"Create simple Covariance...", U"djmw", 20101125)
  939. INTRO (U"Create a @@Covariance@ matrix with its centroid.")
  940. ENTRY (U"Settings")
  941. TAG (U"##Covariances")
  942. DEFINITION (U"define the covariances. Because a covariance matrix is a symmetric matrix, only the upper triangular "
  943. "part of the matrix has to be input (row-wise). If your covariance matrix is "
  944. "of dimension %d, your input needs %d(%d+1)/2 elements. The first %d input elements are the elements of the first "
  945. "row of the covariance matrix, the next %d-1 input elements are for the second row, then %d-2 for the third row, etc.")
  946. TAG (U"##Centroid")
  947. DEFINITION (U"defines the centroid. ")
  948. TAG (U"##Number of observations")
  949. DEFINITION (U"defines the number of observations. ")
  950. MAN_END
  951. MAN_BEGIN (U"Covariance: Set value...", U"djmw", 20101124)
  952. INTRO (U"Input @@Covariance@ matrix cell values.")
  953. ENTRY (U"Constraints on input values")
  954. TAG (U"A covariance matrix is a %%symmetric% matrix: values input at cell [%i,%j] will be automatically input at "
  955. "cell [%j,%i] too.")
  956. TAG (U"All values on the diagonal should be positive numbers.")
  957. TAG (U"The absolute value of an off-diagonal element at cell [%i,%j] should be smaller than the corresponding diagonal "
  958. "elements at cells [%i,%i] and [%j,%j].")
  959. MAN_END
  960. MAN_BEGIN (U"Covariance: Difference", U"djmw", 20090624)
  961. INTRO (U"You can choose this command after selecting two objects of type @Covariance. ")
  962. NORMAL (U"We test the hypothesis that the samples that gave rise to the two "
  963. "covariance matrices #%M__1_ and #%M__2_, have equal covariances. "
  964. "The test statistic is %L\\'p which is distributed as "
  965. "a \\ci^2 variate with %p(%p+1)/2 degrees of freedom.")
  966. FORMULA (U"%L\\'p = %L \\.c (1 \\-- (2%p + 1 \\-- 2 / (%p + 1)) / (6 \\.c ( %N \\-- 1))),")
  967. NORMAL (U"where, ")
  968. FORMULA (U"%L = (%N \\-- 1) \\.c (ln determinant (#%M__1_) \\-- ln determinant "
  969. "(#%M__2_)) + trace (#%M__2_ \\.c #%M__1_^^\\--1^) \\-- %p), ")
  970. NORMAL (U"%p is dimension of covariance matrix and "
  971. "%N is the number of observations underlying the covariance matrix. ")
  972. NORMAL (U"For more details on this test, see e.g. page 292 of @@Morrison (1990)@.")
  973. MAN_END
  974. MAN_BEGIN (U"Covariance: Get significance of one mean...", U"djmw", 20040407)
  975. INTRO (U"Gets the level of significance for one mean from the selected "
  976. "@Covariance object being different from a hypothesized mean.")
  977. ENTRY (U"Settings")
  978. TAG (U"##Index")
  979. DEFINITION (U"the position of the element in the means vector (centroid) that "
  980. "you want to test. ")
  981. TAG (U"##Value")
  982. DEFINITION (U"the hypothesized mean %\\mu (see below).")
  983. ENTRY (U"Behaviour")
  984. NORMAL (U"This is the standard test on means when the variance is unknown. "
  985. "The test statistic is")
  986. FORMULA (U"%t = (%mean - %\\mu) \\Vr%(N / %s^2),")
  987. NORMAL (U"which has the Student %t distribution with %ndf = %N-1 degrees of freedom.")
  988. NORMAL (U"In the formulas above, %mean is the element of the mean vector at "
  989. "position %index, %\\mu is the hypothesized mean, "
  990. "%N is the number of observations, %s^2 "
  991. "is the variance at position [%index][%index] in the covariance matrix.")
  992. NORMAL (U"The returned probability %p is the %%two-sided% probability")
  993. FORMULA (U"%p = 2 * studentQ (%t, %ndf)")
  994. NORMAL (U"A low probability %p means that the difference is significant.")
  995. MAN_END
  996. MAN_BEGIN (U"Covariance: Get fraction variance...", U"djmw", 20040407)
  997. INTRO (U"A command to ask the selected @Covariance object for the fraction "
  998. "of the total variance that is accounted for by the selected dimension(s).")
  999. ENTRY (U"Settings")
  1000. TAG (U"##From dimension#, ##To dimension#")
  1001. DEFINITION (U"define the range of components. By choosing both numbers equal, "
  1002. "you get the fraction of the variance \"explained\" by that dimension.")
  1003. ENTRY (U"Details")
  1004. NORMAL (U"The total variance is the sum of the diagonal elements of the covariance "
  1005. "matrix #C, i.e., its trace. "
  1006. "The fraction is defined as:")
  1007. FORMULA (U"\\Si__%i=%from..%to_ %%C__ii_% / \\Si__%i=1..%numberOfRows_ %%C__ii_%")
  1008. MAN_END
  1009. MAN_BEGIN (U"Covariance: Get significance of means difference...", U"djmw", 20160102)
  1010. INTRO (U"Gets the level of significance for the %difference of two means "
  1011. "from the selected @Covariance object being different from a hypothesized "
  1012. "value.")
  1013. ENTRY (U"Settings")
  1014. TAG (U"##Index1#, ##Index2#")
  1015. DEFINITION (U"the positions of the two elements of the means vector whose "
  1016. "difference is compared to the hypothesized difference.")
  1017. TAG (U"##Value")
  1018. DEFINITION (U"the hypothesized difference (%\\mu).")
  1019. TAG (U"##Paired")
  1020. DEFINITION (U"determines whether we treat the two means as being dependent. ")
  1021. TAG (U"##Equal variances")
  1022. DEFINITION (U"determines whether the distribution of the difference of the means "
  1023. "is a Student t-distribution (see below).")
  1024. ENTRY (U"Behaviour")
  1025. NORMAL (U"This is Student's t-test for the significance of a difference of means. "
  1026. "The test statistic is:")
  1027. FORMULA (U"%t = (%x\\-^__1_ - %x\\-^__2_ - %\\mu) \\Vr (%N / %s^2) with %ndf "
  1028. "degrees of freedom.")
  1029. NORMAL (U"In the formula above %x\\-^__1_ and %x\\-^__2_ are the elements of the "
  1030. "means vector, %\\mu is the hypothesized difference and %N is the number of "
  1031. "observations. The value that we use for the (combined) variance %s^2 is:")
  1032. FORMULA (U"%s^2 = %var__1_ + %var__2_ - 2 * %covar__12_,")
  1033. NORMAL (U"when the samples are %paired, and ")
  1034. FORMULA (U"%s^2 = %var__1_ + %var__2_ ")
  1035. NORMAL (U"when they are not.")
  1036. NORMAL (U"The %var__1_ and %var__2_ are the variance components for "
  1037. "%x\\-^__1_ and %x\\-^__2_, respectively, and %covar__12_ is their covariance."
  1038. " When we have %%paired samples% we assume that the two variances are "
  1039. "not independent and their covariance is subtracted, otherwise their "
  1040. "covariance is not taken into account. Degrees of freedom parameter %ndf "
  1041. "usually equals 2(%N-1). ")
  1042. NORMAL (U"If the two variances are significantly different, the statistic %t "
  1043. "above is only %approximately distributed as Student's %t with "
  1044. "degrees of freedom equal to:")
  1045. FORMULA (U"%ndf = (%N-1) \\.c (%var__1_ + %var__2_)^2 / (%var__1_^2 + "
  1046. "%var__2_^2).")
  1047. NORMAL (U"The returned probability %p will be the %%two-sided% probability")
  1048. FORMULA (U"%p = 2 * studentQ (%t, %ndf)")
  1049. NORMAL (U"A low probability %p means that the difference is significant.")
  1050. MAN_END
  1051. MAN_BEGIN (U"Covariance: Get significance of one variance...", U"djmw", 20160102)
  1052. INTRO (U"Gets the probability for one variance from the selected "
  1053. "@Covariance object being different from a hypothesized variance.")
  1054. ENTRY (U"Settings")
  1055. TAG (U"##Index")
  1056. DEFINITION (U"the position of the variance element %s^2.")
  1057. TAG (U"##Value")
  1058. DEFINITION (U"the hypothesized variance %\\si^2")
  1059. ENTRY (U"Behaviour")
  1060. NORMAL (U"The test statistic")
  1061. FORMULA (U"%\\ci^2 = (%N-1)%s^2 / %\\si^2,")
  1062. NORMAL (U"is distributed as a chi-squared variate with %ndf = %N-1 degrees of freedom.")
  1063. NORMAL (U"The returned probability %p will be ")
  1064. FORMULA (U"%p = chiSquareQ (%\\ci^2, %ndf)")
  1065. MAN_END
  1066. MAN_BEGIN (U"Covariance: Get significance of variance ratio...", U"djmw", 20040407)
  1067. INTRO (U"Gets the probability for the ratio of two variances "
  1068. "from the selected @Covariance object being different from a hypothesized "
  1069. "ratio.")
  1070. ENTRY (U"Settings")
  1071. TAG (U"##Index1#, ##Index2#")
  1072. DEFINITION (U"determine the variances.")
  1073. TAG (U"##Hypothesized ratio")
  1074. DEFINITION (U"the hypothesized ratio %F.")
  1075. ENTRY (U"Behaviour")
  1076. NORMAL (U"The test statistic")
  1077. FORMULA (U"%f = %s__1_^2 / %s__2_^2 / %ratio")
  1078. NORMAL (U"is distributed as Fisher's F distribution with %ndf__1_ = %N-1 and "
  1079. "%ndf__2_ = %N-1 degrees of freedom for the numerator and denominator terms, "
  1080. "respectively.")
  1081. NORMAL (U"The returned probability %p will be the %%two-sided% probability")
  1082. FORMULA (U"%p = 2 * fisherQ (%f, %ndf__1_, %ndf__2_)")
  1083. NORMAL (U"If %s__2_^2 > %s__1_^2 we use 1/%f to determine the probability.")
  1084. MAN_END
  1085. MAN_BEGIN (U"Covariances: Report multivariate mean difference...", U"djmw", 20090627)
  1086. INTRO (U"Reports the probability that the two multivariate means of the selected @@Covariance@s are equal.")
  1087. ENTRY (U"Settings")
  1088. TAG (U"##Covariances are equal")
  1089. DEFINITION (U"determines whether the test is performed as if the two covariance matrices are equal or not.")
  1090. ENTRY (U"Algorithm")
  1091. NORMAL (U"For equal covariance matrices the test is via Hotelling's T^^2^ as described in @@Morrison (1990)|Morrison (1990,@ page 141). "
  1092. "The test statistic is %F = (%N__1_+%N__2_-%p-1)/((%N__1_+%N__2_-2)%p)\\.c T^^2^, with %p and %N__1_+%N__2_-%p-1 degrees of freedom.")
  1093. NORMAL (U"If the covariance matrices are not equal, we apply a correction on the number of degrees of freedom as "
  1094. "proposed by @@Krishnamoorthy & Yu (2004)@. The test statistic in this case is %F = (\\nu-%p+1)/(%p\\nu)\\.c T^^2^, "
  1095. "with %p and \\nu degrees of freedom. Here \\nu is a corrected number of degrees of freedom. ")
  1096. NORMAL (U"(The test for unequal covariances simplifies to Welch's approximate solution for the univariate t-test with unequal variances.) ")
  1097. MAN_END
  1098. MAN_BEGIN (U"Covariances: Report equality", U"djmw", 20090701)
  1099. INTRO (U"Reports the probability that the selected @@Covariance@ matrices are equal.")
  1100. NORMAL (U"We use the Bartlett test and the Wald test. According to @@Schott (2001)@, "
  1101. "both tests are overly sensitive to violations of normality.")
  1102. MAN_END
  1103. MAN_BEGIN (U"Covariance: To TableOfReal (random sampling)...", U"djmw", 20101101)
  1104. INTRO (U"Generate a @TableOfReal object by random sampling from a multi-variate "
  1105. "normal distribution whose @Covariance matrix is the selected object.")
  1106. ENTRY (U"Setting")
  1107. TAG (U"##Number of data points")
  1108. DEFINITION (U"determines the number of data points that will be generated. Each "
  1109. "data point occupies one row in the generated table.")
  1110. ENTRY (U"Algorithm")
  1111. NORMAL (U"The algorithm proceeds as follows:")
  1112. LIST_ITEM (U"1. Diagonalize the covariance matrix: calculate the eigenvalues $v__%i_ and "
  1113. "eigenvectors %#e__%i_ of the %m \\xx %m Covariance matrix. "
  1114. "In general there will also be %m of these. Let #%E be the %m \\xx %m matrix "
  1115. "with eigenvector %#e__%j_ in column %j (%j=1..%m).")
  1116. LIST_ITEM (U"2. Generate a vector #x whose elements %x__%k_ equal %x__%k_ = "
  1117. "randomGauss (0, \\Vr (%v__%k_)). "
  1118. "Each %x__%k_ is a random deviate drawn from a Gaussian distribution with "
  1119. "mean zero and standard deviation equal to the square root of the corresponding "
  1120. "eigenvalue %v__%k_.")
  1121. LIST_ITEM (U"3. Rotate back: calculate the vector #y = #%E #x, obtained by multiplying the vector "
  1122. "#x with the matrix #%E.")
  1123. LIST_ITEM (U"4. Add the centroid to #y and copy the elements of #y to the corresponding row of "
  1124. "the TableOfReal object.")
  1125. LIST_ITEM (U"5. Repeat steps 2, 3 and 4 until the desired number of data points "
  1126. "has been reached.")
  1127. LIST_ITEM (U"6. Copy the column labels from the Covariance object to the "
  1128. "TableOfReal object.")
  1129. NORMAL (U"In case the covariance matrix is diagonal, the algorithm is much simpler: we can skip "
  1130. "the first and third step.")
  1131. MAN_END
  1132. MAN_BEGIN (U"Covariance & TableOfReal: Extract quantile range...", U"djmw", 20040225)
  1133. INTRO (U"Extract those rows from the selected @TableOfReal object whose @@Mahalanobis "
  1134. "distance@, with respect to the selected @Covariance object, are within the "
  1135. "quantile range.")
  1136. MAN_END
  1137. MAN_BEGIN (U"Covariance & TableOfReal: To TableOfReal (mahalanobis)...", U"djmw", 20170828)
  1138. INTRO (U"Calculate @@Mahalanobis distance@ for the selected @TableOfReal with respect to the "
  1139. "selected @Covariance object.")
  1140. ENTRY (U"Setting")
  1141. TAG (U"##Use table centroid")
  1142. DEFINITION (U"Use the mean vector calculated from the columns in the selected TableOfReal instead of the means in the selected Covariance.")
  1143. ENTRY (U"Example")
  1144. NORMAL (U"Count the number of items that are within 1, 2, 3, 4 and 5 standard deviations from the mean.")
  1145. NORMAL (U"We first create a table with only one column and 10000 rows and fill it with numbers drawn from "
  1146. "a normal distribution with mean zero and standard deviation one. Its covariance matrix, of course, is "
  1147. "one dimensional. We next create a table with Mahalanobis distances.")
  1148. CODE (U"n = 100000")
  1149. CODE (U"t0 = Create TableOfReal: \"table\", n, 1")
  1150. CODE (U"Formula: ~ randomGauss (0, 1)")
  1151. CODE (U"c = To Covariance")
  1152. CODE (U"selectObject: c, t0")
  1153. CODE (U"ts = To TableOfReal (mahalanobis): \"no\"")
  1154. CODE (U"")
  1155. CODE (U"for nsigma to 5")
  1156. CODE1 (U" selectObject: ts")
  1157. CODE1 (U" extraction = Extract rows where: ~ self < nsigma")
  1158. CODE1 (U" nr = Get number of rows")
  1159. CODE1 (U" nrp = nr / n * 100")
  1160. CODE1 (U" expect = (1 - 2 * gaussQ (nsigma)) * 100")
  1161. CODE1 (U" writeInfoLine: nsigma, \"-sigma: \", nrp, \"%, \", expect, \"%\"")
  1162. CODE1 (U" removeObject: extraction")
  1163. CODE (U"endfor")
  1164. MAN_END
  1165. MAN_BEGIN (U"Create ChebyshevSeries...", U"djmw", 20040407)
  1166. INTRO (U"A command to create a @ChebyshevSeries from a list of coefficients.")
  1167. ENTRY (U"Settings")
  1168. TAG (U"##Xmin# and ##Xmax#")
  1169. DEFINITION (U"define the domain of the polynomials.")
  1170. TAG (U"%Coefficients")
  1171. DEFINITION (U"define the coefficients of each @@Chebyshev polynomials|Chebyshev polynomial@. "
  1172. "The coefficient of the polynomial with the highest degree comes last.")
  1173. MAN_END
  1174. MAN_BEGIN (U"Create ISpline...", U"djmw", 20040407)
  1175. INTRO (U"A command to create an @ISpline from a list of coefficients.")
  1176. ENTRY (U"Settings")
  1177. TAG (U"##Xmin# and ##Xmax#")
  1178. DEFINITION (U"define the domain of the polynomial @spline.")
  1179. TAG (U"%Degree")
  1180. DEFINITION (U"defines the degree of the polynomial @spline.")
  1181. TAG (U"%Coefficients")
  1182. DEFINITION (U"define the coefficients of the basis polynomials.")
  1183. TAG (U"%%Interior knots")
  1184. DEFINITION (U"define the positions in the domain where continuity conditions are defined.")
  1185. ENTRY (U"Behaviour")
  1186. NORMAL (U"The number of coefficients and the number of interior knots must satisfy "
  1187. "the following relation:")
  1188. FORMULA (U"%numberOfCoefficients = %numberOfInteriorKnots + %degree")
  1189. NORMAL (U"")
  1190. MAN_END
  1191. MAN_BEGIN (U"Create MSpline...", U"djmw", 20040407)
  1192. INTRO (U"A command to create an @MSpline from a list of coefficients.")
  1193. ENTRY (U"Settings")
  1194. TAG (U"##Xmin# and ##Xmax#")
  1195. DEFINITION (U"define the domain of the polynomial @spline.")
  1196. TAG (U"##Degree")
  1197. DEFINITION (U"defines the degree of the polynomial @spline.")
  1198. TAG (U"##Coefficients")
  1199. DEFINITION (U"define the coefficients of the basis polynomials.")
  1200. TAG (U"##Interior knots")
  1201. DEFINITION (U"define the positions in the domain where continuity conditions are defined.")
  1202. ENTRY (U"Behaviour")
  1203. NORMAL (U"The number of coefficients and the number of interior knots must satisfy "
  1204. "the following relation:")
  1205. FORMULA (U"%numberOfCoefficients = %numberOfInteriorKnots + %degree + 1")
  1206. NORMAL (U"")
  1207. MAN_END
  1208. MAN_BEGIN (U"Create Polynomial...", U"djmw", 20040407)
  1209. INTRO (U"A command to create an @Polynomial from a list of coefficients.")
  1210. ENTRY (U"Settings")
  1211. TAG (U"##Xmin# and ##Xmax#")
  1212. DEFINITION (U"define the domain of the polynomial.")
  1213. TAG (U"##Degree")
  1214. DEFINITION (U"defines the degree of the basis polynomials.")
  1215. TAG (U"##Coefficients")
  1216. DEFINITION (U"define the coefficients of the polynomial. The coefficient of the "
  1217. "highest power of %x comes last.")
  1218. MAN_END
  1219. MAN_BEGIN (U"Create LegendreSeries...", U"djmw", 20040407)
  1220. INTRO (U"A command to create a @LegendreSeries from a list of coefficients.")
  1221. ENTRY (U"Settings")
  1222. TAG (U"##Xmin# and ##Xmax#")
  1223. DEFINITION (U"define the domain of the polynomials.")
  1224. TAG (U"##Coefficients")
  1225. DEFINITION (U"define the coefficients of each @@Legendre polynomials|Legendre polynomial@. "
  1226. "The coefficient of the polynomial with the highest degree comes last.")
  1227. MAN_END
  1228. MAN_BEGIN (U"Create Sound as gammatone...", U"djmw", 20161013)
  1229. INTRO (U"A command to create a @Sound as a @@gammatone@.")
  1230. ENTRY (U"Settings")
  1231. TAG (U"##Name")
  1232. DEFINITION (U"the name of the resulting Sound object.")
  1233. TAG (U"##Minimum time (s)# and ##Maximum time (s)#")
  1234. DEFINITION (U"the start and end time of the resulting Sound.")
  1235. TAG (U"##Sampling frequency (Hz)")
  1236. DEFINITION (U"the @@sampling frequency@ of the resulting Sound.")
  1237. TAG (U"##Gamma")
  1238. DEFINITION (U"determines the exponent of the polynomial.")
  1239. TAG (U"##Frequency (Hz)# and ##Bandwidth (Hz)#")
  1240. DEFINITION (U"determine the frequency and damping of the cosine wave in the gammatone.")
  1241. TAG (U"##Initial phase (radians)")
  1242. DEFINITION (U"the initial phase of the cosine wave.")
  1243. TAG (U"##Addition factor# (standard value: 0)")
  1244. DEFINITION (U"determines the degree of asymmetry in the spectrum of the gammatone. "
  1245. "The zero default value gives a gammatone. A value unequal to zero results in a "
  1246. "so called %gammachirp. A negative value is used in auditory filter modeling to "
  1247. "guarantee the usual direction of filter asymmetry, which corresponds to an upward "
  1248. "glide in instantaneous frequency.")
  1249. TAG (U"##Scale amplitudes")
  1250. DEFINITION (U"determines whether the amplitudes will be scaled to fit in the range (-1, 1).")
  1251. ENTRY (U"Purpose")
  1252. NORMAL (U"to create a Sound according to the following formula:")
  1253. FORMULA (U"%t^^%\\ga\\--1^ e^^\\--2%\\pi\\.c%bandwidth\\.c%t^ "
  1254. "cos (2%%\\pi\\.cfrequency\\.ct% + %additionFactor\\.cln(%t) + %initialPhase),")
  1255. NORMAL (U"The %gammachirp function has a monotonically frequency-modulated carrier (the chirp) with "
  1256. "instantaneous frequency ")
  1257. FORMULA (U"%instantaneousFrequency(%t) = %frequency + %additionFactor / (2\\.c\\pi\\.c%t)")
  1258. NORMAL (U"and an envelope that is a gamma distribution function. It is a theoretically optimum "
  1259. "auditory filter, in the sense that it leads to minimal uncertainty in the joint time and "
  1260. "scale representation of auditory signal analysis.")
  1261. NORMAL (U"For faithful modelling of the inner ear, "
  1262. "@@Irino & Patterson (1997)@ conclude that a value of approximately 1.5 * ERB (%frequency) "
  1263. "is appropriate for %bandwidth. "
  1264. "ERB stands for @@equivalent rectangular bandwidth@. Their formula for ERB is:")
  1265. FORMULA (U"ERB(%f) = 6.23 10^^\\--6^ %f^2 + 93.39 10^^\\--3^ %f + 28.52.")
  1266. NORMAL (U"To avoid @aliasing in the chirp sound, a sound is only generated during times where the "
  1267. "instantaneous frequency is greater than zero and smaller than the @@Nyquist frequency@.")
  1268. MAN_END
  1269. MAN_BEGIN (U"Create Sound as Shepard tone...", U"djmw", 20161013)
  1270. INTRO (U"One of the commands that create a @Sound.")
  1271. ENTRY (U"Settings")
  1272. TAG (U"##Name")
  1273. DEFINITION (U"the name of the resulting Sound object.")
  1274. TAG (U"##Minimum time (s)# and ##Maximum time (s)")
  1275. DEFINITION (U"the start and end time of the resulting Sound.")
  1276. TAG (U"##Sampling frequency (Hz)")
  1277. DEFINITION (U"the @@sampling frequency@ of the resulting Sound.")
  1278. TAG (U"##Lowest frequency (Hz)")
  1279. DEFINITION (U"the frequency of the lowest component in the tone complex.")
  1280. TAG (U"##Number of components")
  1281. DEFINITION (U"the number of frequency components in the tone complex.")
  1282. TAG (U"##Frequency change (semitones/s)")
  1283. DEFINITION (U"determines how many semitones the frequency of each component will change in one second. "
  1284. "The number of seconds needed to change one octave will then be 12 divided by ##Frequency change#. "
  1285. "You can make rising, falling and monotonous tone complexes by chosing a positive, negative or zero value.")
  1286. TAG (U"##Amplitude range% (dB)")
  1287. DEFINITION (U"determines the relative size in decibels of the maximum and the minimum amplitude of the components in a tone complex. These relative amplitudes will then be 10^^\\--%amplitudeRange/20^. ")
  1288. TAG (U"##Octave shift fraction (0-1)")
  1289. DEFINITION (U"shifts all frequency components by this fraction at the start. You will probably only need this "
  1290. "if you want to generate static tone complexes as the example script below shows.")
  1291. ENTRY (U"Purpose")
  1292. NORMAL (U"To create a Sound that is a continuous variant of the sound sequences "
  1293. "used by @@Shepard (1964)@ in his "
  1294. "experiment about the circularity in judgments of relative pitch.")
  1295. NORMAL (U"The tone consists of many sinusoidal components whose frequencies "
  1296. "might increase exponentially in time. "
  1297. "All frequencies are always at successive intervals of an octave and sounded simultaneously. "
  1298. "Thus the frequency of each component above the lowest is at each moment in time exactly twice "
  1299. "the frequency of the one just below. The amplitudes are large for the components of intermediate "
  1300. "frequency only, and tapered off gradually to subthreshold levels for the components at the "
  1301. "highest and lowest extremes of frequency.")
  1302. NORMAL (U"For a rising tone complex, the Sound is generated according to the following specification:")
  1303. FORMULA (U"%s(%t) = \\su__%i=1..%numberOfComponents_ %A__%i_(%t) sin (arg__%i_(%t)), where")
  1304. FORMULA (U"arg__%i_(%t) = \\in 2%\\pi f__%i_(%\\ta) %d\\ta , and")
  1305. FORMULA (U"f__%i_(%t) = %lowestFrequency \\.c 2^^(%i \\-- 1 + octaveShiftFraction + %t/(12/%frequencyChange_st)^, with")
  1306. FORMULA (U"%A__%i_(%t) = 10^^((%L__min_ + (%L__max_ \\-- %L__min_) (1 \\-- cos 2%\\pi%\\te__%i_(%t)) / 2) / 20)^, where,")
  1307. FORMULA (U"%L__max_ = 0, %L__min_ = 10^^\\--%amplitudeRange/20^, and,")
  1308. FORMULA (U"%\\te__%i_(%t) = 2\\pi log2 (%f(%t) / %lowestFrequency) / %numberOfComponents.")
  1309. NORMAL (U"The maximum frequency that can be reached during a sweep by any single tone is:")
  1310. FORMULA (U"%maximumFrequency = %lowestFrequency\\.c2^^%numberOfComponents^.")
  1311. NORMAL (U"A component that reaches the maximum frequency falls instantaneously to the lowest frequency and then starts rising again.")
  1312. NORMAL (U"The absolute @@sound pressure level@ of the resulting sound will not be set, it is only guaranteed that the peak value "
  1313. "is just below 1. You can always scale the intensity with the ##Scale Intensity...# command.")
  1314. ENTRY (U"Example")
  1315. NORMAL (U"The following script generates 12 static Shepard tone complexes, 1 semitone 'apart', "
  1316. "with a cosine window to temper the abrupt start and finish.")
  1317. CODE (U"fadeTime = 0.010")
  1318. CODE (U"for i to 12")
  1319. CODE1 (U"fraction = (i-1)/12")
  1320. CODE1 (U"Create Sound as Shepard tone: \"s\" + string\\$ (i), 0, 0.1, 22050, 4.863, 10, 0, 34, fraction")
  1321. CODE1 (U"Fade in: 0, 0, fadeTime, \"no\"")
  1322. CODE1 (U"Fade out: 0, 0.1, -fadeTime, \"no\"")
  1323. CODE (U"endfor")
  1324. MAN_END
  1325. MAN_BEGIN (U"Create formant table (Peterson & Barney 1952)", U"djmw", 20080509)
  1326. INTRO (U"A command to create a @Table object filled with the "
  1327. "fundamental frequency and the first three formant frequency values from 10 "
  1328. "American-English monophthongal vowels as spoken in a /h_d/ context by 76 speakers "
  1329. "(33 men, 28 women and 15 children). Every vowel was pronounced twice, so that there are "
  1330. "1520 recorded vowels in total.")
  1331. ENTRY (U"Table layout")
  1332. NORMAL (U"The created table will contain 9 columns:")
  1333. TAG (U"Column 1, labelled as %Type")
  1334. DEFINITION (U"speaker type: \"m\", \"w\" or \"c\" (for %man, %women or %child).")
  1335. TAG (U"Column 2, labelled as %Sex")
  1336. DEFINITION (U"speaker sex: either \"m\" or \"f\" (for %male or %female).")
  1337. TAG (U"Column 3, labelled as %Speaker")
  1338. DEFINITION (U"speaker id: a number from 1 to 76.")
  1339. TAG (U"Column 4, labelled as %Vowel")
  1340. DEFINITION (U"the vowel name. The following list gives the vowel in a %h_d context word "
  1341. "together with its representation in this column: (%heed, iy), (%hid, ih), "
  1342. "(%head, eh), (%had, ae), (%hod, aa), (%hawed, ao), (%hood, uh), (%%who'd%, uw), "
  1343. "(%hud, ah), (%heard, er).")
  1344. TAG (U"Column 5, labelled as %IPA")
  1345. DEFINITION (U"the IPA notation for the vowels as defined in @@Peterson & Barney (1952)@. ")
  1346. TAG (U"Column 6, labelled as %F0")
  1347. DEFINITION (U"the fundamental frequency in Hertz.")
  1348. TAG (U"Column 7, 8 and 9, labelled as %F1, %F2 and %F3")
  1349. DEFINITION (U"the frequencies in Hertz of the first three formants.")
  1350. ENTRY (U"Remarks")
  1351. NORMAL (U"We originally downloaded the data from the University of Pennsylvania FTP site, "
  1352. "where they were reportedly based on a printed version supplied by Ignatius Mattingly. ")
  1353. NORMAL (U"About the IPA notation. We used the original notation from the Peterson & Barney article. "
  1354. "The notation in @@Watrous (1991)@ differs for three vowels: Watrous uses /e, o, \\er/ where Peterson & Barney use /\\ef, \\ct, \\er\\hr/.")
  1355. NORMAL (U"More details about these data and how they were measured can be found in the articles"
  1356. "@@Watrous (1991)@ and in @@Peterson & Barney (1952)@.")
  1357. MAN_END
  1358. MAN_BEGIN (U"Create formant table (Pols & Van Nierop 1973)", U"djmw", 20020620)
  1359. INTRO (U"A command to create a @Table object filled with the frequencies and the levels "
  1360. "of the first three formants from the 12 Dutch monophthong "
  1361. "vowels as spoken in /h_t/ context by 50 male and 25 female speakers.")
  1362. ENTRY (U"Table layout")
  1363. NORMAL (U"The created table will contain 10 columns")
  1364. TAG (U"Column 1, labeled as %Sex")
  1365. DEFINITION (U"speaker sex: Either \"m\" or \"f\" (for %male or %female).")
  1366. TAG (U"Column 2, labeled as %Speaker")
  1367. DEFINITION (U"speaker id: a number from 1 to 75.")
  1368. TAG (U"Column 3, labeled as %Vowel")
  1369. DEFINITION (U"the vowel name. The following list gives the vowel in p_t context word "
  1370. "together with its representation in this column: (%poet, oe), (%paat, aa), "
  1371. "(%poot, oo), (%pat, a), (%peut, eu), (%piet, ie), (%puut, uu), (%peet, ee), "
  1372. "(%put, u), (%pet, e), (%pot, o), (%pit, i).")
  1373. TAG (U"Column 4, labeled as %IPA")
  1374. DEFINITION (U"the IPA-notation for the vowels")
  1375. TAG (U"Column 5, 6 and 7, labeled as %F1, %F2 and %F3")
  1376. DEFINITION (U"the frequencies in Hertz of the first three formants.")
  1377. TAG (U"Column 8, 9 and 10, labeled as %L1, %L2 and %L3")
  1378. DEFINITION (U"the levels in decibel below overall SPL of the first three formants.")
  1379. NORMAL (U"More details about these data and how they were measured can be found "
  1380. "in @@Pols et al. (1973)@ and @@Van Nierop et al. (1973)@.")
  1381. MAN_END
  1382. MAN_BEGIN (U"Create formant table (Weenink 1985)", U"djmw", 20041217)
  1383. INTRO (U"A command to create a @Table object filled with the "
  1384. "fundamental frequency and the first three formant frequency values from 12 "
  1385. "Dutch monophthongal vowels as spoken in isolation by 30 speakers "
  1386. "(10 men, 10 women and 10 children). Every vowel was pronounced only once, so that there are "
  1387. "360 recorded vowels in total. A reduced form, with only the formant frequecy values, is also available "
  1388. "as a @@Create TableOfReal (Weenink 1985)...|TableOfReal@.")
  1389. ENTRY (U"Table layout")
  1390. NORMAL (U"The created table will contain 9 columns:")
  1391. TAG (U"Column 1, labelled as %Type")
  1392. DEFINITION (U"speaker type: \"m\", \"w\" or \"c\" (for %man, %women or %child).")
  1393. TAG (U"Column 2, labelled as %Sex")
  1394. DEFINITION (U"speaker sex: either \"m\" or \"f\" (for %male or %female).")
  1395. TAG (U"Column 3, labelled as %Speaker")
  1396. DEFINITION (U"speaker id: a number from 1 to 76.")
  1397. TAG (U"Column 4, labelled as %Vowel")
  1398. DEFINITION (U"the vowel name. The following list gives the vowel in Dutch p_t context words "
  1399. "together with its representation in this column: (%poet, oe), (%paat, aa), "
  1400. "(%poot, oo), (%pat, a), (%peut, eu), (%piet, ie), (%puut, uu), (%peet, ee), "
  1401. "(%put, u), (%pet, e), (%pot, o), (%pit, i).")
  1402. TAG (U"Column 5, labelled as %IPA")
  1403. DEFINITION (U"the IPA notation for the vowels.")
  1404. TAG (U"Column 6, labelled as %F0")
  1405. DEFINITION (U"the fundamental frequency in Hertz.")
  1406. TAG (U"Column 7, 8 and 9, labelled as %F1, %F2 and %F3")
  1407. DEFINITION (U"the frequencies in Hertz of the first three formants. ")
  1408. NORMAL (U"The formant frequency values have been determined by means of LPC analysis with a "
  1409. "varying prediction order. See @@Weenink (1985)@.")
  1410. MAN_END
  1411. MAN_BEGIN (U"Create TableOfReal (Pols 1973)...", U"djmw", 19990426)
  1412. INTRO (U"A command to create a @TableOfReal filled with the first three formant "
  1413. "frequency values and (optionally) the levels from the 12 Dutch monophthongal "
  1414. "vowels as spoken in /h_t/ context by 50 male speakers.")
  1415. NORMAL (U"The first three columns will contain the frequencies in Hz, the next three columns "
  1416. "the levels in decibels below the overall SPL of the measured vowel segment. Each row will "
  1417. "be labelled with its corresponding vowel symbol.")
  1418. NORMAL (U"More details about these data and how they were measured can be found in the paper of "
  1419. "@@Pols et al. (1973)@.")
  1420. MAN_END
  1421. MAN_BEGIN (U"Create TableOfReal (Sandwell 1987)", U"djmw", 20170917)
  1422. INTRO (U"A command to create a @TableOfReal filled with the data point of Fig. 2 in the article of @@Sandwell (1987)@.")
  1423. NORMAL (U"These arbitrary sampled data points are often used in testing interpolation algorithms.")
  1424. SCRIPT (6, 6, U" "
  1425. "tor = Create TableOfReal (Sandwell 1987)\n"
  1426. "Draw scatter plot: 1, 2, 0, 0, -0.5, 10.5, -6, 16, 10, \"no\", \"0\", \"no\"\n"
  1427. "Draw inner box\n"
  1428. "Marks bottom every: 1, 2, \"yes\", \"yes\", \"no\"\n"
  1429. "Marks left every: 1, 4, \"yes\", \"yes\", \"no\"\n"
  1430. "removeObject: tor")
  1431. MAN_END
  1432. MAN_BEGIN (U"Create TableOfReal (Van Nierop 1973)...", U"djmw", 20041217)
  1433. INTRO (U"A command to create a @TableOfReal filled with the first three formant "
  1434. "frequency values and (optionally) the levels from the 12 Dutch monophthongal "
  1435. "vowels as spoken in /h_t/ context by 25 female speakers.")
  1436. NORMAL (U"The first three columns will contain the frequencies in Hz, the next three columns "
  1437. "the levels in decibels below the overall SPL of the measured vowel segment. Each row will "
  1438. "be labelled with its corresponding vowel symbol.")
  1439. NORMAL (U"More details about these data and how they were measured can be found in the paper of "
  1440. "@@Van Nierop et al. (1973)@.")
  1441. MAN_END
  1442. MAN_BEGIN (U"Create TableOfReal (Weenink 1985)...", U"djmw", 19990426)
  1443. INTRO (U"A command to create a @TableOfReal filled with the first three formant "
  1444. "frequency values from the 12 Dutch monophthongal "
  1445. "vowels as spoken in isolation by either 10 men or 10 women or 10 children.")
  1446. NORMAL (U"The three columns will contain the formant frequencies in Hz. Each row will "
  1447. "be labelled with its corresponding vowel symbol.")
  1448. NORMAL (U"More details about these data and how they were measured can be found in the paper of "
  1449. "@@Weenink (1985)@.")
  1450. MAN_END
  1451. MAN_BEGIN (U"Discriminant", U"djmw", 20160128)
  1452. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  1453. NORMAL (U"An object of type Discriminant represents the discriminant structure of a multivariate "
  1454. "data set, i.e. a %%numberOfObservations%\\xx%%dimension% matrix. Each row in this data set belongs to one of %%numberOfGroups% groups (or %%classes% or %categories%, whatever terminology you prefer). "
  1455. "A Discriminant can be used as a classifier to discriminate between these %%numberOfGroups% groups.")
  1456. ENTRY (U"##Inside a Discriminant")
  1457. NORMAL (U"With @@Inspect@, you will see that a Discriminant contains the following data:")
  1458. LIST_ITEM (U"##eigen#")
  1459. DEFINITION (U"the @@Eigen|eigen@ structure, i.e. the eigenvalues and eigenvectors.")
  1460. LIST_ITEM (U"##numberOfGroups")
  1461. DEFINITION (U"the number of groups between which we can discriminate.")
  1462. LIST_ITEM (U"##groups")
  1463. DEFINITION (U"a list of %%dimension%\\xx%%dimension% @SSCP matrices, one for each group, %numberOfGroups in total.")
  1464. LIST_ITEM (U"##aprioriProbabilities")
  1465. DEFINITION (U"an array with %numberOfGroups apriori probabilities of group membership")
  1466. ENTRY (U"Commands")
  1467. NORMAL (U"Creation:")
  1468. LIST_ITEM (U"\\bu @@Discriminant analysis@ tutorial")
  1469. LIST_ITEM (U"\\bu @@TableOfReal: To Discriminant@")
  1470. NORMAL (U"Drawing")
  1471. LIST_ITEM (U"\\bu Draw eigenvalues...")
  1472. LIST_ITEM (U"\\bu Draw eigenvector...")
  1473. LIST_ITEM (U"\\bu @@Discriminant: Draw sigma ellipses...|Draw sigma ellipses...@")
  1474. MAN_END
  1475. MAN_BEGIN (U"Discriminant analysis", U"djmw", 20170829)
  1476. INTRO (U"This tutorial will show you how to perform discriminant analysis with Praat.")
  1477. NORMAL (U"As an example, we will use the dataset from @@Pols et al. (1973)@ "
  1478. "with the frequencies and levels of the first three formants from the 12 "
  1479. "Dutch monophthongal vowels as spoken in /h_t/ context by 50 male speakers. "
  1480. "This data set has been incorporated into "
  1481. "Praat and can be called into play with the @@Create TableOfReal "
  1482. "(Pols 1973)...@ command that can be found in the \"New / "
  1483. "TableOfReal\" menu.")
  1484. NORMAL (U"In the list of objects a new TableOfReal object will appear with 6 "
  1485. "columns and 600 rows "
  1486. "(50 speakers \\xx 12 vowels). The first three columns contain "
  1487. "the formant frequencies in Hz, the last three columns contain the levels "
  1488. "of the first three formants "
  1489. "given in decibels below the overall sound pressure level of the measured "
  1490. "vowel segment. Each row is labelled with a vowel label.")
  1491. NORMAL (U"Pols et al. use logarithms of frequency values, we will too. Because "
  1492. "the measurement units in the first three columns are in Hz and in the last "
  1493. "three columns in dB, it is probably better to standardize the columns. "
  1494. "The following script summarizes our achievements up till now:")
  1495. CODE (U"table = Create TableOfReal (Pols 1973): \"yes\"")
  1496. CODE (U"Formula: ~ if col < 4 then log10 (self) else self fi")
  1497. CODE (U"Standardize columns")
  1498. CODE (U"\\# change the column labels too, for nice plot labels.")
  1499. CODE (U"Set column label (index): 1, \"standardized log (\\% F\\_ \\_ 1\\_ )\"")
  1500. CODE (U"Set column label (index): 2, \"standardized log (\\% F\\_ \\_ 2\\_ )\"")
  1501. CODE (U"Set column label (index): 3, \"standardized log (\\% F\\_ \\_ 3\\_ )\"")
  1502. CODE (U"Set column label (index): 4, \"standardized \\% L\\_ \\_ 1\\_ \"")
  1503. CODE (U"Set column label (index): 5, \"standardized \\% L\\_ \\_ 2\\_ \"")
  1504. CODE (U"Set column label (index): 6, \"standardized \\% L\\_ \\_ 3\\_ \"")
  1505. NORMAL (U"To get an indication of what these data look like, we make a scatter "
  1506. "plot of the "
  1507. "first standardized log-formant-frequency against the second standardized "
  1508. "log-formant-frequency. With the next script fragment you can reproduce the "
  1509. "following picture.")
  1510. CODE (U"Select outer viewport: 0, 5, 0, 5")
  1511. CODE (U"selectObject: table")
  1512. CODE (U"Draw scatter plot: 1, 2, 0, 0, -2.9, 2.9, -2.9, 2.9, 10, \"yes\", \"+\", \"yes\"")
  1513. PICTURE (5, 5, drawPolsF1F2_log)
  1514. NORMAL (U"Apart from a difference in scale this plot is the same as fig. 3 in the "
  1515. "Pols et al. article.")
  1516. ENTRY (U"1. How to perform a discriminant analysis")
  1517. NORMAL (U"Select the TableOfReal and choose from the dynamic menu the option "
  1518. "@@TableOfReal: To Discriminant|To Discriminant@. This command is available "
  1519. "in the \"Multivariate statistics\" action button. The resulting Discriminant "
  1520. "object will bear the same name as the TableOfReal object. The following "
  1521. "script summarizes:")
  1522. CODE (U"selectObject: table")
  1523. CODE (U"discrimimant = To Discriminant")
  1524. ENTRY (U"2. How to project data on the discriminant space")
  1525. NORMAL (U"You select a TableOfReal and a Discriminant object together and choose: "
  1526. "@@Discriminant & TableOfReal: To Configuration...|To Configuration...@. "
  1527. "One of the options of the newly created Configuration object is to draw it. "
  1528. "The following picture shows how the data look in the plane spanned by the "
  1529. "first two dimensions of this Configuration. The directions in this "
  1530. "configuration are the eigenvectors from the Discriminant.")
  1531. PICTURE (5, 5, drawPolsDiscriminantConfiguration)
  1532. NORMAL (U"The following script summarizes:")
  1533. CODE (U"selectObject: table, discriminant")
  1534. CODE (U"To Configuration: 2")
  1535. CODE (U"Select outer viewport: 0, 5, 0, 5")
  1536. CODE (U"Draw: 1, 2, -2.9, 2.9, -2.9, 2.9, 12, \"yes\", \"+\", \"yes\"")
  1537. NORMAL (U"If you are only interested in this projection, there also is a shortcut "
  1538. "without an intermediate Discriminant object: "
  1539. "select the TableOfReal object and choose @@TableOfReal: To Configuration "
  1540. "(lda)...|To Configuration (lda)...@.")
  1541. ENTRY (U"3. How to draw concentration ellipses")
  1542. NORMAL (U"Select the Discriminant object and choose @@Discriminant: Draw sigma "
  1543. "ellipses...|Draw sigma ellipses...@. In the form you can fill out the "
  1544. "coverage of the ellipse by way of the %%Number of sigmas% parameter. "
  1545. "You can also select the projection "
  1546. "plane. The next figure shows the 1-%\\si concentration ellipses in the "
  1547. "standardized log %F__1_ vs log %F__2_ plane. When the data are multinormally distributed, "
  1548. "a 1-%\\si ellipse will cover approximately 39.3\\% of the data. "
  1549. "The following code summarizes:")
  1550. CODE (U"selectObject: discriminant")
  1551. CODE (U"Draw sigma ellipses: 1.0, \"no\", 1, 2, -2.9, 2.9, -2.9, 2.9, 12, \"yes\"")
  1552. PICTURE (5, 5, drawPolsF1F2ConcentrationEllipses)
  1553. ENTRY (U"4. How to classify")
  1554. NORMAL (U"Select together the Discriminant object (the classifier), and "
  1555. "a TableOfReal object (the data to be classified). Next you choose "
  1556. "@@Discriminant & TableOfReal: To ClassificationTable...|To "
  1557. "ClassificationTable@. "
  1558. "Normally you will enable the option %%Pool covariance matrices% and "
  1559. "the pooled covariance matrix will be used for classification.")
  1560. NORMAL (U"The ClassificationTable can be converted to a @Confusion object "
  1561. "and its fraction correct can be queried with: "
  1562. "@@Confusion: Get fraction correct@.")
  1563. NORMAL (U"In general you would separate your data into two independent sets, "
  1564. "\\s{TRAIN} and \\s{TEST}. You would use \\s{TRAIN} to train the "
  1565. "discriminant classifier and \\s{TEST} to test how well it classifies. "
  1566. "Several possibilities for splitting a dataset into two sets exist. "
  1567. "We mention the @@jackknife@ (\"leave-one-out\") and the "
  1568. "@@bootstrap@ methods (\"resampling\").")
  1569. ENTRY (U"5.1 Jackknife classification")
  1570. NORMAL (U"The following script summarizes #jackknife classification of the dataset:")
  1571. CODE (U"selectObject: table")
  1572. CODE (U"numberOfRows = Get number of rows")
  1573. CODE (U"for irow to numberOfRows")
  1574. CODE1 (U"selectObject: table")
  1575. CODE1 (U"rowi = Extract rows where: ~ row = irow")
  1576. CODE1 (U"selectObject: table")
  1577. CODE1 (U"rest = Extract rows where: ~ row <> irow")
  1578. CODE1 (U"discriminant = To Discriminant")
  1579. CODE1 (U"plusObject: rowi")
  1580. CODE1 (U"classification = To ClassificationTable: \"yes\", \"yes\"")
  1581. CODE1 (U"if irow = 1")
  1582. CODE2 (U"confusion = To Confusion: \"yes\"")
  1583. CODE1 (U"else")
  1584. CODE2 (U" plusObject: confusion")
  1585. CODE2 (U" Increase confusion count")
  1586. CODE (U" endif")
  1587. CODE (U" removeObject: rowi, rest, discriminant, classification")
  1588. CODE (U"endfor")
  1589. CODE (U"selectObject: confusion")
  1590. CODE (U"fractionCorrect = Get fraction correct")
  1591. CODE (U"appendInfoLine: fractionCorrect, \" (= fraction correct, jackknifed \", numberOfRows, \" times).\"")
  1592. CODE (U"removeObject: confusion")
  1593. ENTRY (U"5.2 Bootstrap classification")
  1594. NORMAL (U"The following script summarizes bootstrap classification.")
  1595. CODE (U"fractionCorrect = 0")
  1596. CODE (U"for i to numberOfBootstraps")
  1597. CODE (U" selectObject: table")
  1598. CODE (U" resampled = To TableOfReal (bootstrap)")
  1599. CODE (U" discriminant = To Discriminant")
  1600. CODE (U" plusObject: resampled")
  1601. CODE (U" classification = To ClassificationTable: \"yes\", \"yes\"")
  1602. CODE (U" confusion = To Confusion: \"yes\"")
  1603. CODE (U" fc = Get fraction correct")
  1604. CODE (U" fractionCorrect += fc")
  1605. CODE (U" removeObject: resampled, discriminant, classification, confusion")
  1606. CODE (U"endfor")
  1607. CODE (U"fractionCorrect /= numberOfBootstraps")
  1608. CODE (U"appendInfoLine: fractionCorrect, \" (= fraction correct, bootstrapped \", numberOfBootstraps, \" times).\"")
  1609. MAN_END
  1610. MAN_BEGIN (U"Discriminant: Draw sigma ellipses...", U"djmw", 20040407)
  1611. INTRO (U"A command to draw for each group from the selected @Discriminant an ellipse "
  1612. "that covers part of the multivariate data.")
  1613. ENTRY (U"Settings")
  1614. TAG (U"##Number of sigmas")
  1615. DEFINITION (U"determines the @@concentration ellipse|data coverage@.")
  1616. TAG (U"##Discriminant plane")
  1617. DEFINITION (U"When on, the selected %X and %Y-dimension will refer to the eigenvectors "
  1618. "of the discriminant space, and, consequently, the projection of the hyper ellipsoid "
  1619. "onto the space spanned by these eigenvectors will be drawn. When off, the selected "
  1620. "%X and Y-dimension will refer to the original dimensions.")
  1621. TAG (U"##Xmin#, ##Xmax#, ##Ymin#, ##Ymax#")
  1622. DEFINITION (U"determine the limits of the drawing area.")
  1623. TAG (U"##Label size")
  1624. DEFINITION (U"determines the size of the labels at the centre of the ellipse. No "
  1625. "labels will be drawn when a value less than or equal to zero is chosen.")
  1626. MAN_END
  1627. MAN_BEGIN (U"Discriminant: Extract within-group SSCP...", U"djmw", 20020314)
  1628. INTRO (U"Extract the @SSCP for group %%index% from the selected @Discriminant "
  1629. "object.")
  1630. MAN_END
  1631. MAN_BEGIN (U"Discriminant: Extract pooled within-groups SSCP", U"djmw", 20020314)
  1632. INTRO (U"Extract the pooled within-group @SSCP from the selected @Discriminant "
  1633. "object.")
  1634. MAN_END
  1635. MAN_BEGIN (U"Discriminant: Get partial discrimination probability...", U"djmw", 19981102)
  1636. INTRO (U"A command to test the selected @Discriminant for the significance of "
  1637. "discrimination afforded by the remaining %n\\--%k eigenvectors after the acceptance of "
  1638. "the first %k eigenvectors.")
  1639. ENTRY (U"Details")
  1640. NORMAL (U"The test statistic is:")
  1641. FORMULA (U"%\\ci^2 = \\--(%degreesOfFreedom\\--(%numberOfGroups+%dimension)/2) ln \\La\\'p, where")
  1642. FORMULA (U"%degreesOfFreedom = (%dimension\\--%k)(%numberOfGroups\\--%k\\--1), and, ")
  1643. FORMULA (U"\\La\\'p = \\Pi__%j=%k+1..%numberOfEigenvalues_ 1 / (1 + %%eigenvalue[j]%)")
  1644. MAN_END
  1645. MAN_BEGIN (U"Discriminant: Get contribution of component...", U"djmw", 19981106)
  1646. INTRO (U"A command to ask the selected @Discriminant for the contribution of the %j^^th^ "
  1647. "discriminant function (component) to the total variance.")
  1648. ENTRY (U"Details")
  1649. NORMAL (U"The contribution is defined as:")
  1650. FORMULA (U"%%eigenvalue[j]% / \\Si__%i=1..%numberOfEigenvalues_ %%eigenvalue[i]%")
  1651. MAN_END
  1652. MAN_BEGIN (U"Discriminant: Get Wilks' lambda...", U"djmw", 20040407)
  1653. INTRO (U"A command to ask the selected @Discriminant for the value of Wilks' lamda (a "
  1654. "multivariate measure of group differences over several variables).")
  1655. ENTRY (U"Settings")
  1656. TAG (U"##From")
  1657. DEFINITION (U"the first eigenvalue number from which the value for lambda has to be calculated.")
  1658. ENTRY (U"Details")
  1659. NORMAL (U"Wilks' lambda is defined as:")
  1660. FORMULA (U"%\\La = \\Pi__%i=%from..%numberOfEigenvalues_ 1 / (1 + %eigenvalue[%i])")
  1661. NORMAL (U"Because lambda is a kind of %inverse measure, values of lambda which are near zero "
  1662. "denote high discrimination between groups.")
  1663. MAN_END
  1664. MAN_BEGIN (U"Discriminant: Get concentration ellipse area...", U"djmw", 20040407)
  1665. INTRO (U"A command to query the @Discriminant object for the area of the concentration "
  1666. "ellipse of one of its groups.")
  1667. ENTRY (U"Settings")
  1668. TAG (U"##Number of sigmas")
  1669. DEFINITION (U"determines the @@concentration ellipse|data coverage@.")
  1670. TAG (U"##Discriminant plane")
  1671. DEFINITION (U"When on, the selected %X and %Y-dimension will refer to the eigenvectors "
  1672. "of the discriminant space, and, consequently, the area of the projection of the hyper ellipsoid "
  1673. "onto the space spanned by these eigenvectors will be calculated. When off, the selected "
  1674. "%X and Y-dimension will refer to the original dimensions.")
  1675. ENTRY (U"Algorithm")
  1676. NORMAL (U"See @@SSCP: Get sigma ellipse area...")
  1677. MAN_END
  1678. MAN_BEGIN (U"Discriminant: Get confidence ellipse area...", U"djmw", 20040407)
  1679. INTRO (U"A command to query the @Discriminant object for the area of the confidence "
  1680. "ellipse of one of its groups.")
  1681. ENTRY (U"Settings")
  1682. TAG (U"##Discriminant plane")
  1683. DEFINITION (U"When on, the selected %X and %Y-dimension will refer to the eigenvectors "
  1684. "of the discriminant space, and, consequently, the area of the projection of the hyper ellipsoid "
  1685. "onto the space spanned by these eigenvectors will be calculated. When off, the selected "
  1686. "%X and Y-dimension will refer to the original dimensions.")
  1687. ENTRY (U"Algorithm")
  1688. NORMAL (U"See @@SSCP: Get confidence ellipse area...")
  1689. MAN_END
  1690. MAN_BEGIN (U"Discriminant & PatternList: To Categories...", U"djmw", 20040422)
  1691. INTRO (U"A command to use the selected @Discriminant to classify each pattern from the "
  1692. "selected @PatternList into a category.")
  1693. NORMAL (U"Arguments as in @@Discriminant & TableOfReal: To ClassificationTable...@.")
  1694. MAN_END
  1695. MAN_BEGIN (U"Discriminant & SSCP: Project", U"djmw", 20020313)
  1696. INTRO (U"A command to project the selected @SSCP object on the eigenspace "
  1697. "defined by the selected @Discriminant object.")
  1698. NORMAL (U"Further details can be found in @@Eigen & SSCP: Project@")
  1699. MAN_END
  1700. MAN_BEGIN (U"Discriminant & TableOfReal: To ClassificationTable...", U"djmw", 20040407)
  1701. INTRO (U"A command to use the selected @Discriminant to classify each row from the "
  1702. "selected @TableOfReal. The newly created @ClassificationTable will then contain the posterior "
  1703. "probabilities of group membership.")
  1704. ENTRY (U"Settings")
  1705. TAG (U"##Pool covariance matrices")
  1706. DEFINITION (U"when on, all group covariance matrices are pooled and distances will be determined "
  1707. "on the basis of only this pooled covariance matrix (see below).")
  1708. ENTRY (U"Details")
  1709. NORMAL (U"The posterior probabilities of group membership %p__%j_ for a vector #x are defined as:")
  1710. FORMULA (U"%p__%j_ = %p(%j\\| #%x) = exp (\\--%d__%j_^^2^(#%x) / 2) / "
  1711. "\\su__%k=1..%numberOfGroups_ exp (\\--%d__%k_^^2^(#%x) / 2),")
  1712. NORMAL (U"where %d__%i_^^2^ is the generalized squared distance function:")
  1713. FORMULA (U"%d__%i_^^2^(#%x) = ((#%x\\--#%\\mu__%i_)\\'p #\\Si__%i_^^-1^ (#%x\\--#%\\mu__%i_) + "
  1714. "ln determinant (#\\Si__%i_)) / 2 \\-- ln %aprioriProbability__%i_")
  1715. NORMAL (U"that depends on the individual covariance matrix #\\Si__%i_ and the mean "
  1716. "#%\\mu__%i_ for group %i.")
  1717. NORMAL (U"When the covariances matrices are %pooled, the squared distance function can be reduced to:")
  1718. FORMULA (U"%d__%i_^^2^(#%x) = ((#%x\\--#%\\mu__%i_)\\'p #\\Si^^-1^ (#%x\\--#%\\mu__%i_) "
  1719. "\\-- ln %aprioriProbability__%i_,")
  1720. NORMAL (U"and #\\Si is now the pooled covariance matrix.")
  1721. NORMAL (U"The a priori probabilities normally will have values that are related to the number of "
  1722. "%training vectors %n__%i_ in each group:")
  1723. FORMULA (U"%aprioriProbability__%i_ = %n__%i_ / \\Si__%k=1..%numberOfGroups_ %n__%k_")
  1724. MAN_END
  1725. MAN_BEGIN (U"Discriminant & TableOfReal: To Configuration...", U"djmw", 20160119)
  1726. INTRO (U"A command to project each row in the selected @TableOfReal onto "
  1727. "a subspace spanned by the eigenvectors of the selected @Discriminant. ")
  1728. ENTRY (U"Settings")
  1729. TAG (U"##Number of dimensions")
  1730. DEFINITION (U"specifies the dimension of the resulting @Configuration. This dimension cannot exceed a maximum dimension that is implicitly determined by the selected Discriminant. When the default value (0) is "
  1731. "given the resulting Configuration will have the maximum dimension as allowed by Discrimininant. "
  1732. "(Technically speaking: the number of eigenvectors (or eigenvalues) in the selected Discriminant is equal to the maximum allowed dimension.)")
  1733. ENTRY (U"Precondition")
  1734. NORMAL (U"The dimension of the Discriminant and the Configuration must conform in the sense that the number of columns in the TableOfReal and the length of an eigenvector in the Discriminant should be equal.")
  1735. NORMAL (U"See also @@Eigen & TableOfReal: Project...@.")
  1736. MAN_END
  1737. MAN_BEGIN (U"Discriminant & TableOfReal: To TableOfReal (mahalanobis)...", U"djmw", 20170828)
  1738. INTRO (U"Calculate @@Mahalanobis distance@s for the selected @TableOfReal with respect to one group in the "
  1739. "selected @Discriminant object.")
  1740. ENTRY (U"Settings")
  1741. TAG (U"##Group label")
  1742. DEFINITION (U"defines which group mean to use for the distance calculation.")
  1743. TAG (U"##Pool covariance matrices")
  1744. DEFINITION (U"when on, use a pooled covariance matrix instead of the group covariance matrix.")
  1745. ENTRY (U"Algorithm")
  1746. NORMAL (U"See @@Covariance & TableOfReal: To TableOfReal (mahalanobis)...@.")
  1747. ENTRY (U"Example")
  1748. NORMAL (U"Calculate the number of datapoints that are within the one-sigma elipses of two different groups, i.e. "
  1749. "the number of data points that are in the overlapping area. ")
  1750. NORMAL (U"Suppose the group labels are \\o/ and \\yc.")
  1751. CODE (U"pols50m = Create TableOfReal (Pols 1973): \"no\"")
  1752. CODE (U"Formula: ~ log10 (self)")
  1753. CODE (U"discriminant = To Discriminant")
  1754. CODE (U"selectObject: pols50m, discriminant")
  1755. CODE (U"t1 = To TableOfReal (mahalanobis): \"\\bso/\", \"no\"")
  1756. CODE (U"selectObject: pols50m, discriminant")
  1757. CODE (U"t2 = To TableOfReal (mahalanobis): \"\\bsyc\", \"no\"")
  1758. NORMAL (U"Now we count when both the t1 and t2 values are smaller than 1 (sigma):")
  1759. CODE (U"Copy: \"tr\"")
  1760. CODE (U"Formula: ~ object [t1] < 1 and object [t2] < 1")
  1761. CODE (U"Extract rows where column: 1, \"equal to\", 1")
  1762. CODE (U"no = Get number of rows\"")
  1763. MAN_END
  1764. MAN_BEGIN (U"DTW", U"djmw", 20110603)
  1765. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  1766. NORMAL (U"An object of type DTW represents the dynamic time warp structure of "
  1767. "two objects.")
  1768. ENTRY (U"Commands")
  1769. NORMAL (U"Creation:")
  1770. LIST_ITEM (U"\\bu @@CC: To DTW...@ (from 2 objects with cepstral coefficients)")
  1771. LIST_ITEM (U"\\bu ##Spectrogram: To DTW...# (from 2 Spectrogram objects)")
  1772. NORMAL (U"Query:")
  1773. LIST_ITEM (U"\\bu @@DTW: Get y time from x time...@")
  1774. LIST_ITEM (U"\\bu @@DTW: Get x time from y time...@")
  1775. MAN_END
  1776. MAN_BEGIN (U"DTW: Draw warp (x)...", U"djmw", 20071204)
  1777. INTRO (U"Draws the warp given a time on the \"x-direction\"")
  1778. MAN_END
  1779. MAN_BEGIN (U"DTW: Find path (band & slope)...", U"djmw", 20120223)
  1780. INTRO (U"Finds the optimal path for the selected @DTW that lies within the union of the sakoe-chiba band and local slope limits.")
  1781. ENTRY (U"Settings")
  1782. TAG (U"##Sakoe-Chiba band (s)#,")
  1783. DEFINITION (U"The maximum distance from the start/end of the sound where a path may start/finish.")
  1784. TAG (U"##Slope constraint#,")
  1785. DEFINITION (U"determines the maximum and minimum local slopes in the optimal path. For example, the constraint "
  1786. "1/3 < slope < 3 forces the path locally after having taken three steps in the same direction direction to take the next step in the other direction, or after having taken two steps in the same direction to take the next step in the diagonal direction. At the same time the global consequences of the \"1/3 < slope < 3\" constraint mandates that the durations of the two domains do not differ by more than a factor of three. ")
  1787. NORMAL (U"For more information see the article of @@Sakoe & Chiba (1978)@.")
  1788. MAN_END
  1789. MAN_BEGIN (U"DTW: Get maximum consecutive steps...", U"djmw", 20050307)
  1790. INTRO (U"Get the maximum number of consecutive steps in the chosen direction along the optimal path from the selected @DTW.")
  1791. MAN_END
  1792. MAN_BEGIN (U"DTW: Get distance (weighted)", U"djmw", 20100628)
  1793. INTRO (U"Queries the selected @DTW object for the weighted distance along the minimum path.")
  1794. ENTRY (U"Algorithm")
  1795. NORMAL (U"If the distance matrix has %%nx% cells along the %%x%-direction, %%ny% cells along the %%y%-direction and the "
  1796. "sum of the distances along the minimum path is %%S%, the weighted distance is given by %%S%/(%nx+%ny). ")
  1797. MAN_END
  1798. MAN_BEGIN (U"DTW: Get time along path...", U"djmw", 20110603)
  1799. INTRO (U"Queries the selected @DTW object for the time along the minimal path "
  1800. "given the time along the \"%x-direction\". This command is deprecated, the new commands for querying are "
  1801. "@@DTW: Get y time from x time...@ and @@DTW: Get x time from y time...@.")
  1802. ENTRY (U"Setting")
  1803. TAG (U"##Time (s)")
  1804. DEFINITION (U"the time along the %x-direction.")
  1805. ENTRY (U"Behaviour")
  1806. NORMAL (U"When the %input time is in the interval [%xmin, %xmax], the %returned "
  1807. "time will be in the interval [%ymin, %ymax], where [%xmin, %xmax] and "
  1808. "[%ymin, %ymax] are the domains of the two \"objects\" from which the "
  1809. "DTW-object was constructed."
  1810. "For all other input times we assume that the two object are aligned.")
  1811. NORMAL (U"We like to have a \"continuous\" interpretation of time for the quantized times in the %x and "
  1812. "%y direction; we make the path piecewise linear. There are two special cases:")
  1813. NORMAL (U"1. The local path is horizontal. We calculate the %y-time from the line that connects the "
  1814. "lower-left position of the leftmost horizontal time block to the upper-right position of the "
  1815. "rightmost horizontal time block.")
  1816. NORMAL (U"2. The local path is vertical. We calculate the %y-time from the line that connects the "
  1817. "lower-left position of the bottommost vertical time block to the upper-right position of the "
  1818. "topmost horizontal time block.")
  1819. MAN_END
  1820. MAN_BEGIN (U"DTW: Get y time from x time...", U"djmw", 20110603)
  1821. INTRO (U"Queries the selected @DTW object for the time along the %y-direction "
  1822. "given the time along the \"%x-direction\". ")
  1823. ENTRY (U"Setting")
  1824. TAG (U"##Time (s)")
  1825. DEFINITION (U"the time along the %x-direction.")
  1826. ENTRY (U"Behaviour")
  1827. NORMAL (U"When the %input time is in the interval [%xmin, %xmax], the %returned "
  1828. "time will be in the interval [%ymin, %ymax], where [%xmin, %xmax] and "
  1829. "[%ymin, %ymax] are the domains of the two \"objects\" from which the "
  1830. "DTW-object was constructed."
  1831. "For input times outside the domain we assume that the two object were aligned.")
  1832. NORMAL (U"We like to have a \"continuous\" interpretation of time for the quantized times in the %x and "
  1833. "%y direction; we make the path a piecewise linear monotonically increasing function. "
  1834. "There are special cases:")
  1835. NORMAL (U"1. The local path is in the %x-direction only. We calculate the %y-time from the line "
  1836. "that connects the lower-left position of the begin cell of this path to the "
  1837. "upper-right position of the last cell.")
  1838. NORMAL (U"2. The local path is in the x-direction only. We calculate the %y-time from the line "
  1839. "that connects the lower-left position of lowest cell to the upper-right position of the "
  1840. "highest cell.")
  1841. NORMAL (U"3. A cell is both part of a path in the %x- and the %y-direction. "
  1842. "We then calculate the intersection point of the paths in the %x- and the %y-directions. "
  1843. "The %y-times in this cell are now calculated from the two line segments that originate "
  1844. "from this intersection point.")
  1845. MAN_END
  1846. MAN_BEGIN (U"DTW: Get x time from y time...", U"djmw", 20110603)
  1847. INTRO (U"Queries the selected @DTW object for the time along the %x-direction "
  1848. "given the time along the \"%y-direction\". ")
  1849. ENTRY (U"Setting")
  1850. TAG (U"##Time (s)")
  1851. DEFINITION (U"the time along the %y-direction.")
  1852. ENTRY (U"Behaviour")
  1853. NORMAL (U"The behaviour is like @@DTW: Get y time from x time...@")
  1854. MAN_END
  1855. MAN_BEGIN (U"DTW: Swap axes", U"djmw", 20050306)
  1856. INTRO (U"Swap the x and y-axes of the selected @DTW.")
  1857. MAN_END
  1858. MAN_BEGIN (U"DTW: To Polygon...", U"djmw", 20120223)
  1859. INTRO (U"A command to convert for a selected @DTW the Sakoe-Chiba band and the local slope constraint "
  1860. "to a @Polygon object. The polygon will show the boundaries of the search domain for the optimal path.")
  1861. MAN_END
  1862. MAN_BEGIN (U"DTW & TextGrid: To TextGrid (warp times)", U"djmw", 20110603)
  1863. INTRO (U"Create a new TextGrid from the selected @DTW and @TextGrid by warping the "
  1864. "times from the selected TextGrid to the newly created TextGrid.")
  1865. ENTRY (U"Algorithm")
  1866. NORMAL (U"First we check whether the y-domain of the DTW and the domain of the TextGrid are "
  1867. "equal. If they are, a new TextGrid is created by copying the selected one. "
  1868. "We then change its domain and make it equal to the x-domain of the DTW. "
  1869. "Then for each tier we change the domain and @@DTW: Get x time from y time...|calculate new times@ by using the path.")
  1870. MAN_END
  1871. MAN_BEGIN (U"DTW & Sounds: Draw...", U"djmw", 20071204)
  1872. INTRO (U"Draws the distances, the path and the sounds for the selected @DTW and the two selected @@Sound|Sounds@.")
  1873. MAN_END
  1874. MAN_BEGIN (U"DTW & Sounds: Draw warp (x)...", U"djmw", 20071204)
  1875. INTRO (U"Draws the warp given a time on the \"x-direction\" for the selected @DTW and the two selected @@Sound|Sounds@.")
  1876. MAN_END
  1877. MAN_BEGIN (U"Create empty EditCostsTable...", U"djmw", 20120524)
  1878. INTRO (U"Creates an empty @@EditCostsTable@.")
  1879. ENTRY (U"Settings")
  1880. TAG (U"##Name#")
  1881. DEFINITION (U"the name of the resulting EditCostsTable object.")
  1882. TAG (U"##Number of target symbols#")
  1883. DEFINITION (U"the number of different symbols in the target symbol set that you want to give special edit cost values in the EditCostTable. "
  1884. "The number you specify may be smaller than the actual target symbol set size because the EditCostTable has an entry for target symbols "
  1885. "that fall in a %%rest% category. If you don't want to treat any target symbol is a special way you may set this value to 0.")
  1886. TAG (U"##Number of source symbols#")
  1887. DEFINITION (U"the number of different symbols in the source symbol set that you want to give special edit cost values in the EditCostTable. "
  1888. "The number you specify may be smaller than the actual source symbol set size because the EditCostTable has an entry for source symbols "
  1889. "that fall in a %rest% category. If you don't want to treat any source symbol is a special way you may set this value 0.")
  1890. MAN_END
  1891. MAN_BEGIN (U"EditCostsTable", U"djmw", 20140509)
  1892. INTRO (U"One of the @@types of objects@ in Praat.")
  1893. NORMAL (U"The EditCostsTable determines the %%string edit costs%, i.e. the costs involved in changing one string of "
  1894. "symbols (the %%source%) into another one (the %%target%). "
  1895. "String edit costs are generally divided into %%insertion%, %%deletion% and %%substitution% costs. "
  1896. "The latter terms refer to the operations that may be performed on a source string to transform it to a target "
  1897. "string. For example, to change the source string \"execution\" to the target string \"intention\" we would need "
  1898. "one insertion (i), one deletion (d) and three substitutions (s) as the following figure shows.")
  1899. SCRIPT (4, 1.0, U"target = Create Strings as characters: \"intention\"\n"
  1900. "source = Create Strings as characters: \"execution\"\n"
  1901. "selectObject: source, target\n"
  1902. "edt = To EditDistanceTable\n"
  1903. "Draw edit operations\n"
  1904. "removeObject: edt, target, source\n")
  1905. NORMAL (U"The figure above was produced with default values for the costs, i.e. the insertion and deletion costs were 1.0 while the "
  1906. "substitution cost was 2.0. The actual edit distance between the target and source strings is calculated by the @@EditDistanceTable@ "
  1907. "which uses an EditCostsTable to access the specific string edit costs. The figure above was produced by the following commands:")
  1908. CODE (U"target = Create Strings as characters: \"intention\"")
  1909. CODE (U"source = Create Strings as characters: \"execution\"")
  1910. CODE (U"plusObject: target")
  1911. CODE (U"edt = To EditDistanceTable")
  1912. CODE (U"Draw edit operations")
  1913. NORMAL (U"The default EditCostsTable which is in every new EditDistanceTable object has only two rows and two columns, "
  1914. "where the cells in this EditCostsTable have the following interpretation:\n")
  1915. TAG (U"Cell [1][2]:")
  1916. DEFINITION (U"defines the cost for the insertion of a target symbol in the source string. The default insertion cost is 1.0.")
  1917. TAG (U"Cell [2][1]:")
  1918. DEFINITION (U"defines the cost of the deletion of a source symbol. The default value is 1.0.")
  1919. TAG (U"Cell [1][1]:")
  1920. DEFINITION (U"defines the cost of substituting a target symbol for a source symbol where the target and source symbols don't match. The default substitution cost is 2.0.")
  1921. TAG (U"Cell [2][2]:")
  1922. DEFINITION (U"defines the cost of substituting a target symbol for a source symbol where the target and source symbols do match. The deault value is 0.0.")
  1923. ENTRY (U"How to create a non-default EditCostsTable")
  1924. NORMAL (U"In general we can define a table for %%numberOfTargets% target symbols and %%numberOfSources% source symbols. These numbers "
  1925. "do not necessarily have to be equal to the number of different symbols that may occur in the target and source strings. They only represent the number of symbols that you like to give special edit costs. "
  1926. "The EditCostTable will provide one extra dimension to accommodate target symbol insertion costs and source symbol deletion costs and another extra dimension to represent other target and source symbols that don't have separate entries and can therefore be treated as one group. "
  1927. "The actual dimension of the table will therefore be (%%numberOfTargets% + 2) \\xx (%%numberOfSources% + 2). This is what the cells in the non-default table mean: ")
  1928. LIST_ITEM (U"\\bu The upper matrix part of dimension %%numberOfTargets% \\xx %%numberOfSources% will show at cell [%i][%j] the costs "
  1929. "of substituting the %i-th target symbol for the %j-th source symbol.")
  1930. LIST_ITEM (U"\\bu The first %%numberOfSources% values in row (%%numberOfTargets% + 1) represent the costs of substituting one of the target "
  1931. "symbols from the target %%rest% category for the source symbol in the corresponding column. The target rest category is the group of "
  1932. "targets that do not belong to the %%numberOfTargets% targets represented in the upper part of the matrix.")
  1933. LIST_ITEM (U"\\bu The first %%numberOfTargets% values in the column (%%numberOfSources% + 1) represent the costs of substituting the target "
  1934. "symbol in the corresponding row for one of the source symbols from the source %%rest% category. The source rest category is the group "
  1935. "of source symbols that do not belong to the %%numberOfSources% source symbols represented in the upper part of the matrix.")
  1936. LIST_ITEM (U"\\bu The first %%numberOfSources% cells in the last row represent the deletion cost of the corresponding source symbols.")
  1937. LIST_ITEM (U"\\bu The first %%numberOfTargets% cells in the last column represent the insertion costs of the corresponding target symbols.")
  1938. LIST_ITEM (U"\\bu Finally the four numbers in the cells at the bottom-right corner have an interpretation analogous to the four numbers in "
  1939. "the basic EditCostTable we discussed above (but now for the %%rest% symbols).")
  1940. ENTRY (U"Example")
  1941. NORMAL (U"If we extend the basic table with one extra target and one extra source symbol, then the EditCostTable will "
  1942. "be a 3 by 3 table. The numbers in the following table have been chosen to be distinctive and therefore probably "
  1943. "will not correspond to any practical situation.")
  1944. CODE (U" s ")
  1945. CODE (U"t 1.1 1.2 1.3")
  1946. CODE (U" 1.4 1.5 1.6")
  1947. CODE (U" 1.7 1.8 0.0")
  1948. NORMAL (U"By issuing the following series of commands this particular table can be created:")
  1949. CODE (U"Create empty EditCostsTable: \"editCosts\", 1, 1")
  1950. CODE (U"Set target symbol (index): 1, \"t\"")
  1951. CODE (U"Set source symbol (index): 1, \"s\"")
  1952. CODE (U"Set insertion costs: \"t\", 1.3")
  1953. CODE (U"Set deletion costs: \"s\", 1.7")
  1954. CODE (U"Set substitution costs: \"t\", \"s\", 1.1")
  1955. CODE (U"Set substitution costs: \"\", \"s\", 1.4")
  1956. CODE (U"Set substitution costs: \"t\", \"\", 1.2")
  1957. CODE (U"Set costs (others): 1.6, 1.8, 0, 1.5")
  1958. NORMAL (U"In the first line we create the (empty) table, we name it %%editCosts% and it creates space for one target "
  1959. "and one source symbol. The next line defines the target symbol which becomes the label of the first row of the table. "
  1960. "Line 3 defines the source symbol which will become the label of the first column of the table. "
  1961. "We next define the insertion and deletion costs, they fill cells [1][3] and [3][1], respectively. "
  1962. "Cell [1][1] is filled by the command in line 6. The command in line 7 fills cell [2][1] which defines the cost "
  1963. "of substituting any target symbol unequal to \"t\" for \"s\". The next line fills cell [1][2] which defines "
  1964. "the substitution costs of \"t\" for any source symbol unequal to \"s\". "
  1965. "Finally, the command in the last line defines the little 2\\xx2 matrix at the bottom-right that "
  1966. "is analogous to the default cost matrix explained above. Therefore cell [2][2] defines the cost of substituting a "
  1967. "target symbol unequal to \"t\" for a source symbol unequal to \"s\" where the target and source symbols don't match, while cell [3][3] "
  1968. "defines the costs when they do match. "
  1969. "Cell [3][2] defines the cost of the deletion of a source symbol unequal \"s\", while cell [2][3] defines the cost "
  1970. "for the insertion of a target symbol unequal \"t\" in the source string. ")
  1971. ENTRY (U"How to use a special EditCostsTable")
  1972. NORMAL (U"After creating the special EditCostsTable you select it together with the EditDistanceTable and issue the command @@EditDistanceTable & EditCostsTable: Set new edit costs|Set new edit costs@. The EditDistanceTable will then find the minimum edit distance based on the new cost values.")
  1973. MAN_END
  1974. MAN_BEGIN (U"EditDistanceTable", U"djmw", 20140509)
  1975. INTRO (U"One of the @@types of objects@ in Praat.")
  1976. NORMAL (U"An EditDistanceTable shows the accumulated distances between a target string and a source string. "
  1977. "For example, the accumulated distances between the target string \"intention\" and the source string "
  1978. "\"execution\" can be expressed by the following EditDistanceTable:")
  1979. SCRIPT (5, 3.5, U"target = Create Strings as characters: \"intention\"\n"
  1980. "source = Create Strings as characters: \"execution\"\n"
  1981. "selectObject: source, target\n"
  1982. "edt = To EditDistanceTable\n"
  1983. "Draw: \"decimal\", 1, 0\n"
  1984. "removeObject: edt, target, source\n")
  1985. NORMAL (U"This figure was created by issuing the following commands:")
  1986. CODE (U"target = Create Strings as characters: \"intention\"")
  1987. CODE (U"source = Create Strings as characters: \"execution\"")
  1988. CODE (U"plusObject: target")
  1989. CODE (U"edt = To EditDistanceTable")
  1990. CODE (U"Draw: \"decimal\", 1, 0")
  1991. NORMAL (U"The target string is always displayed vertically while the source string is displayed horizontally and the origin is at the bottom-left corner of the table. "
  1992. "Each cell of this table, dist[%i, %j], contains the accumulated distance between the first %i characters of the target and the first %j characters of the source. The cells on the path through this table which have the "
  1993. "minimum accumulated cost are shown with boxes around them. Below we will explain how this path is calculated.")
  1994. NORMAL (U"The local directional steps in this path show which %%edit operations% we have to perform on the source string symbols to obtain the target string symbols. "
  1995. "Three edit operations exist: (1) %%insertion% of a target symbol in the source string. This happens each time we take a step in the vertical direction along the path. (2) %%deletion% of a symbol in the source string. This happens each time we take a step in horizontal direction along the path. (3) %%substitution% of a source symbol by a target symbol happens at each diagonal step along the path.")
  1996. NORMAL (U"If we trace the path from its start at the origin to its end, we see that it first moves up, indicating the insertion of an \"i\" symbol in the source string. "
  1997. "In the next step which is in the diagonal direction, the \"n\" target is substituted for the \"e\" source symbol. Next follows another substitution, \"t\" for \"x\". "
  1998. "The next diagonal step substitutes \"e\" for an identical \"e\". This step is followed by a horizontal step in which the source symbol \"c\" is deleted. "
  1999. "The next diagonal step substitutes an \"n\" for a \"u\". The path now continues in the diagonal direction until the end point and only identical substitutions occur in the last part. The following figure shows these operations more explicitly.")
  2000. SCRIPT (4, 1.5, U"target = Create Strings as characters: \"intention\"\n"
  2001. "source = Create Strings as characters: \"execution\"\n"
  2002. "plusObject: target\n"
  2003. "edt = To EditDistanceTable\n"
  2004. "Draw edit operations\n"
  2005. "removeObject: edt, target, source\n")
  2006. NORMAL (U"The value of the accumulated costs in a cell of the table is computed by taking the minimum of the accumulated distances from three possible paths that end in the current cell, i.e. the paths that come from the %%left%, from the %%diagonal% and from %%below%.")
  2007. CODE (U"dist[i,j] = min (d__left_, d__diag_, d__below_), ")
  2008. NORMAL (U"where ")
  2009. CODE (U" d__left _ = dist[i-1,j] + insertionCost(target[i])")
  2010. CODE (U" d__diag _ = dist[i-1,j-1] + substitutionCost(source[j],target[i])")
  2011. CODE (U" d__below_ = dist[i,j-1] + deletionCost(source[j])")
  2012. NORMAL (U"Since the calculation is recursive we start at the origin. After calculating the accumulative distances for each cell in the table as based on the algorithm above, the cell at the top-right position will contain the accumulated edit distance. "
  2013. "This distance happens to be 8 for the given example. The value 8 results from using the target-indepent value of 1.0 for the insertion cost, the source-independent value of 1.0 for the deletion costs and a constant value of 2.0 for the substitution costs. "
  2014. "If target and source symbol happen to be equal no costs are assigned, or, equivalently the substitution costs are zero if target and source symbol match. If you want more control over these costs you can create an @@EditCostsTable@ and specify your special costs and then @@EditDistanceTable & EditCostsTable: Set new edit costs|set the new edit costs@.")
  2015. NORMAL (U"If during the calculations we also keep track of which of the three cells resulted in the local minimum accumulated distance, we can use this directional "
  2016. "information to backtrack from the cell at the top-right position to the cell at the bottom-right position and obtain the minimum path.")
  2017. MAN_END
  2018. MAN_BEGIN (U"EditDistanceTable & EditCostsTable: Set new edit costs", U"djmw", 20120522)
  2019. INTRO (U"A command available in the dynamic menu if an @@EditDistanceTable@ and an @@EditCostsTable@ are chosen together.")
  2020. NORMAL (U"New accumulated cost values will be calculated and a new path based on these values will be calculated.")
  2021. MAN_END
  2022. MAN_BEGIN (U"Eigen", U"djmw", 19981102)
  2023. INTRO (U"One of the @@types of objects@ in Praat.")
  2024. NORMAL (U"An object of type Eigen represents the eigen structure of "
  2025. "a matrix whose eigenvalues and eigenvectors are real.")
  2026. ENTRY (U"Inside an Eigen")
  2027. NORMAL (U"With @Inspect you will see the following attributes:")
  2028. TAG (U"%numberOfEigenvalues")
  2029. DEFINITION (U"the number of eigenvalues and eigenvectors")
  2030. TAG (U"%dimension")
  2031. DEFINITION (U"the dimension of an eigenvector.")
  2032. TAG (U"%eigenvalues[1..%numberOfEigenvalues]")
  2033. DEFINITION (U"the real eigenvalues.")
  2034. TAG (U"%eigenvectors[1..%numberOfEigenvalues][1..%dimension]")
  2035. DEFINITION (U"the real eigenvectors, stored by row.")
  2036. MAN_END
  2037. MAN_BEGIN (U"Eigen: Draw eigenvalues...", U"djmw", 20040407)
  2038. INTRO (U"A command to draw the eigenvalues of the selected @Eigen object(s).")
  2039. ENTRY (U"Settings")
  2040. TAG (U"##Fraction of eigenvalues summed")
  2041. DEFINITION (U"defines whether or not fractions are plotted. Fractions %f__%i_ "
  2042. "will be calculated for each number %e__%i_ by dividing this number by the sum of all "
  2043. "numbers %e__%j_: %f__%i_ = %e__%i_ / \\su__%j=1..%numberOfEigenvalues_ %e__%j_.")
  2044. TAG (U"##Cumulative")
  2045. DEFINITION (U"defines whether or not cumulative values are plotted. Cumulative "
  2046. "values %c__%i_ will be calculated for each number %e__%i_ by summing the first %i "
  2047. "numbers %e__%j_: %c__%i_ = \\su__%j=1..%i_ %e__%j_).")
  2048. NORMAL (U"A @@Scree plot|scree@ plot can be obtained if both %%Fraction of eigenvalues summed% "
  2049. "and %%Cumulative% are unchecked.")
  2050. MAN_END
  2051. MAN_BEGIN (U"Eigen: Draw eigenvector...", U"djmw", 20160223)
  2052. INTRO (U"A command to draw an eigenvector from the selected @Eigen.")
  2053. ENTRY (U"Settings")
  2054. TAG (U"##Eigenvector number")
  2055. DEFINITION (U"determines the eigenvector to be drawn.")
  2056. TAG (U"%Component %loadings")
  2057. DEFINITION (U"when on, the eigenvector is multiplied with the square root of the corresponding "
  2058. "eigenvalue. (For @@PCA@-analysis this means that you will draw the so called "
  2059. "%%component loading vector%. You will be able to compare "
  2060. "quantitatively the elements in different component loading vectors because "
  2061. "the %i-th element in the %j-th component loading vector gives the covariance between the %i-th "
  2062. "original variable and the %j-th principal component.)")
  2063. TAG (U"##Element range#")
  2064. DEFINITION (U"determine the first and last element of the vector that should be drawn.")
  2065. TAG (U"##Minimum# and ##Maximum#")
  2066. DEFINITION (U"determine the lower and upper bounds of the plot (choosing #Maximum smaller than #Minimum "
  2067. "will draw the %%inverted% eigenvector). ")
  2068. TAG (U"##Mark size#, ##Mark string#")
  2069. DEFINITION (U"determine size and type of the marks that will be drawn.")
  2070. TAG (U"##Garnish")
  2071. DEFINITION (U"determines whether a bounding box and margins will be drawn.")
  2072. MAN_END
  2073. MAN_BEGIN (U"Eigen: Get contribution of component...", U"djmw", 19981109)
  2074. INTRO (U"A command to ask the selected @Eigen for the contribution of the %j^^th^ "
  2075. "eigenvalue to the total sum of eigenvalues.")
  2076. ENTRY (U"Details")
  2077. NORMAL (U"The contribution is defined as:")
  2078. FORMULA (U"%%eigenvalue[j]% / \\Si__%i=1..%numberOfEigenvalues_ %%eigenvalue[i]%")
  2079. MAN_END
  2080. MAN_BEGIN (U"Eigen: Get cumulative contribution of components...", U"djmw", 19981109)
  2081. INTRO (U"A command to ask the selected @Eigen for the contribution of the sum of the "
  2082. "eigenvalues[%from..%to] to the total sum of eigenvalues.")
  2083. ENTRY (U"Details")
  2084. NORMAL (U"The contribution is defined as:")
  2085. FORMULA (U"\\Si__%i=%from..%to_ %%eigenvalue[i]% / \\Si__%i=1..%numberOfEigenvalues_ %%eigenvalue[i]%")
  2086. MAN_END
  2087. MAN_BEGIN (U"Eigen: Get eigenvalue...", U"djmw", 20040225)
  2088. INTRO (U"A command to query the selected @Eigen for the %i^^th^ "
  2089. "eigenvalue.")
  2090. MAN_END
  2091. MAN_BEGIN (U"Eigen: Get eigenvector element...", U"djmw", 20040225)
  2092. INTRO (U"A command to query the selected @Eigen for the %j^^th^ element of the "
  2093. "%i^^th^ eigenvector.")
  2094. MAN_END
  2095. MAN_BEGIN (U"Eigen: Extract eigenvector...", U"djmw", 20160617)
  2096. INTRO (U"Extract a specified eigenvector from the @Eigen as a @Matrix.")
  2097. ENTRY (U"Settings")
  2098. TAG (U"##Eigenvector number")
  2099. DEFINITION (U"determines the eigenvector.")
  2100. TAG (U"##Number of rows")
  2101. DEFINITION (U"determines the number of rows of the newly created Matrix. If left 0, the number of rows is determined from the dimension, i.e. the number of elements, of the eigenvector and the #numberOfColumns argument as the %dimension / %numberOfColumns, rounded to the next larger integer.")
  2102. TAG (U"##Number of columns")
  2103. DEFINITION (U"determines the number of columns of the newly created Matrix. If left 0, the number of columns is determined by from the dimension, i.e. the number of elements, of the eigenvector and the #numberOfRows argument as %dimension / %numberOfRows, rounded to the next larger integer.\nIf both ##Number of rows# and ##Number of columns# are zero, a Matrix with only one row and %dimension columns will be created.")
  2104. ENTRY (U"Examples")
  2105. NORMAL (U"Suppose we have an eigenvector of dimension 3 with elements {0.705, 0.424, 0.566}, then the newly created Matrix will depend on the ##Number of rows# and ##Number of columns# argument as follows:")
  2106. NORMAL (U"If %numberOfRows=0 and %numberOfColumns=0, then the Matrix will have 1 row and 3 columns:")
  2107. CODE (U"0.705 0.424 0.566")
  2108. NORMAL (U"If %numberOfRows=3 and %numberOfColumns=0, then the Matrix will have 3 rows and 1 column:")
  2109. CODE (U"0.705")
  2110. CODE (U"0.424")
  2111. CODE (U"0.566")
  2112. NORMAL (U"If %numberOfRows=2 and %numberOfColumns=2, then the Matrix will have 2 rows and 2 columns:")
  2113. CODE (U"0.705 0.424")
  2114. CODE (U"0.566 0.0")
  2115. NORMAL (U"If %numberOfRows=4 and %numberOfColumns=3, then the we get:")
  2116. CODE (U"0.705 0.424 0.566")
  2117. CODE (U"0.0 0.0 0.0 ")
  2118. CODE (U"0.0 0.0 0.0 ")
  2119. CODE (U"0.0 0.0 0.0 ")
  2120. MAN_END
  2121. MAN_BEGIN (U"Eigen & Matrix: To Matrix (project columns)...", U"djmw", 20160223)
  2122. INTRO (U"A command to project the columns of the @Matrix object onto the "
  2123. "eigenspace of the @Eigen object.")
  2124. ENTRY (U"Setting")
  2125. TAG (U"##Number of dimensions")
  2126. DEFINITION (U"defines the dimension, i.e., the number of rows, of the "
  2127. "resulting Matrix object.")
  2128. ENTRY (U"Algorithm")
  2129. NORMAL (U"Project each column of the Matrix on the coordinate "
  2130. "system given by the eigenvectors of the Eigen object. This can be done "
  2131. "as follows:")
  2132. FORMULA (U"%y__%ij_ = \\Si__%k=1..%dimension_ %e__ik_ %z__%kj_, where")
  2133. NORMAL (U"%y__%ij_ is the %j-th element of the %i-th row of the result, "
  2134. "%e__%ik_ is the %k-th element of the %i-th eigenvector, "
  2135. "%z__%kj_ is the %k-th element of the %j-th column of the selected "
  2136. "Matrix object, and %%dimension% is the number of elements in an eigenvector.")
  2137. MAN_END
  2138. MAN_BEGIN (U"Eigen & Matrix: To Matrix (project rows)...", U"djmw", 20160223)
  2139. INTRO (U"A command to project the rows of the @Matrix object onto the "
  2140. "eigenspace of the @Eigen object.")
  2141. ENTRY (U"Setting")
  2142. TAG (U"##Number of dimensions")
  2143. DEFINITION (U"defines the dimension, i.e., the number of columns, of the "
  2144. "resulting Matrix object.")
  2145. ENTRY (U"Algorithm")
  2146. NORMAL (U"Project each row of the Matrix on the coordinate "
  2147. "system given by the eigenvectors of the Eigen object. This can be done "
  2148. "as follows:")
  2149. FORMULA (U"%y__%ij_ = \\Si__%k=1..%dimension_ %e__jk_ %z__%ik_, where")
  2150. NORMAL (U"%y__%ij_ is the %j-th element of the %i-th row of the result, "
  2151. "%e__%jk_ is the %k-th element of the %j-th eigenvector, "
  2152. "%z__%ik_ is the %k-th element of the %i-th row of the selected "
  2153. "Matrix object, and %%dimension% is the number of elements in an eigenvector.")
  2154. MAN_END
  2155. MAN_BEGIN (U"Eigen & SSCP: Project", U"djmw", 20020328)
  2156. INTRO (U"A command to project the @SSCP object onto the eigenspace of "
  2157. "the @Eigen object.")
  2158. ENTRY (U"Behaviour")
  2159. NORMAL (U"Transform the SSCP object as if it was calculated in a coordinate "
  2160. "system given by the eigenvectors of the Eigen object. This can be done "
  2161. "as follows:")
  2162. FORMULA (U"#%S__%t_ = #%E\\'p #%S #%E, where")
  2163. NORMAL (U"where #%E\\'p is the transpose of the matrix with eigenvectors #%E, "
  2164. "#%S is the square matrix with sums of squares and crossproducts, and "
  2165. "#%S__%t_ the newly created square matrix. The dimension of #%S__%t_ may "
  2166. "be smaller than the dimension of #%S.")
  2167. MAN_END
  2168. MAN_BEGIN (U"Eigen & TableOfReal: Project...", U"djmw", 20040407)
  2169. INTRO (U"A command to project the rows of the @TableOfReal object onto the "
  2170. "eigenspace of the @Eigen object.")
  2171. ENTRY (U"Setting")
  2172. TAG (U"##Number of dimensions")
  2173. DEFINITION (U"defines the number of dimensions, i.e., the number of columns, of the "
  2174. "resulting object.")
  2175. ENTRY (U"Algorithm")
  2176. NORMAL (U"Project each row of the TableOfReal on the coordinate "
  2177. "system given by the eigenvectors of the Eigen object. This can be done "
  2178. "as follows:")
  2179. FORMULA (U"%y__%ij_ = \\Si__%k=1..%numberOfColums_ %e__jk_ %x__%ik_, where")
  2180. NORMAL (U"%e__%jk_ is the %k-th element of the %j-th eigenvector, %x__%ik_ is "
  2181. "the %k-th element of the %i-th row and %y__%ij_ is the %j-th element at "
  2182. "the %i-th row of the matrix part of the resulting object.")
  2183. MAN_END
  2184. MAN_BEGIN (U"equivalent rectangular bandwidth", U"djmw", 19980713)
  2185. INTRO (U"The %%equivalent rectangular bandwidth% (ERB) of a filter is defined "
  2186. "as the width of a rectangular filter whose height equals the peak gain of "
  2187. "the filter and which passes the same total power as the filter (given a flat "
  2188. "spectrum input such as white noise or an impulse).")
  2189. MAN_END
  2190. MAN_BEGIN (U"Excitations", U"djmw", 19960918)
  2191. INTRO (U"A collection of objects of type @Excitation. "
  2192. "You can create an #Excitations by selecting one or more #Excitation's and "
  2193. "selecting ##To Excitations#. You can add one or more #Excitation's to an "
  2194. "#Excitations by selecting one #Excitations and one or more "
  2195. "#Excitation's and selecting ##Add to Excitations# (the #Excitation's will "
  2196. "be removed from the list of objects).")
  2197. MAN_END
  2198. MAN_BEGIN (U"Excitations: Append", U"djmw", 19960918)
  2199. INTRO (U"You can choose this command after selecting two objects of type @Excitations. ")
  2200. NORMAL (U"A new object is created that contains the second object appended after the first.")
  2201. MAN_END
  2202. MAN_BEGIN (U"Excitations: To PatternList...", U"djmw", 19960918)
  2203. INTRO (U"A command to convert every selected @Excitations to a @PatternList object.")
  2204. ENTRY (U"Setting")
  2205. TAG (U"##Join")
  2206. DEFINITION (U"the number of subsequent @Excitation objects to combine into one row of @PatternList. "
  2207. "E.g. if an #Excitation has length 26 and %join = 2 then each row of #PatternList "
  2208. "contains 52 elements. The number of rows in #PatternList will be %%my size% / 2. "
  2209. "In the conversion process the elements of an #Excitation will be divided by 100.0 in order "
  2210. "to guarantee that all patterns have values between 0 and 1.")
  2211. MAN_END
  2212. MAN_BEGIN (U"FilterBank: Draw filter functions...", U"djmw", 20030901)
  2213. INTRO (U"")
  2214. MAN_END
  2215. MAN_BEGIN (U"FilterBank: Draw frequency scales...", U"djmw", 20030901)
  2216. MAN_END
  2217. MAN_BEGIN (U"FilterBank: Get frequency in Hertz...", U"djmw", 20030901)
  2218. INTRO (U"A @query to the selected FilterBank object.")
  2219. ENTRY (U"Return value")
  2220. NORMAL (U"a frequency value in Hertz.")
  2221. MAN_END
  2222. MAN_BEGIN (U"FilterBank: Get frequency in Bark...", U"djmw", 20030901)
  2223. MAN_END
  2224. MAN_BEGIN (U"FilterBank: Get frequency in mel...", U"djmw", 20030901)
  2225. MAN_END
  2226. MAN_BEGIN (U"FormantFilter", U"djmw", 20141022)
  2227. INTRO (U"A #deprecated @@types of objects|type of object@ in P\\s{RAAT}. It is replaced by @@Spectrogram@.")
  2228. NORMAL (U"An object of type FormantFilter represents an acoustic time-frequency "
  2229. "representation of a sound: the power spectral density %P(%f, %t), expressed "
  2230. "in dB as 10*log10(power/4e-10)). In the now preferred Spectrogram the power is represented instead of its dB value. "
  2231. "It is sampled into a number of points around equally spaced times %t__%i_ "
  2232. "and frequencies %f__%j_ (on a linear frequency scale).")
  2233. ENTRY (U"Inside a FormantFilter")
  2234. NORMAL (U"With @Inspect you will see that this type contains the same "
  2235. "attributes a @Matrix.")
  2236. MAN_END
  2237. MAN_BEGIN (U"gammatone", U"djmw", 20100517)
  2238. INTRO (U"A gammatone is the product of a rising polynomial, a decaying exponential function, and a "
  2239. "cosine wave.")
  2240. NORMAL (U"It can be described with the following formula:")
  2241. FORMULA (U"gammaTone (%t) = %a %t^^%\\ga\\--1^ e^^\\--2%\\pi\\.c%bandwidth\\.c%t^ "
  2242. "cos (2%%\\pi\\.cfrequency\\.ct% + %initialPhase),")
  2243. NORMAL (U"where %\\ga determines the order of the gammatone.")
  2244. NORMAL (U"The gammatone function has a monotone carrier (the tone) with an "
  2245. "envelope that is a gamma distribution function. The amplitude spectrum is essentially "
  2246. "symmetric on a linear frequency scale. This function is used in some time-domain "
  2247. "auditory models to simulate the spectral analysis performed by the basilar membrane. "
  2248. "It was popularized in auditory modeling by @@Johannesma (1972)@. @@Flanagan (1960)@ "
  2249. "already used it to model basilar membrane motion.")
  2250. MAN_END
  2251. MAN_BEGIN (U"generalized singular value decomposition", U"djmw", 19981007)
  2252. INTRO (U"For %m > %n, the %%generalized singular value decomposition% (gsvd) of an %m \\xx %n matrix #%A and "
  2253. "a %p \\xx %n matrix #%B is given by the pair of factorizations")
  2254. FORMULA (U"#%A = #%U #%\\Si__1_ [#%0, #%R] #%Q\\'p and #%B = #%V #%\\Si__2_ [#%0, #%R] #%Q\\'p")
  2255. NORMAL (U"The matrices in these factorizations have the following properties:")
  2256. TAG (U"\\bu #%U [%m \\xx %m], #%V [%p \\xx %p] and #%Q [%n \\xx %n]")
  2257. DEFINITION (U" are orthogonal matrices. In the reconstruction formula's above we maximally need "
  2258. "only the first %n columns of matrices #%U and #%V (when %m and/or %p are greater than %n).")
  2259. TAG (U"\\bu #%R [%r \\xx %r],")
  2260. DEFINITION (U"is an upper triangular nonsingular matrix. %r is the rank of [#%A\\'p, #%B\\'p]\\'p "
  2261. "and %r \\<_ %n. The matrix [#%0, #%R] is %r \\xx %n and its first %n \\xx (%n \\-- %r) part "
  2262. "is a zero matrix.")
  2263. TAG (U"\\bu #%\\Si__1_ [%m \\xx %r] and #%\\Si__2_ [%p \\xx %r]")
  2264. DEFINITION (U"are real, nonnegative and \"diagonal\".")
  2265. NORMAL (U"In practice, the matrices #%\\Si__1_ and #%\\Si__2_ are never used. Instead a shorter "
  2266. "representation with numbers %\\al__%i_ and %\\be__%i_ is used. These numbers obey "
  2267. "0 \\<_ \\al__%i_ \\<_ 1 and \\al__%i_^^2^ + \\be__%i_^^2^ = 1. The following relations exist:")
  2268. FORMULA (U"#%\\Si__1_\\'p #%\\Si__1_ + #%\\Si__2_\\'p #%\\Si__2_ = #%I, ")
  2269. FORMULA (U"#%\\Si__1_\\'p #%\\Si__1_ = #diag (%\\al__1_^^2^, ..., %\\al__%r_^^2^), and, ")
  2270. FORMULA (U"#%\\Si__2_\\'p #%\\Si__2_ = #diag (%\\be__1_^^2^, ..., %\\be__%r_^^2^).")
  2271. NORMAL (U"The ratios \\al__%i_ / \\be__%i_ are called the %%generalized singular values% of the "
  2272. "pair #%A, #%B. Let %l be the rank of #%B and %k + %l (= %r) the rank of [#%A\\'p, #%B\\'p]\\'p. "
  2273. "Then the first %k generalized singular values are infinite and the remaining %l are finite. "
  2274. "(When %#B is of full rank then, of course, %k = 0).")
  2275. ENTRY (U"Special cases")
  2276. NORMAL (U"\\bu If #%B is a square nonsingular matrix, the gsvd of #%A and #%B is equivalent to the "
  2277. "singular value decomposition of #%A #%B^^\\--1^.")
  2278. NORMAL (U"\\bu The generalized eigenvalues and eigenvectors of #%A\\'p #%A - %\\la #%B\\'p #%B "
  2279. "can be expressed in terms of the gsvd. The columns of the matrix #%X, constructed as")
  2280. CODE (U"X = Q*( I 0 )")
  2281. CODE (U" ( 0 inv(R) ),")
  2282. NORMAL (U"form the eigenvectors. The important eigenvectors, of course, correspond "
  2283. "to the positions where the %l eigenvalues are not infinite.")
  2284. MAN_END
  2285. MAN_BEGIN (U"Get incomplete gamma...", U"djmw", 20170531)
  2286. INTRO (U"Get the value of the @@incomplete gamma function@ for particular values of \\al and %x.")
  2287. ENTRY (U"Algorithm")
  2288. NORMAL (U"The algorithm is taken from @@Kostlan & Gokhman (1987)@.")
  2289. MAN_END
  2290. MAN_BEGIN (U"incomplete gamma function", U"djmw", 20170531)
  2291. INTRO (U"The incomplete gamma function is defined as:")
  2292. FORMULA (U"\\Ga(\\al, %x) = \\in__%x_^^\\oo^ %t^^\\al\\-m1^e^^-%t^dt, \\Ga(\\al) = \\Ga(\\al, 0),")
  2293. NORMAL (U"where \\al and %x are complex numbers and Re(\\al) > 0.")
  2294. NORMAL (U"The complementary incomplete gamma function is defined as:")
  2295. FORMULA (U"\\ga(\\al, %x) = \\in__%0_^^%x^ %t^^\\al\\-m1^e^^-%t^dt = \\Ga(\\al)\\-m\\Ga(\\al, %x).")
  2296. MAN_END
  2297. MAN_BEGIN (U"invFisherQ", U"djmw", 20000525)
  2298. INTRO (U"$$invFisherQ$ (%q, %df1, %df2) returns the value %f for which "
  2299. "$$@fisherQ (%f, %df1, %df2) = %q.")
  2300. MAN_END
  2301. MAN_BEGIN (U"fisherQ", U"djmw", 20000525)
  2302. INTRO (U"$$fisherQ$ (%f, %df1, %df2) returns the area under Fisher's F-distribution "
  2303. "from %f to +\\oo.")
  2304. MAN_END
  2305. MAN_BEGIN (U"IDX file format", U"djmw", 20160220)
  2306. INTRO (U"The IDX file format is a simple format for vectors and multidimensional matrices of various numerical types. ")
  2307. NORMAL (U"The basic format according to %%http://yann.lecun.com/exdb/mnist/% is:")
  2308. CODE (U"magic number")
  2309. CODE (U"size in dimension 1")
  2310. CODE (U"size in dimension 2")
  2311. CODE (U"size in dimension 3")
  2312. CODE (U"....")
  2313. CODE (U"size in dimension N")
  2314. CODE (U"data")
  2315. NORMAL (U"The magic number is four bytes long. The first 2 bytes are always 0.")
  2316. NORMAL (U"The third byte codes the type of the data:")
  2317. CODE (U"0x08: unsigned byte")
  2318. CODE (U"0x09: signed byte")
  2319. CODE (U"0x0B: short (2 bytes)")
  2320. CODE (U"0x0C: int (4 bytes)")
  2321. CODE (U"0x0D: float (4 bytes)")
  2322. CODE (U"0x0E: double (8 bytes)")
  2323. NORMAL (U"The fouth byte codes the number of dimensions of the vector/matrix: 1 for vectors, 2 for matrices....")
  2324. NORMAL (U"The sizes in each dimension are 4-byte integers (big endian, like in most non-Intel processors).")
  2325. NORMAL (U"The data is stored like in a C array, i.e. the index in the last dimension changes the fastest.")
  2326. ENTRY (U"Behaviour")
  2327. NORMAL (U"If the storage format indicates that there are more than 2 dimensions, the resulting Matrix accumulates dimensions 2 and higher in the columns. For example, with three dimensions of size n1, n2 and n3, respectively, the resulting Matrix object will have n1 rows and %%n2\\xxn3% columns.")
  2328. ENTRY (U"Example")
  2329. NORMAL (U"The training and testing data of the MNIST database of handwritten digits at http://yann.lecun.com/exdb/mnist/ is stored in %%compressed% IDX formatted files. ")
  2330. NORMAL (U"Reading the uncompressed file %%train-images-idx3-ubyte% available at http://yann.lecun.com/exdb/mnist/ with 60000 images of 28\\xx28 pixel data, will result in a new Matrix object with 60000 rows and 784 (=28\\xx28) columns. Each cell will contain a number in the interval from 0 to 255.")
  2331. NORMAL (U"Reading the uncompressed file %%train-labels-idx1-ubyte% with 60000 labels will result in a new Matrix object with 1 row and 60000 columns. Each cell will contain a number in the interval from 0 to 9.")
  2332. MAN_END
  2333. MAN_BEGIN (U"ISpline", U"djmw", 19990627)
  2334. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}. ")
  2335. NORMAL (U"An object of type ISpline represents a linear combination of basis "
  2336. "i@spline functions. Each basis %ispline is a monotonically increasing "
  2337. "polynomial function of degree %p.")
  2338. FORMULA (U"ISpline (%x) = \\Si__%k=1..%numberOfCoefficients_ %c__%k_ %ispline__%k_(%x)")
  2339. MAN_END
  2340. MAN_BEGIN (U"jackknife", U"djmw", 20141101)
  2341. INTRO (U"A technique for estimating the bias and standard deviation of an estimate.")
  2342. NORMAL (U"Suppose we have a sample #%x = (%x__1_, %x__2_,...%x__n_) and wish to estimate "
  2343. "the bias and standard error of an estimator \\Te. The jackknife "
  2344. "focuses on the samples that leave out one observation at a time: "
  2345. "the %i-th jackknife sample consists of the data with the %i-th observation "
  2346. "removed.")
  2347. MAN_END
  2348. MAN_BEGIN (U"Kirshenbaum phonetic encoding", U"djmw", 20120413)
  2349. INTRO (U"The Kirshenbaum phonetic encoding represents International Phonetic Alphabet symbols using ascii characters. See: http://www.kirshenbaum.net/IPA/ascii-ipa.pdf. The @@espeak@ speech synthesizer on which our synthesizer is based accepts this encoding as text input. ")
  2350. MAN_END
  2351. MAN_BEGIN (U"Legendre polynomials", U"djmw", 19990620)
  2352. INTRO (U"The Legendre polynomials %P__%n_(%x) of degree %n are special "
  2353. "orthogonal polynomial functions defined on the domain [-1, 1].")
  2354. NORMAL (U"Orthogonality:")
  2355. FORMULA (U"__-1_\\in^^1^ %W(%x) %P__%i_(%x) %P__%j_(%x) %dx = \\de__%ij_")
  2356. FORMULA (U"%W(%x) = 1 (-1 < x < 1)")
  2357. NORMAL (U"They obey certain recurrence relations:")
  2358. FORMULA (U"%n %P__%n_(%x) = (2%n \\-- 1) %x %P__%n-1_(%x) \\-- (%n \\-- 1) %P__%n-2_(%x)")
  2359. FORMULA (U"%P__0_(%x) = 1")
  2360. FORMULA (U"%P__1_(%x) = %x")
  2361. NORMAL (U"We may %change the domain of these polynomials to [%xmin, %xmax] by "
  2362. "using the following transformation:")
  2363. FORMULA (U"%x\\'p = (2%x \\-- (%xmax + %xmin)) / (%xmax - %xmin).")
  2364. NORMAL (U"We subsequently use %P__%k_(%x\\'p) instead of %P__%k_(%x).")
  2365. MAN_END
  2366. MAN_BEGIN (U"LegendreSeries", U"djmw", 19990620)
  2367. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  2368. NORMAL (U"An object of type LegendreSeries represents a linear combination of @@Legendre polynomials@ "
  2369. "%P__%k_(%x).")
  2370. FORMULA (U"LegendreSeries (%x) = \\Si__%k=1..%numberOfCoefficients_ %c__%k_ %P__%k_(%x)")
  2371. MAN_END
  2372. MAN_BEGIN (U"LegendreSeries: To Polynomial", U"djmw", 19990620)
  2373. INTRO (U"A command to transform the selected @LegendreSeries object into a @@Polynomial@ object.")
  2374. NORMAL (U"We find polynomial coefficients %c__%k_ such that")
  2375. FORMULA (U"\\Si__%k=1..%numberOfCoefficients_ %c__%k_ %x^^%k^ = "
  2376. "\\Si__%k=1..%numberOfCoefficients_ %l__%k_ %P__%k_(%x)")
  2377. NORMAL (U"We use the recurrence relation for @@Legendre polynomials@ to calculate these coefficients.")
  2378. MAN_END
  2379. MAN_BEGIN (U"Mahalanobis distance", U"djmw", 20160120)
  2380. INTRO (U"The Mahalanobis distance is defined as the distance between a (multidimensional) point and a distribution. "
  2381. "It is the multivariate form of the distance measured in units of standard deviation and is "
  2382. "named after the famous Indian statistician R.P. Mahalanobis (1893 \\-- 1972).")
  2383. NORMAL (U"Given a normal distribution with covariance matrix ##S# and mean ##\\mu#, the squared Mahalanobis distance of a point "
  2384. "##x## to the mean of this distribution is given by %d^^2^(##x#)=(##x#-##\\mu#)##\\'p###S#^^-1^(##x#-##\\mu#), where "
  2385. "(##x#-##\\mu#)##\\'p# is the transpose of (##x#-##\\mu#).")
  2386. NORMAL (U"The distance formula above says that we have to weigh dimensions according to their covariances. If the covariance matrix ##S# "
  2387. "happens to be diagonal the formula above reduces to %d^^2^(##x#)=\\Si__%i=1_^^N^ (%x__%i_-%\\mu__%i_)^^2^/%\\si__%i_.")
  2388. MAN_END
  2389. MAN_BEGIN (U"Matrix: Draw distribution...", U"djmw", 20041110)
  2390. INTRO (U"A command to draw the distribution histogram of the values in the selected part of a @Matrix.")
  2391. ENTRY (U"Settings")
  2392. TAG (U"##Horizontal range#, ##Vertical range#")
  2393. DEFINITION (U"determine the part of the matrix whose distribution will be drawn.")
  2394. TAG (U"##Minimum value#, ##Maximum value#")
  2395. DEFINITION (U"determine the range of values that will be considered in the distribution. "
  2396. "To treat all bin widths equally, the range will include the %%Minimum value% and exclude the "
  2397. "%%Maximum value% (see below).")
  2398. TAG (U"##Number of bins")
  2399. DEFINITION (U"determines the number of bars in the distribution histogram.")
  2400. TAG (U"##Minimum frequency#, ##Maximum frequency#")
  2401. DEFINITION (U"determine the limits of the vertical axis.")
  2402. ENTRY (U"Algorithm")
  2403. NORMAL (U"For a particular matrix element %z, the histogram bin number %%i% that will be incremented obeys the following relation:")
  2404. FORMULA (U"%%lowerBinBorder%__%i_ \\<_ %z < %%lowerBinBorder%__%i_+ %%binWidth%,")
  2405. NORMAL (U"where")
  2406. FORMULA (U"%%binWidth% = (%%maximumValue% - %%minimumValue%)/%%numberOfBins%,")
  2407. NORMAL (U"and")
  2408. FORMULA (U"%%lowerBinBorder%__%i_ = %%minimumValue% + (%i - 1)\\.c%%binWidth%.")
  2409. NORMAL (U"In this way all bins will be based on exactly the same width, as each binning interval includes its lower border "
  2410. "and excludes its upper border "
  2411. "(i.e., each interval is closed to the left and open to the right). ")
  2412. MAN_END
  2413. MAN_BEGIN (U"Matrix: Solve equation...", U"djmw", 19961006)
  2414. INTRO (U"Solve the general matrix equation #A #x = #b for #x.")
  2415. NORMAL (U"The matrix #A can be any general %m \\xx %n matrix, #b is a %m-dimensional "
  2416. "and #x a %n-dimensional vector. The @Matrix contains #A as its first %n columns "
  2417. "and #b as its last column. The %n-dimensional solution is returned as a #Matrix "
  2418. "with %n columns.")
  2419. NORMAL (U"When the number of equations (%m) is %greater than the number of unknowns (%n) the "
  2420. "algorithm gives the best least-squares solution. If on the contrary you "
  2421. "have %fewer equations than unknowns the solution will not be unique.")
  2422. ENTRY (U"Method")
  2423. NORMAL (U"Singular value decomposition with backsubstitution. "
  2424. "Zero will be substituted for eigenvalues smaller than %tolerance \\.c "
  2425. "%%maximum_eigenvalue% (when the user-supplied %tolerance equals 0.0 a "
  2426. "value of 2.2 \\.c 10^^-16^ \\.c %%number_of_unknowns% "
  2427. "will be used as %tolerance).")
  2428. NORMAL (U"See for more details: @@Golub & van Loan (1996)@ chapters 2 and 3.")
  2429. MAN_END
  2430. MAN_BEGIN (U"MelFilter", U"djmw", 20141022)
  2431. INTRO (U"A #deprecated @@types of objects|type of object@ in P\\s{RAAT}. It is replaced by the @@MelSpectrogram@.")
  2432. NORMAL (U"An object of type MelFilter represents an acoustic time-frequency "
  2433. "representation of a sound: the power spectral density %P(%f, %t), "
  2434. "expressed in dB's. "
  2435. "It is sampled into a number of points around equally spaced times %t__%i_ "
  2436. "and frequencies %f__%j_ (on a Mel frequency scale).")
  2437. NORMAL (U"The frequency in mels is:")
  2438. FORMULA (U"mels = 2595 * log10 (1 + hertz / 700),")
  2439. NORMAL (U"and its inverse is:")
  2440. FORMULA (U"hertz = 700 * (10.0^^mel / 2595.0^ - 1).")
  2441. MAN_END
  2442. MAN_BEGIN (U"MelSpectrogram", U"djmw", 20141209)
  2443. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  2444. NORMAL (U"An object of type MelSpectrogram represents an acoustic time-frequency "
  2445. "representation of a sound: the power spectral density %P(%f, %t)."
  2446. "It is sampled into a number of points around equally spaced times %t__%i_ "
  2447. "and frequencies %f__%j_ (on a Mel frequency scale).")
  2448. NORMAL (U"The mel frequency scale is defined as:")
  2449. FORMULA (U"mel = 2595 * log10 (1 + hertz / 700),")
  2450. NORMAL (U"and its inverse is:")
  2451. FORMULA (U"hertz = 700 * (10.0^^mel / 2595.0^ - 1).")
  2452. ENTRY (U"Inside a MelSpectrogram")
  2453. NORMAL (U"With @Inspect you will see that this type contains the same "
  2454. "attributes a @Matrix.")
  2455. MAN_END
  2456. MAN_BEGIN (U"MelSpectrogram: Paint image...", U"djmw", 20141023)
  2457. INTRO (U"A command to draw the selected @MelSpectrogram into the @@Picture window@ in shades of grey.")
  2458. MAN_END
  2459. MAN_BEGIN (U"MelSpectrogram: To MFCC...", U"djmw", 20141023)
  2460. INTRO (U"A command to create a @MFCC object from each selected @MelSpectrogram "
  2461. "object.")
  2462. NORMAL (U"Mel frequency cepstral coefficients %c__%k_ in each frame of the MFCC object result from the output of a Discrete Cosine "
  2463. "Transform on spectral values %P__%j_ in the corresponding frame of the MelSpectrogram. The following formula "
  2464. "shows the relation between the values in each frame:")
  2465. FORMULA (U"%c__%k-1_ = \\Si__%j=1_^^%N^ %P__%j_ cos (\\pi(%k-1)(%j-0.5)/%N)),")
  2466. NORMAL (U"where %N represents the number of spectral values and %P__%j_ the power in dB "
  2467. "of the %j^^%th^ spectral value (%k runs from 1 to %N).")
  2468. NORMAL (U"This transformation was first used by @@Davis & Mermelstein (1980)@.")
  2469. MAN_END
  2470. MAN_BEGIN (U"MFCC: To TableOfReal...", U"djmw", 20120504)
  2471. INTRO (U"Convert the selected @@MFCC@ object to a @@TableOfReal@ object. Each MFCC frame results "
  2472. "in one row in the TableOfReal. If the \"Include energy\" option is chosen, the zeroth MFCC "
  2473. "coefficient will be saved in the first column.")
  2474. MAN_END
  2475. MAN_BEGIN (U"MSpline", U"djmw", 19990627)
  2476. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}. ")
  2477. NORMAL (U"An object of type MSpline represents a linear combination of basis "
  2478. "m@spline functions. Each basis %mspline is a positive polynomial function "
  2479. "of degree %p.")
  2480. FORMULA (U"MSpline (%x) = \\Si__%k=1..%numberOfCoefficients_ %c__%k_ %mspline__%k_(%x)")
  2481. MAN_END
  2482. MAN_BEGIN (U"pairwise algorithm for computing sample variances", U"djmw", 20170806)
  2483. INTRO (U"An algorithm to compute the mean and the variance of an array of numbers. By pairwise combining array elements, the total number of arithmetic operations is reduced and therefore also the noise due to finite precision arithmetic. The algorithm is described in @@Chan, Golub & LeVeque (1979)@ and a comparison with other algorithms is presented in @@Chan, Golub & LeVeque (1983)@.")
  2484. MAN_END
  2485. MAN_BEGIN (U"PatternList", U"djmw", 20160524)
  2486. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  2487. INTRO (U"An object of type PatternList is a list of patterns that can serve as "
  2488. "inputs for a neural net. All elements in a PatternList have to be in the interval [0,1].")
  2489. ENTRY (U"PatternList commands")
  2490. NORMAL (U"Creation:")
  2491. LIST_ITEM (U"\\bu ##Create PatternList with zeroes...#")
  2492. LIST_ITEM (U"\\bu @@TableOfReal: To PatternList and Categories...@")
  2493. NORMAL (U"Synthesis:")
  2494. LIST_ITEM (U"\\bu @@FFNet & PatternList: To Categories...@")
  2495. LIST_ITEM (U"\\bu @@PatternList & Categories: To FFNet...@")
  2496. ENTRY (U"Inside a PatternList")
  2497. NORMAL (U"With @Inspect you will see that this type contains the same "
  2498. "attributes as a @Matrix.")
  2499. MAN_END
  2500. MAN_BEGIN (U"PCA", U"djmw", 19990323)
  2501. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}. "
  2502. "See the @@Principal component analysis@ tutorial.")
  2503. NORMAL (U"An object of type PCA represents the principal components analysis "
  2504. "of a multivariate dataset.")
  2505. ENTRY (U"Commands")
  2506. NORMAL (U"Creation:")
  2507. LIST_ITEM (U"\\bu @@Principal component analysis@ tutorial")
  2508. LIST_ITEM (U"\\bu @@TableOfReal: To PCA@")
  2509. ENTRY (U"Inside a PCA")
  2510. NORMAL (U"With @Inspect you will see that this type contains the same "
  2511. "attributes as an @Eigen with the following extras:")
  2512. TAG (U"%numberOfObservations")
  2513. DEFINITION (U"the number of observations in the multivariate dataset that originated the PCA, "
  2514. "usually equal to the dataset's number of rows.")
  2515. TAG (U"%labels[1..%dimension]")
  2516. DEFINITION (U"the label that corresponds to each dimension.")
  2517. TAG (U"%centroid")
  2518. DEFINITION (U"the centroids of the originating multivariate data set.")
  2519. MAN_END
  2520. MAN_BEGIN (U"PCA: Get fraction variance accounted for...", U"djmw", 19990106)
  2521. INTRO (U"A command to query the selected @PCA for the fraction %%variance "
  2522. "accounted for% by the selected components.")
  2523. ENTRY (U"Setting")
  2524. TAG (U"##Principal component range")
  2525. DEFINITION (U"defines the range of the principal components. If you choose both numbers equal, "
  2526. "you get the fraction of the \"variance\" explained by that one component.")
  2527. ENTRY (U"Details")
  2528. NORMAL (U"The contribution is defined as:")
  2529. FORMULA (U"\\Si__%i=%from..%to_ %%eigenvalue[i]% / \\Si__%i=1..%numberOfEigenvalues_ %%eigenvalue[i]%")
  2530. MAN_END
  2531. MAN_BEGIN (U"PCA: Get eigenvalue...", U"djmw", 20040225)
  2532. INTRO (U"A command to query the selected @PCA for the %i^^th^ "
  2533. "eigenvalue.")
  2534. MAN_END
  2535. MAN_BEGIN (U"PCA: Get eigenvector element...", U"djmw", 20040225)
  2536. INTRO (U"A command to query the selected @PCA for the %j^^th^ element of the "
  2537. "%i^^th^ eigenvector.")
  2538. MAN_END
  2539. MAN_BEGIN (U"PCA: Get equality of eigenvalues...", U"djmw", 19981102)
  2540. INTRO (U"A command to get the probability that some of the eigenvalues of the "
  2541. "selected @PCA object are equal. A low probability means that it is not "
  2542. "very likely that that these numbers are equal.")
  2543. NORMAL (U"We test the hypothesis %H__0_: %\\la__%from_ = ... = %\\la__%to_ "
  2544. "that %r (= %to\\--%from+1) of the eigenvalues \\la of the covariance "
  2545. "matrix are equal. The remaining eigenvalues are unrestricted as to their "
  2546. "values and multiplicities. The alternative hypothesis to %H__0_ is that "
  2547. "some of the eigenvalues in the set are distinct.")
  2548. ENTRY (U"Settings")
  2549. TAG (U"##Eigenvalue range")
  2550. DEFINITION (U"define the range of eigenvalues to be tested for equality.")
  2551. TAG (U"##Conservative test")
  2552. DEFINITION (U"when on, a more conservative estimate for %n is chosen (see below).")
  2553. ENTRY (U"Details")
  2554. NORMAL (U"The test statistic is:")
  2555. FORMULA (U"\\ci^2 = \\--%n \\Si__%j=%from..%to_ ln %eigenvalue[%j] + %n %r "
  2556. "ln (\\Si__%j=%from..%to_ %eigenvalue[%j] / %r),")
  2557. NORMAL (U"with %r(%r+1)/2 \\--1 degrees of freedom. Here %n = %totalNumberOfCases \\-- 1.")
  2558. NORMAL (U"A special case occurs when the variation in the last %r dimensions is spherical. In a "
  2559. "slightly more conservative test we may replace %n by %n\\--%from\\--(2%r^2+%r+2)/6%r.")
  2560. NORMAL (U"Also see @@Morrison (1990)@, page 336.")
  2561. MAN_END
  2562. MAN_BEGIN (U"PCA: Get number of components (VAF)...", U"djmw", 19990111)
  2563. INTRO (U"A command to ask the selected @PCA for the minimum number of "
  2564. "components that are necessary "
  2565. "to explain the given fraction %%variance accounted for%.")
  2566. ENTRY (U"Setting")
  2567. TAG (U"##Variance accounted for (fraction)")
  2568. DEFINITION (U"the fraction variance accounted for that should be explained.")
  2569. MAN_END
  2570. MAN_BEGIN (U"PCA: To TableOfReal (reconstruct 1)...", U"djmw", 20030108)
  2571. INTRO (U"A command to reconstruct a single data item. The result is stored as "
  2572. "a @TableOfReal with only one row.")
  2573. ENTRY (U"Settings")
  2574. TAG (U"##Coefficients")
  2575. DEFINITION (U"the weight for the eigenvectors.")
  2576. NORMAL (U"The algorithm is explained in @@PCA & Configuration: To TableOfReal "
  2577. "(reconstruct)@.")
  2578. MAN_END
  2579. MAN_BEGIN (U"PCA & Configuration: To TableOfReal (reconstruct)", U"djmw", 20030108)
  2580. INTRO (U"A command to reconstruct a @TableOfReal from the selected @Configuration"
  2581. " and @PCA.")
  2582. NORMAL (U"The TableOfReal is reconstructed from the eigenvectors of the PCA and "
  2583. "elements of the Configuration are the weight factors: ")
  2584. FORMULA (U"%#t__%i_ = \\Si__%k_ %c__%ik_ #%e__%k_,")
  2585. NORMAL (U"where %#t__%i_ is the %i-th row in the resulting TableOfReal object, %c__%ik_ is "
  2586. "the element at row %i and column %k in the Configuration object and #%e__%k_ "
  2587. "the %k-th eigenvector from the PCA object.")
  2588. MAN_END
  2589. MAN_BEGIN (U"PCA & PCA: Get angle between pc1-pc2 planes", U"djmw", 20041028)
  2590. INTRO (U"A command to calculate the angle between two planes. Each plane is spanned by the first "
  2591. "two eigenvectors from the corresponding @@PCA@.")
  2592. ENTRY (U"Algorithm")
  2593. NORMAL (U"The algorithm is described in section 12.4.3 of @@Golub & van Loan (1996)@:")
  2594. NORMAL (U"First we form the projection of one set of eigenvectors on the other set. "
  2595. "This results in a 2\\xx2 matrix #C:")
  2596. FORMULA (U"#C = #E__1_\\'p #E__2_,")
  2597. NORMAL (U"where #E__1_ and #E__2_ are 2\\xx%%dimension% and %%dimension%\\xx2 matrices "
  2598. "that contain the first two eigenvectors of the PCA's, respectively.")
  2599. NORMAL (U"Next, we compute the @@singular value decomposition@ of #C:")
  2600. FORMULA (U"#C = #U #\\Si #V\\'p")
  2601. NORMAL (U"Now the cosine of the angle between the two planes is given by \\si__2_ and "
  2602. "the angle in degrees is therefore:")
  2603. FORMULA (U"arccos (\\si__2_)\\.c180/\\pi")
  2604. MAN_END
  2605. MAN_BEGIN (U"PCA & PCA: To Procrustes...", U"djmw", 20041028)
  2606. INTRO (U"A command to calculate a @Procrustes from the two selected @@PCA@'s.")
  2607. NORMAL (U"Determines the orthogonal @@Procrustes transform@.")
  2608. NORMAL (U"Algorithm 12.4.1 in @@Golub & van Loan (1996)@.")
  2609. MAN_END
  2610. MAN_BEGIN (U"PCA & TableOfReal: To Configuration...", U"djmw", 19990111)
  2611. INTRO (U"A command to construct a @Configuration from the selected @TableOfReal"
  2612. " and @PCA.")
  2613. ENTRY (U"Setting")
  2614. TAG (U"##Number of dimensions")
  2615. DEFINITION (U"determines the number of dimensions of the resulting Configuration.")
  2616. ENTRY (U"Algorithm")
  2617. NORMAL (U"The TableOfReal is projected on the eigenspace of the PCA, i.e., "
  2618. "each row of the TableOfReal is treated as a vector, and the inner product "
  2619. "with the eigenvectors of the PCA determine its coordinates in the Configuration.")
  2620. NORMAL (U"Because the algorithm performs a projection, the resulting Configuration will "
  2621. "##only be centered#, i.e., its centroid will be at ##0#, if the data in the "
  2622. "TableOfReal object are centered too. ")
  2623. NORMAL (U"See also @@Eigen & TableOfReal: Project...@.")
  2624. MAN_END
  2625. MAN_BEGIN (U"PCA & TableOfReal: To TableOfReal (z-scores)...", U"djmw", 20151208)
  2626. INTRO (U"A command to construct a @TableOfReal with z-scores from the selected @TableOfReal"
  2627. " and @PCA.")
  2628. ENTRY (U"Setting")
  2629. TAG (U"##Number of dimensions")
  2630. DEFINITION (U"determines the number of dimensions of the resulting Configuration.")
  2631. ENTRY (U"Algorithm")
  2632. NORMAL (U"The values %d__%ij_ in the new TableOfReal are calculated as")
  2633. FORMULA (U"%d__%ij_ = ##eigenvector#__j_\\.c ##z#__%i_,")
  2634. NORMAL (U"which is the inproduct of the %j-th eigenvector and the z-score vector ##z#__%i_ of the %i-th row whose elements %z__%ij_ are defined as")
  2635. FORMULA (U"%z__%ij_ = (%x__%ij_ - x\\-^__%j_) / sqrt (eigenvalue__%j_),")
  2636. NORMAL (U"in which %x__%ij_ is the data value at row %i and column %j of the selected TableOfReal and x\\-^__%j_ is the "
  2637. "%j-th centroid value of the PCA. The square root of the %j-th eigenvalue is the standard deviation in "
  2638. " the %j-th principal direction.")
  2639. MAN_END
  2640. MAN_BEGIN (U"PCA & TableOfReal: Get fraction variance...", U"djmw", 20040324)
  2641. INTRO (U"A command to query the selected @PCA and @TableOfReal object for the explained "
  2642. "fraction of the variance if the TableOfReal object were projected onto the PCA space.")
  2643. ENTRY (U"Algorithm")
  2644. LIST_ITEM (U"1. The TableOfReal is @@TableOfReal: To Covariance|converted@ to a "
  2645. "Covariance object.")
  2646. LIST_ITEM (U"2. The Covariance object is @@PCA & Covariance: Project|projected@ on "
  2647. "the PCA eigenspace and the newly obtained projected Covariance object is "
  2648. "@@Covariance: Get fraction variance...|queried@ for the fraction variance.")
  2649. MAN_END
  2650. MAN_BEGIN (U"PitchTier: To Pitch...", U"djmw", 20061128)
  2651. INTRO (U"Synthesizes a new @Pitch from the selected @PitchTier.")
  2652. MAN_END
  2653. MAN_BEGIN (U"PitchTier: Modify interval...", U"djmw", 20170801)
  2654. INTRO (U"Modifies a selected interval from the chosen @PitchTier by replacing the contents of the interval by newly defined pitch points.")
  2655. ENTRY (U"Settings")
  2656. SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (12), U""
  2657. Manual_DRAW_SETTINGS_WINDOW (U"PitchTier: Modify interval", 12)
  2658. Manual_DRAW_SETTINGS_WINDOW_RANGE (U"Time range (s)", U"0.0", U"0.0")
  2659. Manual_DRAW_SETTINGS_WINDOW_FIELD (U"Relative times", U"0.0 0.5 1.0")
  2660. Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU (U"...are...", U"fractions")
  2661. "Text... 50 left y half ...of the interval duration which will be added...\n" \
  2662. "y += 40\n" \
  2663. "Text... 50 left y half ...to the start time of the interval.\n" \
  2664. "y += 40\n" \
  2665. Manual_DRAW_SETTINGS_WINDOW_FIELD (U"The \"pitch\" values", U"100.0 200.0 100.0")
  2666. Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU (U"...are...", U"frequencies")
  2667. "Text... 50 left y half ...to be added to the anchor value (if used)...\n" \
  2668. "y += 40\n" \
  2669. Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU (U"...which is the...",U"not used")
  2670. "Text... 50 left y half ...frequency value in the interval...\n" \
  2671. "y += 40\n" \
  2672. Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU (U"Pitch frequency unit",U"Hertz")
  2673. )
  2674. TAG (U"##Time range (s)")
  2675. DEFINITION (U"the start and end time of the interval where the changes will be applied.")
  2676. TAG (U"##Relative times")
  2677. DEFINITION (U"determine, together with the following option, the times of the new pitch points with respect to the start time of the interval.")
  2678. TAG (U"##...are...")
  2679. DEFINITION (U"determines how the times %t__%i_ of the new pitch points are calculated. The time of each new pitch point is determined by adding to the start time of the interval a time calculated from the relative time value. If %%t%__min_ and %%t%__max_ are the start and end time of the interval and %%r%__i_ is the %%i%^^th^ relative time, the times %t__%i_ are calculated according to the options as:")
  2680. TAG1 (U"%%fractions%")
  2681. DEFINITION (U"%%t%__%i_ = %t__min_ + %r__%i_ (%t__max_ \\-- %t__min_). The relative time values are fractions of the interval duration. Normally fractions are numbers in the range 0.0 to 1.0, although smaller and larger numbers are allowed.")
  2682. TAG1 (U"%%percentages%")
  2683. DEFINITION (U"%%t%__%i_ = %t__min_+ 0.01 %r__%i_ (%t__max_ \\-- %t__min_). The relative time values are percentages of the interval duration. Normally percentages are numbers in the range 0.0 to 100.0, although smaller and larger numbers are allowed.")
  2684. TAG1 (U"%%independent%")
  2685. DEFINITION (U"%%t%__%i_ = %t__min_ + %r__%i_. The relative time values specify an offset in seconds here. ")
  2686. TAG (U"##The \"pitch\" values")
  2687. DEFINITION (U"determine, together with the next two options, the frequency value of the new pitch points. Each value here must link to the corresponding time value.")
  2688. TAG (U"##...are...")
  2689. DEFINITION (U"determines the interpretation of the \"pitch\" value. Possible choices are")
  2690. TAG1 (U"%%frequencies%")
  2691. DEFINITION (U"the values are frequencies in hertz.")
  2692. TAG1 (U"%%fractions%")
  2693. DEFINITION (U"the values are fractions of a pitch value that is specified by the next option. Normally fractions are numbers in the range 0.0 to 1.0, although smaller and larger numbers are allowed.")
  2694. TAG1 (U"%%percentages%")
  2695. DEFINITION (U"the values are percentages of a pitch value that is specified by the next option. Normally percentages are numbers in the range 0.0 to 100.0, although smaller and larger numbers are allowed.")
  2696. TAG1 (U"%%start and slopes%")
  2697. DEFINITION (U"the values are a start frequency followed by slopes in Herz per second.")
  2698. TAG1 (U"%%slopes and end%")
  2699. DEFINITION (U"the values are slopes in herz per second followed by an end frequency in herz.")
  2700. TAG1 (U"%%music notes%")
  2701. DEFINITION (U"the values are music notes specified on the twelve tone scale as a0, a\\# 0, b0, c0, c\\# 0, d0, d\\# 0, e0, f0, f\\# 0, g0, g\\# 0, a1, a\\# 1, ... a4, ..., or g\\# 9. Here the octave is indicated by the number, 0 being the lowest octave and 9 the highest. The a4 is choosen to be at 440 Hz. Therefore, a0 is the note with the lowest frequency, four octaves below the a4 and corresponds to a frequency of 27.5 Hz. As a scale of reference we give a0 = 27.5 Hz, a1 = 55 Hz, a2 = 110 Hz, a3 = 220 Hz, a4 = 440 Hz, a5 = 880 Hz, a6 = 1760 Hz, a7 = 3520 Hz, a8 = 7040 Hz and a9 = 14080 Hz.")
  2702. TAG (U"##...which is the...")
  2703. DEFINITION (U"the anchor point value, if used. The following options may be given for the anchor point frequency value:")
  2704. TAG1 (U"%%not used%")
  2705. DEFINITION (U"no anchor point frequency value is necessary. The previous two options are sufficient to determine the new pitch frequencies. This means that the \"pitch\" values given cannot be %%fractions% or %%percentages%.")
  2706. TAG1 (U"%%current%")
  2707. DEFINITION (U"the current pitch frequency at the corresponding time.")
  2708. TAG1 (U"%%start%")
  2709. DEFINITION (U"the pitch frequency at the start of the interval.")
  2710. TAG1 (U"%%end%")
  2711. DEFINITION (U"the pitch frequency at the end of the interval.")
  2712. TAG1 (U"%%mean of the curve%")
  2713. DEFINITION (U"the @@PitchTier: Get mean (curve)...|mean of the curve@ within the interval.")
  2714. TAG1 (U" %%mean of the points%")
  2715. DEFINITION (U"the @@PitchTier: Get mean (points)...|mean of the points@ within the interval.")
  2716. TAG1 (U"%%maximum%")
  2717. DEFINITION (U"the maximum pitch frequency in the interval.")
  2718. TAG1 (U"%%minimum%")
  2719. DEFINITION (U"the minimum pitch frequency in the interval.")
  2720. TAG (U"##Pitch frequency unit")
  2721. DEFINITION (U"Hertz")
  2722. MAN_END
  2723. MAN_BEGIN (U"PitchTier: Modify interval (tone levels)...", U"djmw", 20170801)
  2724. INTRO (U"Modifies a selected interval from the chosen @PitchTier by replacing the contents of the interval by newly defined pitch points.")
  2725. NORMAL (U"For tone languages the pitch contours of the tones are often expressed as a sequence of tone levels instead of a sequence of real frequency values in hertz because tone levels abstract away from the possibly different pitch ranges of individual speakers.")
  2726. NORMAL (U"The tone levels %T are calculated from a given pitch %%frequency% in hertz as:")
  2727. FORMULA (U"%T = %%numberOfToneLevels% \\.c log (%%frequency% / %F__min_) / log (%F__max_ / %F__min_),")
  2728. NORMAL (U"where %F__min_ and %F__max_ are the minimum and the maximum frequency of a speaker's pitch range and %%numberOfToneLevels% is the number of levels into which the pitch range is divided. "
  2729. "This formula maps any frequency between %F__min_ and %F__max_ to a number between 0 and %%numberOfToneLevels%.")
  2730. NORMAL (U"To get the frequency in hertz from a specified tone level %T we have to use the inverse formula:")
  2731. FORMULA (U"%%frequency% = %F__min_ \\.c 10^^(%T \\.c log (%F__max_ / %F__min_)) / %%numberOfToneLevels%)^.")
  2732. ENTRY (U"Settings")
  2733. SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (9), U""
  2734. Manual_DRAW_SETTINGS_WINDOW (U"PitchTier: Modify interval (tone levels)", 9)
  2735. Manual_DRAW_SETTINGS_WINDOW_RANGE (U"Time range (s)", U"0.0", U"0.0")
  2736. Manual_DRAW_SETTINGS_WINDOW_RANGE (U"Pitch range (Hz)", U"80.0", U"200.0")
  2737. Manual_DRAW_SETTINGS_WINDOW_FIELD (U"Number of tone levels", U"5")
  2738. Manual_DRAW_SETTINGS_WINDOW_FIELD (U"Relative times", U"0.0 0.5 1.0")
  2739. Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU (U"...are...",U"fractions")
  2740. "Text... 50 left y half ...of the interval duration which will be added...\n" \
  2741. "y += 40\n" \
  2742. "Text... 50 left y half ...to the start time of the interval.\n" \
  2743. "y += 40\n" \
  2744. Manual_DRAW_SETTINGS_WINDOW_FIELD (U"Tone levels", U"2.1 2.1 5.0")
  2745. )
  2746. TAG (U"##Time range (s)")
  2747. DEFINITION (U"the start and end time of the interval where the changes will be applied.")
  2748. TAG (U"##Pitch range (Hz)")
  2749. DEFINITION (U"The minimum and maximum frequency to which the tone levels refer.")
  2750. TAG (U"##Number of tone levels")
  2751. DEFINITION (U"The number of levels into which the pitch range is divided.")
  2752. TAG (U"##Relative times")
  2753. DEFINITION (U"determine, together with the following option, the times of the new pitch points with respect to the start time of the interval.")
  2754. DEFINITION (U"determines how the times %t__%i_ of the new pitch points are calculated. The time of each new pitch point is determined by adding to the start time of the interval a time calculated from the relative time value. If %%t%__min_ and %%t%__max_ are the start and end time of the interval and %%r%__i_ is the %%i%^^th^ relative time, the times %t__%i_ are calculated according to the options as:")
  2755. TAG1 (U"%%fractions%")
  2756. DEFINITION (U"%%t%__%i_ = %t__min_ + %r__%i_ (%t__max_ \\-- %t__min_). The relative time values are fractions of the interval duration. Normally fractions are numbers in the range 0.0 to 1.0, although smaller and larger numbers are allowed.")
  2757. TAG1 (U"%%percentages%")
  2758. DEFINITION (U"%%t%__%i_ = %t__min_+ 0.01 %r__%i_ (%t__max_ \\-- %t__min_). The relative time values are percentages of the interval duration. Normally percentages are numbers in the range 0.0 to 100.0, although smaller and larger numbers are allowed.")
  2759. TAG1 (U"%%independent%")
  2760. DEFINITION (U"%%t%__%i_ = %t__min_ + %r__%i_. The relative time values specify an offset in seconds here. ")
  2761. TAG (U"##Tone levels")
  2762. DEFINITION (U"specify the frequencies at the corresponding time points as tone levels.")
  2763. ENTRY (U"Algorithm")
  2764. NORMAL (U"1. The real times are calculated from the relative times.")
  2765. NORMAL (U"2. The frequencies are calculated from the tone levels.")
  2766. NORMAL (U"3. The real times and the frequencies are sorted together by time.")
  2767. NORMAL (U"4. All pitch points in the PitchTier between the first and the last time of the sorted time array are removed.")
  2768. NORMAL (U"5. The newly calculated pitch points are added to the PitchTier.")
  2769. MAN_END
  2770. MAN_BEGIN (U"Polygon: Rotate...", U"djmw", 20100418)
  2771. INTRO (U"Rotates the selected @@Polygon@ counterclockwise with respect to the given coordinates.")
  2772. MAN_END
  2773. MAN_BEGIN (U"Create simple Polygon...", U"djmw", 20140117)
  2774. INTRO (U"Creates a @@Polygon@ from user supplied x/y pairs.")
  2775. ENTRY (U"Settings")
  2776. TAG (U"##Name")
  2777. DEFINITION (U"defines the name of the resulting Polygon.")
  2778. TAG (U"##Vertices as X-Y pairs#,")
  2779. DEFINITION (U"defines the x-y values of the vertices of the Polygon. The Polygon will be automatically closed, i.e., the first and the last point will be connected.")
  2780. ENTRY (U"Example")
  2781. NORMAL (U"The command ##Create simple Polygon: \"p\", \"0.0 0.0 0.0 1.0 1.0 0.0\"# defines a Polygon with three points. In the figure the three points are indicated with open circles while the Polygon is drawn as a closed figure.")
  2782. SCRIPT (4,4, U"Create simple Polygon: \"p\", \"0.0 0.0 0.0 1.0 1.0 0.0\"\n"
  2783. "Draw circles: 0, 1, 0, 1, 3\n"
  2784. "Draw closed: 0, 1, 0, 1\n"
  2785. "Remove\n")
  2786. MAN_END
  2787. MAN_BEGIN (U"Polygon: Get location of point...", U"djmw", 20120220)
  2788. INTRO (U"Determines whether a given point is on the ##I#nside, the ##O#utside, on an ##E#dge or on a ##V#ertex of the selected Polygon.")
  2789. ENTRY (U"Algorithm")
  2790. NORMAL (U"We determine how often a horizontal line extending from the point crosses the polygon. If the number of crossings is even, the point is on the outside, else on the inside. Special care is taken to be able to detect if a point is on the boundary of the polygon. The used algorithm is from @@Hormann & Agathos (2001)@")
  2791. MAN_END
  2792. MAN_BEGIN (U"Polygon: Simplify", U"djmw", 20140509)
  2793. INTRO (U"Removes collinear vertices from a @@Polygon@.")
  2794. ENTRY (U"Example")
  2795. SCRIPT (4, 4,
  2796. U"p1 = Create simple Polygon: \"p\", \"0.0 0.0 0.0 1.0 0.5 0.5 1.0 0.0 0.5 0 0 -0.5 0 -0.25\"\n"
  2797. "Draw closed: 0, 0, 0, 0\n"
  2798. "Colour: \"Red\"\n"
  2799. "Draw circles: 0, 0, 0, 0, 3\n"
  2800. "p2 = Simplify\n"
  2801. "Colour: \"Black\"\n"
  2802. "Paint circles: 0, 0, 0, 0, 1.5\n"
  2803. "removeObject: p1, p2\n"
  2804. )
  2805. NORMAL (U"Given the Polygon with the seven vertices indicated by the red open circles, the Simplify action results in the Polygon with four vertices indicated by the filled black circles.")
  2806. MAN_END
  2807. MAN_BEGIN (U"Polygon: Translate...", U"djmw", 20100418)
  2808. INTRO (U"Translates the selected @@Polygon@ over the given vector.")
  2809. NORMAL (U"Given the old coordinates (x__i_, y__i_) and the translation (x__t_,y__t_), the new coordinates are:")
  2810. FORMULA (U"x__i_\\'p = x__i_ + x__t_")
  2811. FORMULA (U"y__i_\\'p = y__i_ + y__t_")
  2812. MAN_END
  2813. MAN_BEGIN (U"Polynomial", U"djmw", 19990608)
  2814. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  2815. NORMAL (U"An object of type "
  2816. "Polynomial represents a polynomial function on a domain.")
  2817. NORMAL (U"A polynomial of degree %n is defined as:")
  2818. FORMULA (U"%p(%x) = %c__1_ + %c__2_ %x + %c__3_ %x^^2^ + ... c__%n+1_ %x^^%n^.")
  2819. NORMAL (U"The real numbers %c__%k_ are called the polynomial %coefficients.")
  2820. ENTRY (U"Commands")
  2821. NORMAL (U"Creation")
  2822. LIST_ITEM (U"\\bu @@Create Polynomial...@ (in the ##New menu#)")
  2823. LIST_ITEM (U"\\bu @@LPC: To Polynomial (slice)...@ (from prediction coefficients)")
  2824. LIST_ITEM (U"\\bu @@LegendreSeries: To Polynomial@")
  2825. LIST_ITEM (U"\\bu @@ChebyshevSeries: To Polynomial@")
  2826. NORMAL (U"Drawing")
  2827. LIST_ITEM (U"\\bu ##Draw...#")
  2828. NORMAL (U"Queries")
  2829. LIST_ITEM (U"\\bu @@Polynomial: Get function value...|Get function value...@: get %p(%x)")
  2830. LIST_ITEM (U"\\bu ##Get coefficient value...#: get %c__%i_")
  2831. LIST_ITEM (U"\\bu @@Polynomial: Get minimum...|Get minimum...@: minimum of %p(%x) on an interval")
  2832. LIST_ITEM (U"\\bu @@Polynomial: Get x of minimum...|Get x of minimum...@")
  2833. LIST_ITEM (U"\\bu @@Polynomial: Get maximum...|Get maximum...@: maximum of %p(%x) on an interval")
  2834. LIST_ITEM (U"\\bu @@Polynomial: Get x of maximum...|Get x of maximum...@")
  2835. LIST_ITEM (U"\\bu @@Polynomial: Get area...|Get area...@")
  2836. NORMAL (U"Modification")
  2837. LIST_ITEM (U"\\bu ##Set domain...#: new domain")
  2838. LIST_ITEM (U"\\bu ##Set coefficient value...#: change one coefficient")
  2839. NORMAL (U"Conversion")
  2840. LIST_ITEM (U"\\bu @@Polynomial: To Spectrum...|To Spectrum...@ (evaluation over unit-circle)")
  2841. LIST_ITEM (U"\\bu @@Polynomial: To Polynomial (derivative)|To Polynomial (derivative)@")
  2842. LIST_ITEM (U"\\bu @@Polynomial: To Polynomial (primitive)|To Polynomial (primitive)@")
  2843. LIST_ITEM (U"\\bu @@Polynomial: To Roots|To Roots@: roots of polynomial")
  2844. MAN_END
  2845. MAN_BEGIN (U"Polynomial: Get area...", U"djmw", 19990610)
  2846. INTRO (U"A command to compute the area below the selected @Polynomial object.")
  2847. ENTRY (U"Settings")
  2848. TAG (U"##Xmin#, ##Xmax#")
  2849. DEFINITION (U"define the interval.")
  2850. NORMAL (U"The area is defined as __%xmin_\\in^^xmax^ %p(%x) %dx.")
  2851. MAN_END
  2852. MAN_BEGIN (U"Polynomial: Get function value...", U"djmw", 19990610)
  2853. INTRO (U"A command to compute %p(%x) for the selected @Polynomial object.")
  2854. MAN_END
  2855. MAN_BEGIN (U"Polynomial: Get maximum...", U"djmw", 19990610)
  2856. INTRO (U"A command to compute, on a specified interval, the maximum value of the selected "
  2857. "@Polynomial object.")
  2858. MAN_END
  2859. MAN_BEGIN (U"Polynomial: Get x of maximum...", U"djmw", 19990610)
  2860. INTRO (U"A command to compute, on a specified interval, the location of the maximum of the "
  2861. "selected @Polynomial object.")
  2862. MAN_END
  2863. MAN_BEGIN (U"Polynomial: Get minimum...", U"djmw", 19990610)
  2864. INTRO (U"A command to compute, on a specified interval, the minimum value of the selected "
  2865. "@Polynomial object.")
  2866. MAN_END
  2867. MAN_BEGIN (U"Polynomial: Get x of minimum...", U"djmw", 19990610)
  2868. INTRO (U"A command to compute, on a specified interval, the location of the minimum of the "
  2869. "selected @Polynomial object.")
  2870. MAN_END
  2871. MAN_BEGIN (U"Polynomials: Multiply", U"djmw", 19990616)
  2872. INTRO (U"A command to multiply two @@Polynomial|polynomials@ with each other.")
  2873. NORMAL (U"The result of multiplying 1 + 2 %x and 2 \\-- %x^2 will be the polynomial:")
  2874. FORMULA (U"2 + 4 %x \\-- %x^2 \\-- 2 %x^3.")
  2875. MAN_END
  2876. MAN_BEGIN (U"Polynomial: To Polynomial (derivative)", U"djmw", 19990610)
  2877. INTRO (U"A command to compute the derivative of the selected @Polynomial object.")
  2878. MAN_END
  2879. MAN_BEGIN (U"Polynomial: To Polynomial (primitive)", U"djmw", 19990610)
  2880. INTRO (U"A command to compute the primitive of the selected @Polynomial object.")
  2881. MAN_END
  2882. MAN_BEGIN (U"Polynomial: Scale x...", U"djmw", 19990610)
  2883. INTRO (U"A command to transform the selected @Polynomial object to a new domain.")
  2884. TAG (U"##Xmin# and ##Xmax#")
  2885. DEFINITION (U"define the new domain.")
  2886. ENTRY (U"Behaviour")
  2887. NORMAL (U"The polynomial is transformed from domain [%x__min_, %x__max_] to "
  2888. "domain [%Xmin, %Xmax] in such a way that its form stays the same. "
  2889. "This is accomplished by first calculating:")
  2890. FORMULA (U"%f(%x\\'p) = \\Si__%k=1..%numberOfCoefficients_ %c__%k_ %x\\'p^^%k^, where")
  2891. FORMULA (U"%x\\'p = %a %x + %b,")
  2892. NORMAL (U"and then collecting terms of equal degree. The %a and %b are defined as")
  2893. FORMULA (U"%a = (%x__min_ \\-- %x__max_) / (%Xmin \\-- %Xmax)")
  2894. FORMULA (U"%b = %x__min_ \\-- %a %Xmin")
  2895. MAN_END
  2896. MAN_BEGIN (U"Polynomial: To Roots", U"djmw", 19990608)
  2897. INTRO (U"A command to compute the @@Roots|roots@ of the selected @Polynomial objects.")
  2898. ENTRY (U"Algorithm")
  2899. NORMAL (U"The roots are found from the polished eigenvalues of a special companion matrix. "
  2900. "For further explanation on these methods see @@Press et al. (1992)@.")
  2901. MAN_END
  2902. MAN_BEGIN (U"Polynomial: To Spectrum...", U"djmw", 19990616)
  2903. INTRO (U"A command to compute the @@Spectrum|spectrum@ of the selected @Polynomial objects.")
  2904. ENTRY (U"Settings")
  2905. TAG (U"##Nyquist frequency (Hz)")
  2906. DEFINITION (U"defines the highest frequency in the spectrum. The lowest frequency of the spectrum "
  2907. "will be 0 Hz.")
  2908. TAG (U"##Number of frequencies")
  2909. DEFINITION (U"defines the number of frequencies in the spectrum.")
  2910. ENTRY (U"Algorithm")
  2911. NORMAL (U"We calculate the spectrum by evaluating the polynomial at regularly spaced points %z__%k_ "
  2912. "on the upper half of a circle with radius %r = 1 in the complex plane. The upperhalf of the "
  2913. "unit circle, where %k\\.c%\\fi is in the interval [0, %\\pi], will be mapped to frequencies "
  2914. "[0, @@Nyquist frequency@] in the spectrum. ")
  2915. NORMAL (U"The complex values %z__%k_ (%k=1..%numberOfFrequencies) are defined as:")
  2916. FORMULA (U"%z__%k_ = %r e^^%i %k %\\fi^, where,")
  2917. FORMULA (U"%\\fi = \\pi / (%numberOfFrequencies \\-- 1) and %r = 1.")
  2918. MAN_END
  2919. MAN_BEGIN (U"Principal component analysis", U"djmw", 20160222)
  2920. INTRO (U"This tutorial describes how you can perform principal component "
  2921. "analysis with P\\s{RAAT}.")
  2922. NORMAL (U"Principal component analysis (PCA) involves a mathematical procedure "
  2923. "that transforms a number of (possibly) correlated variables into a "
  2924. "(smaller) number of uncorrelated variables called %%principal "
  2925. "components%. The first principal component accounts for as much of the "
  2926. "variability in the data as possible, and each succeeding component "
  2927. "accounts for as much of the remaining variability as possible.")
  2928. ENTRY (U"1. Objectives of principal component analysis")
  2929. LIST_ITEM (U"\\bu To discover or to reduce the dimensionality of the data set.")
  2930. LIST_ITEM (U"\\bu To identify new meaningful underlying variables.")
  2931. ENTRY (U"2. How to start")
  2932. NORMAL (U"We assume that the multi-dimensional data have been collected in a @TableOfReal data matrix, "
  2933. "in which the rows are associated with the cases and the columns with the variables. The TableOfReal is therefore interpreted as %%numberOfRows% data vectors, each data vector has %%numberofColumns% elements.")
  2934. NORMAL (U"Traditionally, principal component analysis is performed on the "
  2935. "@@Covariance|Covariance@ matrix or on the @@correlation|Correlation@ matrix. "
  2936. "These matrices can be calculated from the data matrix. "
  2937. "The covariance matrix contains scaled @@SSCP|sums of squares and cross products@. "
  2938. "A correlation matrix is like a covariance matrix but first the variables, i.e. the columns, have been standardized. "
  2939. "We will have to standardize the data first if the variances of "
  2940. "variables differ much, or if the units of measurement of the "
  2941. "variables differ. You can standardize the data in the TableOfReal by choosing @@TableOfReal: Standardize columns|Standardize columns@.")
  2942. NORMAL (U"To perform the analysis, we select the TabelOfReal data matrix in the list of objects and choose "
  2943. "@@TableOfReal: To PCA|To PCA@. This will result in a new PCA object in the "
  2944. "list of objects.")
  2945. NORMAL (U"We can now make a @@Scree plot|scree@ plot of the eigenvalues, @@Eigen: Draw "
  2946. "eigenvalues...|Draw eigenvalues...@ "
  2947. "to get an indication of the importance of each eigenvalue. The exact "
  2948. "contribution of each eigenvalue (or a range of eigenvalues) to the "
  2949. "\"explained variance\" can also be queried: "
  2950. "@@PCA: Get fraction variance accounted for...|Get fraction variance "
  2951. "accounted for...@. You might also check for the equality of a "
  2952. "number of eigenvalues: @@PCA: Get equality of eigenvalues...|Get equality "
  2953. "of eigenvalues...@.")
  2954. ENTRY (U"3. Determining the number of components to keep")
  2955. NORMAL (U"There are two methods to help you to choose the number of components to keep. "
  2956. "Both methods are based on relations between the eigenvalues.")
  2957. LIST_ITEM (U"\\bu Plot the eigenvalues, @@Eigen: Draw eigenvalues...|"
  2958. "Draw eigenvalues...@. If the points on the graph tend to level out (show an \"elbow\"), "
  2959. "these eigenvalues are usually close enough to zero that they can be "
  2960. "ignored.")
  2961. LIST_ITEM (U"\\bu Limit the number of components to that number that accounts for a certain fraction of the total variance. For example, "
  2962. "if you are satisfied with 95\\% of the total variance explained, then use the number you get by the query @@PCA: Get number of components (VAF)...|Get number of components (VAF)...@ 0.95#.")
  2963. ENTRY (U"4. Getting the principal components")
  2964. NORMAL (U"Principal components are obtained by projecting the multivariate "
  2965. "datavectors on the space spanned by the eigenvectors. This can be done "
  2966. "in two ways:")
  2967. LIST_ITEM (U"1. Directly from the TableOfReal without first forming a "
  2968. "@PCA object: "
  2969. "@@TableOfReal: To Configuration (pca)...|To Configuration (pca)...@. "
  2970. "You can then draw the Configuration or display its numbers. ")
  2971. LIST_ITEM (U"2. Select a PCA and a TableOfReal object together and choose "
  2972. "@@PCA & TableOfReal: To Configuration...|To Configuration...@. "
  2973. "In this way you project the TableOfReal onto the PCA's eigenspace.")
  2974. ENTRY (U"5. Mathematical background on principal component analysis")
  2975. NORMAL (U"The mathematical technique used in PCA is called eigen analysis: "
  2976. "we solve for the eigenvalues and eigenvectors of a square symmetric "
  2977. "matrix with sums of squares and cross products. "
  2978. "The eigenvector associated with the largest eigenvalue has the same "
  2979. "direction as the first principal component. The eigenvector associated "
  2980. "with the second largest eigenvalue determines the direction of the second "
  2981. "principal component. "
  2982. "The sum of the eigenvalues equals the trace of the square matrix and the "
  2983. "maximum number of eigenvectors equals the number of rows (or columns) of "
  2984. "this matrix.")
  2985. ENTRY (U"6. Algorithms")
  2986. NORMAL (U"If our starting point happens to be a symmetric matrix like the covariance matrix, "
  2987. "we solve for the eigenvalue and eigenvectors "
  2988. "by first performing a Householder reduction to tridiagonal form, followed"
  2989. " by the QL algorithm with implicit shifts.")
  2990. NORMAL (U"If, conversely, our starting point is the data matrix #%A , "
  2991. "we do not have to form explicitly the matrix with sums of squares and "
  2992. "cross products, #%A\\'p#%A. Instead, we proceed by a numerically more "
  2993. "stable method, and form the @@singular value decomposition@ of #%A, "
  2994. "#%U #%\\Si #%V\\'p. The matrix #%V then contains the eigenvectors, "
  2995. "and the squared diagonal elements of #%\\Si contain the eigenvalues.")
  2996. MAN_END
  2997. MAN_BEGIN (U"PCA & Covariance: Project", U"djmw", 20040225)
  2998. INTRO (U"A command to project the @Covariance object onto the eigenspace of "
  2999. "the @PCA object. ")
  3000. NORMAL (U"Further details can be found in @@Eigen & SSCP: Project@.")
  3001. MAN_END
  3002. MAN_BEGIN (U"PCA & SSCP: Project", U"djmw", 20040225)
  3003. INTRO (U"A command to project the @SSCP object onto the eigenspace of "
  3004. "the @PCA object. ")
  3005. NORMAL (U"Further details can be found in @@Eigen & SSCP: Project@.")
  3006. MAN_END
  3007. MAN_BEGIN (U"Regular expressions", U"David Weenink & Paul Boersma", 20180401)
  3008. INTRO (U"This tutorial describes the syntax of regular expressions in Praat. ")
  3009. ENTRY (U"Introduction")
  3010. NORMAL (U"A %%regular expression% (regex) is a text string that describes a %set "
  3011. "of strings. Regular expressions are useful as a way to search "
  3012. "for patterns in text strings and, optionally, replace them by another "
  3013. "pattern.")
  3014. NORMAL (U"Some regular expressions match only one string, i.e., the set they describe has "
  3015. "only one member. For example, the regex \"ab\" matches the string \"ab\" "
  3016. "and no others. Other regular expressions match more than one string, i.e., the set "
  3017. "they describe has more than one member. For example, the regex \"a*\" "
  3018. "matches the string made up of any number (including zero) of \"a\"s. "
  3019. "As you can see, some characters match themselves (such as \"a\" and "
  3020. "\"b\"), and these characters are called %ordinary characters. The "
  3021. "characters that do not match themselves, such as \"*\", are called "
  3022. "%special characters or %metacharacters. Many special characters are only "
  3023. "special characters in the %search regex and are ordinary characters in "
  3024. "the substitution regex.")
  3025. NORMAL (U"You can read the rest of this tutorial sequentially with the help of "
  3026. "the \"<1\" and \">1\" buttons.")
  3027. LIST_ITEM (U"1. @@Regular expressions 1. Special characters|Special characters@ "
  3028. "(\\bs \\^ \\$ { } [ ] ( ) . + ? \\| - &)")
  3029. LIST_ITEM (U"2. @@Regular expressions 2. Quantifiers|Quantifiers@ "
  3030. "(how often do we match).")
  3031. LIST_ITEM (U"3. @@Regular expressions 3. Anchors|Anchors@ (where do we match)")
  3032. LIST_ITEM (U"4. @@Regular expressions 4. Special constructs with parentheses|"
  3033. "Special constructs with parentheses@ (grouping constructs)")
  3034. LIST_ITEM (U"5. @@Regular expressions 5. Special control characters|"
  3035. "Special control characters@ (difficult-to-type characters like \\bsn)")
  3036. LIST_ITEM (U"6. @@Regular expressions 6. Convenience escape sequences|"
  3037. "Convenience escape sequences@ "
  3038. "(\\bsd \\bsD \\bsl \\bsL \\bss \\bsS \\bsw \\bsW \\bsB)")
  3039. LIST_ITEM (U"7. @@Regular expressions 7. Octal and hexadecimal escapes|"
  3040. "Octal and hexadecimal escapes@ (things like \\bs053 or \\bsX2B)")
  3041. LIST_ITEM (U"8. @@Regular expressions 8. Substitution special characters|"
  3042. "Substitution special characters@ (\\bs1..\\bs9 \\bsU \\bsu \\bsL \\bsl &)")
  3043. NORMAL (U"More in depth coverage of regular expressions can be found in "
  3044. "@@Friedl (1997)@.")
  3045. MAN_END
  3046. MAN_BEGIN (U"Regular expressions 1. Special characters", U"djmw", 20010718)
  3047. INTRO (U"The following characters are the %meta characters that give special "
  3048. "meaning to the regular expression search syntax:")
  3049. TAG (U"#\\bs# the backslash %escape character.")
  3050. DEFINITION (U"The backslash gives special meaning to the character "
  3051. "following it. For example, the combination \"\\bsn\" stands for the "
  3052. "%newline, one of the @@Regular expressions 5. Special control characters"
  3053. "|control characters@. The combination \"\\bsw\" stands for a \"word\" "
  3054. "character, one of the @@Regular expressions 6. Convenience escape "
  3055. "sequences|"
  3056. "convenience escape sequences@ while \"\\bs1\" is one of the @@Regular "
  3057. "expressions 8. Substitution special characters|substitution special "
  3058. "characters@.")
  3059. LIST_ITEM1 (U"Example: The regex \"aa\\bsn\" tries to match two consecutive "
  3060. "\"a\"s at the end of a line, inclusive the newline character itself.")
  3061. LIST_ITEM1 (U"Example: \"a\\bs+\" matches \"a+\" and not a series of one or "
  3062. "\"a\"s.")
  3063. TAG (U"##\\^ # the caret is the @@Regular expressions 3. "
  3064. "Anchors|anchor@ for the start of the string, or the negation symbol.")
  3065. LIST_ITEM1 (U"Example: \"\\^ a\" matches \"a\" at the start of the string.")
  3066. LIST_ITEM1 (U"Example: \"[\\^ 0-9]\" matches any non digit.")
  3067. TAG (U"##\\$ # the dollar sign is the @@Regular expressions 3. "
  3068. "Anchors|anchor@ for the end of the string.")
  3069. LIST_ITEM1 (U"Example: \"b\\$ \" matches a \"b\" at the end of a line.")
  3070. LIST_ITEM1 (U"Example: \"\\^ \\$ \" matches the empty string.")
  3071. TAG (U"##{ }# the opening and closing curly brackets are used as range @@Regular "
  3072. "expressions 2. Quantifiers|quantifiers@.")
  3073. LIST_ITEM1 (U"Example: \"a{2,3}\" matches \"aa\" or \"aaa\".")
  3074. TAG (U"##[ ]# the opening and closing square brackets define a character class to "
  3075. "match a %single character.")
  3076. DEFINITION (U"The \"\\^ \" as the first character following the \"[\" negates, "
  3077. "and the match is for the characters %not listed. "
  3078. "The \"-\" denotes a range of characters. Inside a \"[ ]\" character "
  3079. "class construction, most special characters are interpreted as ordinary "
  3080. "characters.")
  3081. LIST_ITEM1 (U"Example: \"[d-f]\" is the same as \"[def]\" and matches \"d\", "
  3082. "\"e\" or \"f\".")
  3083. LIST_ITEM1 (U"Example: \"[a-z]\" matches any lower-case characters in the "
  3084. "alphabet.")
  3085. LIST_ITEM1 (U"Example: \"[\\^ 0-9]\" matches any character that is not an ASCII digit.")
  3086. LIST_ITEM1 (U"Example: A search for \"[][()?<>\\$ \\^ .*?\\^ ]\" in the string "
  3087. "\"[]()?<>\\$ \\^ .*?\\^ \" followed by a replace string \"r\" has the result "
  3088. "\"rrrrrrrrrrrrr\". Here the search string is %one character class and "
  3089. "all the meta characters are interpreted as ordinary characters without "
  3090. "the need to escape them.")
  3091. TAG (U"##( )# the opening and closing parenthes3s are used for grouping "
  3092. "characters (or other regexes).")
  3093. DEFINITION (U"The groups can be referenced in "
  3094. "both the search and the @@Regular expressions 8. Substitution special "
  3095. "characters|substitution@ phase. There also exist some @@Regular "
  3096. "expressions 4. Special constructs with parentheses|special constructs "
  3097. "with parentheses@.")
  3098. LIST_ITEM1 (U"Example: \"(ab)\\bs1\" matches \"abab\".")
  3099. TAG (U"##.# the dot matches any character except the newline symbol.")
  3100. LIST_ITEM1 (U"Example: \".a\" matches two consecutive characters where "
  3101. "the last one is \"a\".")
  3102. LIST_ITEM1 (U"Example: \".*\\bs.txt\\$ \" matches all strings that end in "
  3103. "\".txt\".")
  3104. TAG (U"##*# the asterisk is the match-zero-or-more @@Regular expressions 2. "
  3105. "Quantifiers|quantifier@.")
  3106. LIST_ITEM1 (U"Example: \"\\^ .*\\$ \" matches an entire line. ")
  3107. TAG (U"##+# the plus sign is the match-one-or-more quantifier.")
  3108. TAG (U"##?# the question mark is the match-zero-or-one "
  3109. "quantifier. The question mark is also used in "
  3110. "@@Regular expressions 4. Special constructs with parentheses|special "
  3111. "constructs with parentheses@ and in @@Regular expressions 2. "
  3112. "Quantifiers|changing match behaviour@.")
  3113. TAG (U"##\\| # the vertical pipe separates a series of alternatives.")
  3114. LIST_ITEM1 (U"Example: \"(a|b|c)a\" matches \"aa\" or \"ba\" or \"ca\".")
  3115. TAG (U"##< ># the smaller and greater signs are @@Regular expressions 3. "
  3116. "Anchors|anchors@ that specify a left or right word boundary.")
  3117. TAG (U"##-# the minus sign indicates a range in a character class (when it is "
  3118. "not at the first position after the \"[\" opening bracket or the last "
  3119. "position before the \"]\" closing bracket.")
  3120. LIST_ITEM1 (U"Example: \"[A-Z]\" matches any uppercase character.")
  3121. LIST_ITEM1 (U"Example: \"[A-Z-]\" or \"[-A-Z]\" match any uppercase character "
  3122. "or \"-\".")
  3123. TAG (U"##&# the ampersand is the \"substitute complete match\" symbol.")
  3124. MAN_END
  3125. MAN_BEGIN (U"Regular expressions 2. Quantifiers", U"djmw", 20010708)
  3126. INTRO (U"Quantifiers specify how often the preceding @@Regular expressions|"
  3127. "regular expression@ should match.")
  3128. TAG (U"##*# Try to match the preceding regular expression zero or more times.")
  3129. LIST_ITEM1 (U"Example: \"(ab)c*\" matches \"ab\" followed by zero or more "
  3130. "\"c\"s, i.e., \"ab\", \"abc\", \"abcc\", \"abccc\" ...")
  3131. TAG (U"##+# Try to match the preceding regular expression one or more times.")
  3132. LIST_ITEM1 (U"Example: \"(ab)c+\" matches \"ab\" followed by one or more "
  3133. "\"c\"s, i.e., \"abc\", \"abcc\", \"abccc\" ...")
  3134. TAG (U"##{%m, %n}# Try to match the preceding regular expression between %m "
  3135. "and %n times.")
  3136. DEFINITION (U"If you leave %m out, it is assumed to be zero. If you leave "
  3137. "%n out it is assumed to be infinity. I.e., \"{,%n}\" matches from %zero "
  3138. "to %n times, \"{%m,}\" matches a minimum of %m times, \"{,}\" matches "
  3139. "the same as \"*\" and \"{n}\" is shorthand for \"{n, n\"} and matches "
  3140. "exactly %n times.")
  3141. LIST_ITEM1 (U"Example: \"(ab){1,2}\" matches \"ab\" and \"abab\".")
  3142. TAG (U"##?# Try to match zero or one time.")
  3143. ENTRY (U"Changing match behaviour")
  3144. NORMAL (U"Default the quantifiers above try to match as much as possible, they "
  3145. "are %greedy. "
  3146. "You can change greedy behaviour to %lazy behaviour by adding an "
  3147. "extra \"?\" after the quantifier.")
  3148. LIST_ITEM1 (U"Example: In the string \"cabddde\", the search \"abd{1,2}\" "
  3149. "matches \"abdd\", while the search for \"abd{1,2}?\" matches \"abd\".")
  3150. LIST_ITEM1 (U"Example: In the string \"cabddde\", the search \"abd+\" "
  3151. "matches \"abddd\", while the search for \"abd+?\" matches \"abd\".")
  3152. MAN_END
  3153. MAN_BEGIN (U"Regular expressions 3. Anchors", U"DAvid Weenink & Paul Boersma", 20180401)
  3154. INTRO (U"Anchors let you specify a very specific position within the search "
  3155. "text.")
  3156. TAG (U"##\\^ # Try to match the (following) regex at the beginning of the string.")
  3157. LIST_ITEM1 (U"Example: \"\\^ ab\" matches \"ab\" only at the beginning of a "
  3158. "line and not, for example, in the line \"cab\".")
  3159. TAG (U"##\\$ # Try to match the (following) regex at the end of the string.")
  3160. TAG (U"##<# Try to match the regex at the %start of a word.")
  3161. DEFINITION (U"The character class that defines a %word can be found at the "
  3162. "@@Regular expressions 6. Convenience escape sequences|convenience escape "
  3163. "sequences@ page.")
  3164. TAG (U"##># Try to match the regex at the %end of a word.")
  3165. TAG (U"##\\bsB# Not a word boundary")
  3166. MAN_END
  3167. MAN_BEGIN (U"Regular expressions 4. Special constructs with parentheses", U"djmw",
  3168. 20010710)
  3169. INTRO (U"Some special constructs exist with parentheses. ")
  3170. TAG (U"##(?:#%regex#)# is a grouping-only construct.")
  3171. DEFINITION (U"They exist merely for efficiency reasons and facilitate grouping.")
  3172. TAG (U"##(?=#%regex#)# is a positive look-ahead.")
  3173. DEFINITION (U"A match of the regular expression contained in the positive "
  3174. "look-ahead construct is attempted. If the match succeeds, control is "
  3175. "passed to the regex following this construct and the text consumed by "
  3176. "this look-ahead construct is first unmatched. ")
  3177. TAG (U"##(?!#%regex#)# is a negative look-ahead.")
  3178. DEFINITION (U"Functions like a positive look-ahead, only the "
  3179. "%regex must %not match.")
  3180. LIST_ITEM (U"Example: \"abc(?!.*abc.*)\" searches for the %last "
  3181. "occurrence of \"abc\" in a string.")
  3182. TAG (U"##(?i#%regex#)# is a case insensitive regex.")
  3183. TAG (U"##(?I#%regex#)# is a case sensitive regex.")
  3184. DEFINITION (U"Default a regex is case sensitive. ")
  3185. LIST_ITEM1 (U"Example: \"(?iaa)\" matches \"aa\", \"aA\", \"Aa\" and \"AA\".")
  3186. TAG (U"##(?n#%regex#)# matches newlines.")
  3187. TAG (U"##(?N#%regex#)# doesn't match newlines.")
  3188. NORMAL (U"All the constructs above do not capture text and cannot be "
  3189. "referenced, i.e., the parentheses are not counted. However, you "
  3190. "can make them capture text by surrounding them with %ordinary "
  3191. "parentheses.")
  3192. MAN_END
  3193. MAN_BEGIN (U"Regular expressions 5. Special control characters", U"djmw", 20010708)
  3194. INTRO (U"Special control characters in a @@Regular expressions|regular "
  3195. "expression@ specify characters that are difficult to type.")
  3196. TAG (U"#\\bsa alert (bell).")
  3197. TAG (U"#\\bsb backspace.")
  3198. TAG (U"#\\bse ASCII escape character.")
  3199. TAG (U"#\\bsf form feed (new page).")
  3200. TAG (U"#\\bsn newline.")
  3201. TAG (U"#\\bsr carriage return.")
  3202. LIST_ITEM1 (U"Example : a search for \"\\bsr\\bsn\" followed by a replace "
  3203. "\"\\bsr\" changes Windows text files to Macintosh text files.")
  3204. LIST_ITEM1 (U"Example : a search for \"\\bsr\" followed by a replace "
  3205. "\"\\bsn\" changes Macintosh text files to Unix text files.")
  3206. LIST_ITEM1 (U"Example : a search for \"\\bsr\\bsn\" followed by a replace "
  3207. "\"\\bsn\" changes Windows text files to Unix text files.")
  3208. TAG (U"#\\bst horizontal tab.")
  3209. TAG (U"#\\bsv vertical tab.")
  3210. MAN_END
  3211. MAN_BEGIN (U"Regular expressions 6. Convenience escape sequences", U"djmw", 20010708)
  3212. INTRO (U"Convenience escape sequences in a @@Regular expressions|regular "
  3213. "expression@ present a shorthand for some character classes.")
  3214. TAG (U"#\\bsd matches a digit: [0-9].")
  3215. LIST_ITEM1 (U"Example: \"-?\\bsd+\" matches any integer.")
  3216. TAG (U"#\\bsD %not a digit: [\\^ 0-9].")
  3217. TAG (U"#\\bsl a letter: [a-zA-Z].")
  3218. TAG (U"#\\bsL %not a letter: [\\^ a-zA-Z].")
  3219. TAG (U"#\\bss whitespace: [ \\bst\\bsn\\bsr\\bsf\\bsv].")
  3220. TAG (U"#\\bsS %not whitespace: [\\^ \\bst\\bsn\\bsr\\bsf\\bsv].")
  3221. TAG (U"#\\bsw \"word\" character: [a-zA-Z0-9\\_ ].")
  3222. LIST_ITEM1 (U"Example: \"\\bsw+\" matches a \"word\", i.e., a string of one "
  3223. "or more characters that may consist of letters, digits and underscores.")
  3224. TAG (U"#\\bsW %not a \"word\" character: [\\^ a-zA-Z0-9\\_ ].")
  3225. TAG (U"#\\bsB any character that is %not a word-delimiter.")
  3226. MAN_END
  3227. MAN_BEGIN (U"Regular expressions 7. Octal and hexadecimal escapes", U"djmw", 20010709)
  3228. INTRO (U"An octal number can be represented by the octal escape \"\\bs0\" "
  3229. "and maximally three digits from the digit class [0-7]. "
  3230. "The octal number should not exceed \\bs0377. ")
  3231. NORMAL (U"A hexadecimal number can be represented by the octal escape "
  3232. "\"\\bsx\" or \"\\bsX\"and maximally two characters from the class "
  3233. "[0-9A-F]. The maximum hexadecimal number should not exceed \\bsxFF. ")
  3234. LIST_ITEM1 (U"Example: \\bs053 and \\bsX2B both specify the \"+\" character.")
  3235. MAN_END
  3236. MAN_BEGIN (U"Regular expressions 8. Substitution special characters", U"djmw", 20010708)
  3237. INTRO (U"The substitution string is mostly interpreted as ordinary text except "
  3238. "for the @@Regular expressions 5. Special control characters|"
  3239. "special control characters@, the @@Regular expressions 7. Octal and "
  3240. "hexadecimal escapes|octal and hexadecimal escapes@ and the following "
  3241. "character combinations:")
  3242. TAG (U"#\\bs1 ... #\\bs9 are backreferences at sub-expressions 1 ... 9 in the match.")
  3243. DEFINITION (U"Any of the first nine sub-expressions of the match string can "
  3244. "be inserted into the replacement string by inserting a `\\bs' followed "
  3245. "by a digit from 1 to 9 that represents the string matched by a "
  3246. "parenthesized expression within the regular expression. The numbering "
  3247. "is left to right.")
  3248. LIST_ITEM1 (U"Example: A search for \"(a)(b)\" in the string \"abc\", "
  3249. "followed by a replace \"\\bs2\\bs1\" results in \"bac\".")
  3250. TAG (U"#& reference at entire match.")
  3251. DEFINITION (U"The entire string that was matched by the search operation will "
  3252. "be substituted.")
  3253. LIST_ITEM1 (U"Example: a search for \".\" in the string \"abcd\" followed by "
  3254. "the replace \"&&\" doubles every character in the result "
  3255. "\"aabbccdd\".")
  3256. TAG (U"#\\bsU #\\bsu to uppercase.")
  3257. DEFINITION (U"The text inserted by \"&\" or \"\\bs1\" ... \"\\bs9\" is "
  3258. "converted to %uppercase (\"\\bsu\" only changes the %first character to "
  3259. "uppercase).")
  3260. LIST_ITEM1 (U"Example: A search for \"(aa)\" in the string \"aabb\", "
  3261. "followed by a replace \"\\bsU\\bs1bc\" results in the string \"AAbcbb\".")
  3262. TAG (U"#\\bsL #\\bsl to lowercase.")
  3263. DEFINITION (U"The text inserted by \"&\" or \"\\bs1\" ... \"\\bs9\" is "
  3264. "converted to %lowercase (\"\\bsl\" only changes the %first character to "
  3265. "lowercase).")
  3266. LIST_ITEM1 (U"Example: A search for \"(AA)\" with a replace \"\\bsl\\bs1bc\" "
  3267. "in the string \"AAbb\" results in the string \"aAbcbb\".")
  3268. MAN_END
  3269. MAN_BEGIN (U"Roots", U"djmw", 19990608)
  3270. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  3271. NORMAL (U"An object of type Roots "
  3272. "represents the (complex) roots of a @@Polynomial|polynomial@ function.")
  3273. ENTRY (U"Commands")
  3274. NORMAL (U"Creation")
  3275. LIST_ITEM (U"\\bu @@Polynomial: To Roots@")
  3276. NORMAL (U"Drawing")
  3277. LIST_ITEM (U"\\bu ##Draw...# (in the complex plane)")
  3278. NORMAL (U"Queries")
  3279. LIST_ITEM (U"\\bu ##Get root...#: get complex root")
  3280. LIST_ITEM (U"\\bu ##Get real part of root...#")
  3281. LIST_ITEM (U"\\bu ##Get imaginary part of root...#")
  3282. MAN_END
  3283. MAN_BEGIN (U"Scree plot", U"djmw", 20040331)
  3284. NORMAL (U"A scree plot shows the sorted eigenvalues, from large to "
  3285. "small, as a function of the eigenvalue index.")
  3286. MAN_END
  3287. MAN_BEGIN (U"singular value decomposition", U"djmw", 20171217)
  3288. INTRO (U"The %%singular value decomposition% (SVD) is a matrix factorization algorithm.")
  3289. NORMAL (U"For %m >= %n, the singular value decomposition of a real %m \\xx %n matrix #A is the "
  3290. "factorization")
  3291. FORMULA (U"#A = #U #\\Si #V\\'p,")
  3292. NORMAL (U"The matrices in this factorization have the following properties:")
  3293. TAG (U"#U [%m \\xx %n] and #V [%n \\xx %n]")
  3294. DEFINITION (U"are orthogonal matrices. The columns #u__%i_ of #U =[#u__1_, ..., #u__%n_] "
  3295. "are the %%left singular vectors%, and the columns #v__%i_ of #V [#v__1_, ..., #v__%n_] "
  3296. "are the %%right singular vectors%.")
  3297. TAG (U"#\\Si [%n \\xx %n] = diag (%\\si__1_, ..., %\\si__%n_)")
  3298. DEFINITION (U"is a real, nonnegative, and diagonal matrix. Its diagonal contains the so called "
  3299. "%%singular values% %\\si__%i_, where %\\si__1_ \\>_ ... \\>_ %\\si__%n_ \\>_ 0.")
  3300. MAN_END
  3301. MAN_BEGIN (U"SVD", U"djmw", 20171214)
  3302. INTRO (U"An object of type ##SVD# represents the @@singular value decomposition@ of a matrix.")
  3303. ENTRY (U"SVD internals")
  3304. NORMAL (U"Given #A, an %m \\xx %n matrix with %m >= %n, the decomposition will be #A = #U #\\Si #V\\'p. ")
  3305. NORMAL (U"In the SVD object we store the %m \\xx %n matrix #U, the %n \\xx %n matrix #V and the %%n%-dimensional vector with the singular values. ")
  3306. NORMAL (U"If it happens that for the #A matrix %m < %n, i.e. the number of rows is less than the number of columns, then we store "
  3307. "the SVD of the transpose of #A and flag this internally. "
  3308. "In this way we can make sure that for the matrix #U the number of columns never exceeds the number of rows and at the same time that the dimension of the matrix #V never exceeds the dimension of the matrix #U. ")
  3309. NORMAL (U"For example the SVD of a 100 \\xx 20 matrix will result in a 100 \\xx 20 matrix #U, a 20 \\ 20 matrix #V and 20 singular values, "
  3310. "the SVD of a 20 \\xx 100 matrix will also result in a 100 \\xx 20 matrix #U, a 20 \\ 20 matrix #V and 20 singular values, however it will be internally flagged as being transposed.")
  3311. MAN_END
  3312. MAN_BEGIN (U"SVD: Get minimum number of singular values...", U"djmw", 20171214)
  3313. INTRO (U"A command to get the minimum number of singular values (s.v.'s) whose sum, divided by the sum of all singular values, is smaller than the given fraction.")
  3314. ENTRY (U"Examples")
  3315. NORMAL (U"Given an SVD with four s.v's 10.0, 6.0, 3.0 and 1.0. The sum of the s.v's is 20.0.")
  3316. CODE (U"Get minimum number of singular values: 0.5")
  3317. DEFINITION (U"The returned value would be 1. The first s.v. divided by the sum is 0.5 (= 10.0 / 20.0). "
  3318. "For any fraction lower than 0.5 the query would also return 1, because the first s.v. already covers half of the total sum.")
  3319. CODE (U"Get minimum number of singular values: 0.8")
  3320. DEFINITION (U"The returned value would be 2. The sum of first two s.v.'s divided by the sum is 0.8 (= (10.0 + 6.0) / 20.0). "
  3321. " For any fraction between 0.5 and 0.8 the query would also return 2.")
  3322. CODE (U"Get minimum number of singular values: 0.95")
  3323. DEFINITION (U"The returned value would be 3. The sum of first three s.v.'s divided by the sum is 0.95 (= (10.0 + 6.0 + 3.0) / 20.0)."
  3324. " For any fraction between 0.8 and 0.95 the query would also return 3.")
  3325. CODE (U"Get minimum number of singular values: 0.96")
  3326. DEFINITION (U"The returned value would be 4.")
  3327. CODE (U"Get minimum number of singular values: 0.99")
  3328. DEFINITION (U"The returned value would be 4.")
  3329. MAN_END
  3330. MAN_BEGIN (U"Sound & Pitch: Change speaker...", U"djmw", 20070722)
  3331. INTRO (U"A command to create a new Sound object with manipulated characteristics "
  3332. "from the selected @Sound and @Pitch.")
  3333. NORMAL (U"With this command you can have finer grained control over the "
  3334. "pitch than with the @@Sound: Change speaker...@ command. "
  3335. "Accurate pitch measurement determines the quality of the "
  3336. "@@overlap-add@ synthesis." )
  3337. ENTRY (U"Settings")
  3338. NORMAL (U"The settings are described in @@Sound: Change speaker...@. ")
  3339. MAN_END
  3340. MAN_BEGIN (U"Sound & Pitch: Change gender...", U"djmw", 20070722)
  3341. /* INTRO (U"Deprecated: use @@Sound & Pitch: Change speaker...@") */
  3342. NORMAL (U"A command to create a new Sound object with manipulated characteristics "
  3343. "from the selected @Sound and @Pitch.")
  3344. NORMAL (U"With this command you can have finer grained control over the "
  3345. "pitch than with the @@Sound: Change gender...@ command. "
  3346. "Accurate pitch measurement determines the quality of the "
  3347. "@@overlap-add@ synthesis." )
  3348. ENTRY (U"Settings")
  3349. NORMAL (U"The settings are described in @@Sound: Change gender...@. ")
  3350. MAN_END
  3351. MAN_BEGIN (U"Sound: Change gender...", U"djmw", 20030205)
  3352. /* INTRO (U"Deprecated: use @@Sound: Change speaker...@") */
  3353. NORMAL (U"A command to create a new @Sound with manipulated characteristics.")
  3354. ENTRY (U"Settings")
  3355. NORMAL (U"The quality of the @@overlap-add|manipulation@ depends on the pitch measurement.")
  3356. NORMAL (U"The arguments that control the pitch measurement are:")
  3357. TAG (U"##Minimum pitch (Hz)# (standard value: 75 Hz)")
  3358. DEFINITION (U"pitch candidates below this frequency will not be considered.")
  3359. TAG (U"##%Maximum pitch (Hz)# (standard value: 600 Hz)")
  3360. DEFINITION (U"pitch candidates above this frequency will be ignored.")
  3361. NORMAL (U"The arguments that control the manipulation are:")
  3362. TAG (U"##Formant shift ratio")
  3363. DEFINITION (U"determines the frequencies of the formants in the newly created "
  3364. "Sound. If this ratio equals 1 no frequency shift will occur and "
  3365. "the formant frequencies will not change. A ratio of 1.1 will change "
  3366. "a male voice to a voice with approximate female formant characteristics. "
  3367. "A ratio of 1/1.1 will change a female voice to a voice with approximate male formant "
  3368. "characteristics.")
  3369. TAG (U"##New pitch median (Hz)# (standard value: 0.0 Hz, i.e. same as original)")
  3370. DEFINITION (U"determines what the median pitch of the new Sound will be. "
  3371. "The pitch values in the newly created Sound will be calculated from the pitch "
  3372. "values in the selected Sound by multiplying them by a factor "
  3373. "%%newPitchMedian / oldPitchMedian%. This factor equals 1.0 if the default "
  3374. "value for the new pitch median (0.0) is chosen. ")
  3375. TAG (U"##Pitch range factor# (standard value: 1.0)")
  3376. DEFINITION (U"determines an %extra% scaling of the new pitch values around the %new% "
  3377. "pitch median. A factor of 1.0 means that no additional pitch modification will occur "
  3378. "(except the obvious one described above). A factor of 0.0 monotonizes the new "
  3379. "sound to the new pitch median.")
  3380. TAG (U"##Duration factor# (standard value: 1.0)")
  3381. DEFINITION (U"The factor with which the sound will be lengthened. The default is 1.0. "
  3382. "If you take a value less than 1.0, the resulting sound will be shorter than "
  3383. "the original. A value larger than 3.0 will not work.")
  3384. NORMAL (U"If you want more control over the synthesis you can supply your own "
  3385. "Pitch object and use the @@Sound & Pitch: Change gender...@ command. ")
  3386. ENTRY (U"Algorithm")
  3387. NORMAL (U"The shifting of frequencies is done via manipulation of the sampling frequency. "
  3388. "Pitch and duration changes are generated with @@overlap-add@ synthesis.")
  3389. NORMAL (U"The new pitch values are calculated in a two step process. We first multiply all "
  3390. "the pitches with the factor %%newPitchMedian / oldPitchMedian% according to:")
  3391. FORMULA (U"%newPitch = %pitch * %newPitchMedian / %oldPitchMedian.")
  3392. NORMAL (U"It follows that if the %newPitchMedian equals the %oldPitchMedian no "
  3393. "change in pitch values will occur in the first step.")
  3394. NORMAL (U"Subsequently, the pitch range scale factor determines the final pitch values "
  3395. "in the following linear manner:")
  3396. FORMULA (U"%finalPitch = %newPitchMedian + (%newPitch \\-- %newPitchMedian) * %pitchRangeScaleFactor")
  3397. NORMAL (U"Hence, it follows that no further scaling occurs if %pitchRangeScaleFactor "
  3398. "equals 1.0.")
  3399. MAN_END
  3400. MAN_BEGIN (U"Sound: Change speaker...", U"djmw", 20080515)
  3401. INTRO (U"A command to create a new @Sound with manipulated characteristics.")
  3402. ENTRY (U"Settings")
  3403. NORMAL (U"The quality of the @@overlap-add|manipulation@ depends on the pitch measurement.")
  3404. NORMAL (U"The arguments that control the pitch measurement are:")
  3405. TAG (U"##Pitch floor (Hz)# (standard value: 75 Hz)")
  3406. DEFINITION (U"pitch candidates below this frequency will not be considered.")
  3407. TAG (U"##Pitch ceiling (Hz)# (standard value: 600 Hz)")
  3408. DEFINITION (U"pitch candidates above this frequency will be ignored.")
  3409. NORMAL (U"The arguments that control the manipulation are:")
  3410. TAG (U"##Multiply formants by")
  3411. DEFINITION (U"determines the formant frequencies of the newly created sound. "
  3412. "The formant frequency of the new sound will equal the formant frequencies of the selected sound multiplied by this number. "
  3413. "If this number equals 1, formant frequencies will not change. A number of 1.1 will change "
  3414. "a male voice to a voice with approximate female formant characteristics. "
  3415. "A ratio of 1/1.1 will change a female voice to a voice with approximate male formant "
  3416. "characteristics.")
  3417. TAG (U"##Multiply pitch by")
  3418. DEFINITION (U"determines what the pitch of the new Sound will be. "
  3419. "The pitch values of the new sound will equal the pitch values of the selected sound multiplied by this number. A value of 1.8 will approximately change a male's pitch to a female's pitch.")
  3420. TAG (U"##Multiply pitch range by# (standard value: 1.0)")
  3421. DEFINITION (U"determines the pitch range of the newly created sound. "
  3422. "A factor of 1.0 means that no additional pitch modification will occur "
  3423. "(except the obvious one described above). A factor of 0.0 monotonizes the new "
  3424. "sound to the new pitch median. A negative number inverses the pitch range with respect to the median.")
  3425. TAG (U"##Multiply duration by# (standard value: 1.0)")
  3426. DEFINITION (U"determines how to modify the duration of the newly created sound. "
  3427. "A value of 1.0 means that the new sound will have the same duration as the selected sound. "
  3428. "A value less than 1.0 will result in a shortened new sound. A value larger than 2.5 will not work.")
  3429. NORMAL (U"If you want more control over the synthesis you can supply your own "
  3430. "Pitch object and use the @@Sound & Pitch: Change speaker...@ command. ")
  3431. ENTRY (U"Algorithm")
  3432. NORMAL (U"The shifting of formant frequencies is done via manipulation of the sampling frequency. "
  3433. "To multiply all formants by a factor of 1.10 (i.e. raising them by 10 percent), a sampling "
  3434. "frequency of 44100 Hz is first raised to 48510 Hz (without changing "
  3435. "the samples). After this, the sound is lengthened by a factor of 1.10 "
  3436. "and the pitch is lowered by a factor of 1.10, so that the original "
  3437. "duration and pitch are restored. After this, the sound is resampled "
  3438. "to 44100 Hz (by sinc interpolation)."
  3439. "Pitch and duration changes are generated with @@overlap-add@ synthesis.")
  3440. MAN_END
  3441. MAN_BEGIN (U"Sound: Remove noise...", U"djmw", 20121122)
  3442. INTRO (U"A command to suppress noise in the selected @Sound.")
  3443. ENTRY (U"Settings")
  3444. SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (5), U""
  3445. Manual_DRAW_SETTINGS_WINDOW ("Sound: Remove noise...", 5)
  3446. Manual_DRAW_SETTINGS_WINDOW_RANGE(U"Noise time range (s)", U"0.0", U"0.0")
  3447. Manual_DRAW_SETTINGS_WINDOW_FIELD(U"Window length (s)", U"0.025")
  3448. Manual_DRAW_SETTINGS_WINDOW_RANGE(U"Filter frequency range (Hz)", U"80.0", U"10000.0")
  3449. Manual_DRAW_SETTINGS_WINDOW_FIELD(U"Smoothing (Hz)", U"40.0")
  3450. Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU(U"Noise reduction method", U"Spectral subtraction")
  3451. )
  3452. TAG (U"##Noise time range (s)")
  3453. DEFINITION (U"the start and end time of a noise part in the sound whose characteristics will be used in the denoising. "
  3454. "If the end time is chosen before the start time, the noise fragment will be chosen automatically around a position "
  3455. "where the intensity is minimal. For good noise suppression it is important that the noise fragment's duration is chosen "
  3456. "several times the length of the window.")
  3457. TAG (U"##Window length (s)")
  3458. DEFINITION (U"denoising takes place in (overlapping) windows of this length.")
  3459. TAG (U"##Filter frequency range (Hz)")
  3460. DEFINITION (U"before denoising the sound will be @@Sound: Filter (pass Hann band)...|band-pass filtered@. ")
  3461. TAG (U"##Noise reduction method")
  3462. DEFINITION (U"The method of %%spectral subtraction% was defined in @@Boll (1979)@. The variant implemented is modeled "
  3463. "after a script by Ton Wempe.")
  3464. MAN_END
  3465. MAN_BEGIN (U"Sound: Draw where...", U"djmw", 20170829)
  3466. INTRO (U"A command to draw only those parts of a @Sound where a condition holds.")
  3467. ENTRY (U"Settings")
  3468. SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (5), U""
  3469. Manual_DRAW_SETTINGS_WINDOW ("Sound: Draw where...", 5)
  3470. Manual_DRAW_SETTINGS_WINDOW_RANGE("Time range (s)", "0.0", "0.0 (= all)")
  3471. Manual_DRAW_SETTINGS_WINDOW_RANGE ("Vertical range", "0.0", "0.0 (= all)")
  3472. Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("Garnish", 1)
  3473. Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU("Drawing method", "Curve")
  3474. Manual_DRAW_SETTINGS_WINDOW_TEXT ("Draw only those parts where the following condition holds",
  3475. "x < xmin + (xmax - xmin) / 2; first half")
  3476. )
  3477. TAG (U"##Time range (s)")
  3478. DEFINITION (U"selects the time domain for the drawing.")
  3479. TAG (U"##Vertical range")
  3480. DEFINITION (U"defines the vertical limits; larger amplitudes will be clipped.")
  3481. TAG (U"##Draw only those parts where the following condition holds#")
  3482. DEFINITION (U"determines the part of the sound that will be drawn. All parts where the formula evaluates to true will be drawn. "
  3483. "This formula may ##not# contain references to the sampling of the sound, i.e. don't use 'col', 'x1', 'dx' and 'ncol' in it.")
  3484. ENTRY (U"Example 1")
  3485. NORMAL (U"The following script draws all amplitudes larger than one in red.")
  3486. CODE (U"Create Sound from formula: \"s\", \"Mono\", 0, 1, 2000, ~ 1.8*sin(2*pi*5*x)+randomGauss(0,0.1)")
  3487. CODE (U"Colour: \"Red\"")
  3488. CODE (U"Draw where: 0, 0, -2, 2, \"no\", \"Curve\", ~ abs(self)>1")
  3489. CODE (U"Colour: \"Black\"")
  3490. CODE (U"Draw where: 0, 0, -2, 2, \"yes\", \"Curve\", ~ not (abs(self)>1)")
  3491. SCRIPT (8, 3,
  3492. U"Create Sound from formula: \"s\", \"Mono\", 0, 1, 2000, ~ 1.8*sin(2*pi*5*x)+randomGauss(0,0.1)\n"
  3493. "Colour: \"Red\"\n"
  3494. "Draw where: 0, 0, -2, 2, \"no\", \"Curve\", ~ abs(self)>1\n"
  3495. "Colour: \"Black\"\n"
  3496. "Draw where: 0, 0, -2, 2, \"yes\", \"Curve\", ~ not (abs(self)>1)\n"
  3497. "Remove\n"
  3498. )
  3499. ENTRY (U"Example 2")
  3500. NORMAL (U"Draw the second half of a sound:")
  3501. CODE (U"Draw where: 0, 0, -1, 1, \"no\", \"Curve\", ~ x > xmin + (xmax - xmin) / 2")
  3502. ENTRY (U"Example 3")
  3503. NORMAL (U"Draw only positive amplitudes:")
  3504. CODE (U"Draw where: 0, 0, -1, 1, \"no\", \"Curve\", ~ self > 0")
  3505. ENTRY (U"Example 4")
  3506. NORMAL (U"Draw parts where pitch is larger than 300 Hz in red:")
  3507. CODE (U"s = selected (\"Sound\")")
  3508. CODE (U"p = To Pitch: 0, 75, 600")
  3509. CODE (U"pt = Down to PitchTier")
  3510. CODE (U"selectObject: s")
  3511. CODE (U"Colour: ~ Red")
  3512. CODE (U"Draw where: 0, 0, -1, 1, \"yes\", \"Curve\", ~ object (pt, x) > 300")
  3513. CODE (U"Colour: ~ Black")
  3514. CODE (U"Draw where: 0, 0, -1, 1, \"yes\", \"Curve\", ~ not (object (pt, x) > 300)")
  3515. MAN_END
  3516. MAN_BEGIN (U"Sound: Fade in...", U"djmw", 20170829)
  3517. INTRO (U"A command to gradually increase the amplitude of a selected @Sound.")
  3518. ENTRY (U"Settings")
  3519. TAG (U"##Channel")
  3520. DEFINITION (U"determines whether you want to fade all channels or only a selected channel.")
  3521. TAG (U"##Time (s)")
  3522. DEFINITION (U"determines where the fade-in will take place. If %time is earlier than the start time of the sound, the start time of the sound wil be used.")
  3523. TAG (U"##Fade time (s)")
  3524. DEFINITION (U"determines the start point and the endpoint of the fade-in with respect to the %time argument. Depending on the sign of %%fadeTime%, %time is either the start or the end position of the fade-in. If %%fadeTime% is positive, fade-in will take place between %%time% and %%time+fadeTime%. If %%fadeTime% is negative, fade-in wil take place between %%time+fadeTime% and %time.")
  3525. TAG (U"##Silent from start")
  3526. DEFINITION (U"when on, makes the sound silent before the fade-in starts. "
  3527. "When off, the sound before the fade-in starts will not be changed. ")
  3528. ENTRY (U"Algorithm")
  3529. NORMAL (U"Multiplication with the first half period of a (1-cos(x))/2 function. ")
  3530. ENTRY (U"Cross-fading two sounds")
  3531. NORMAL (U"The following script cross-fades two sounds s1 and s2 at time 1 second and leaves the result in s2.")
  3532. CODE1 (U"crossFTime = 0.5")
  3533. CODE1 (U"t = 1")
  3534. CODE1 (U"s = Create Sound from formula: \"s1\", 1, 0, 2, 44100, ~ sin(2*pi*500*x)")
  3535. CODE1 (U"Fade out: 0, t-crossFTime/2, crossFTime, \"yes\"")
  3536. CODE1 (U"Create Sound from formula: \"s2\", 1, 0, 2, 44100, ~ sin(2*pi*1000*x)")
  3537. CODE1 (U"Fade in.: 0, t-crossFTime/2, crossFTime, \"yes\"")
  3538. CODE1 (U"Formula: ~ self + object [s]")
  3539. MAN_END
  3540. MAN_BEGIN (U"Sound: Fade out...", U"djmw", 20121010)
  3541. INTRO (U"A command to gradually decrease the amplitude of a selected @Sound.")
  3542. ENTRY (U"Settings")
  3543. TAG (U"##Channel")
  3544. DEFINITION (U"determines whether you want to fade all channels or only a selected channel.")
  3545. TAG (U"##Time (s)")
  3546. DEFINITION (U"determines where the fade-out will take place. If %time is later than the end time of the sound, the end time of the sound wil be used.")
  3547. TAG (U"##Fade time (s)")
  3548. DEFINITION (U"determines the start point and the endpoint of the fade-out with respect to the %time argument. Depending on the sign of %%fadeTime%, %time is either the start or the end position of the fade-out. If %%fadeTime% is positive, fade-out will take place between %%time% and %%time+fadeTime%. If %%fadeTime% is negative, fade-out wil take place between %%time+fadeTime% and %time.")
  3549. TAG (U"##Silent to end")
  3550. DEFINITION (U"Make the sound silent after the fade-out finishes. ")
  3551. ENTRY (U"Algorithm")
  3552. NORMAL (U"Multiplication with the first half period of a (1+cos(%%x%))/2 function.")
  3553. MAN_END
  3554. MAN_BEGIN (U"Sound: Filter (gammatone)...", U"djmw", 20170829)
  3555. INTRO (U"A command to filter a Sound by a fourth order gammatone bandpass filter.")
  3556. ENTRY (U"Settings")
  3557. TAG (U"##Centre frequency (Hz)#, ##Bandwidth (Hz)#")
  3558. DEFINITION (U"determine the passband of the filter.")
  3559. ENTRY (U"Algorithm")
  3560. NORMAL (U"The impulse response of the filter is a 4-th order @@gammatone@. The "
  3561. "filter is implemented as the convolution of the gammatone with the sound. "
  3562. "The gain of the filter is scaled to unity at the centre frequency.")
  3563. ENTRY (U"Remark")
  3564. NORMAL (U"The old implementation with a simple 8-th order recursive digital filter with "
  3565. "4 zeros and 8 poles (these 8 poles consist of one conjugate pole pair to the "
  3566. "4-th power) as suggested by @@Slaney (1993)@ was not stable for low frequencies. ")
  3567. MAN_END
  3568. MAN_BEGIN (U"Sound: Play as frequency shifted...", U"djmw", 20140106)
  3569. INTRO (U"Plays the selected @Sound with all frequencies shifted by the same amount. This trick can be used to make "
  3570. "audible those sounds that are normally not audible at all by human beings, like for example ultrasounds or infrasounds.")
  3571. ENTRY (U"Settings")
  3572. TAG (U"##Shift by (Hz)")
  3573. DEFINITION (U"the amount by which frequencies are shifted. A positive number shifts frequencies up, a negative number "
  3574. "shifts frequencies down. ")
  3575. ENTRY (U"##Example")
  3576. NORMAL (U"Rodents produce sounds with frequencies far outside the human audible range. Some meaningfull sqeeks of these animals "
  3577. "are present in the frequency range from 54 kHz up to sometimes 100kHz. By choosing a shift value of -54000 Hz and a sampling "
  3578. "frequency of 44100 Hz, all frequencies between 54000 Hz and (54000+22050=) 76050 Hz will be shifted down by 54000 Hz. The "
  3579. "rodents frequencies in the interval from 54000 Hz to 76050 Hz will theredore be mapped to the frequency interval between 0 and 22050 Hz. ")
  3580. MAN_END
  3581. MAN_BEGIN (U"Sound: To BarkSpectrogram...", U"djmw", 20141023)
  3582. INTRO (U"A command that creates a @BarkSpectrogram object from every selected "
  3583. "@Sound object by @@band filtering in the frequency domain@ with a "
  3584. "bank of filters.")
  3585. NORMAL (U"The auditory filter functions used are defined as:")
  3586. FORMULA (U"10 log %#H(%z) = 7 - 7.5 * (%z__%c_ - %z - 0.215) - 17.5 * \\Vr "
  3587. "(0.196 + (%z__%c_ - %z - 0.215)^2)")
  3588. NORMAL (U"where %z__%c_ is the central (resonance) frequency of the filter in Bark. "
  3589. "The bandwidths of these filters are constant and equal 1 Bark. ")
  3590. NORMAL (U"The auditory filters are defined in @@Sekey & Hanson (1984)@. You can draw these filters from "
  3591. "a BarkSpectrogram object by selecting @@BarkSpectrogram: Draw Sekey-Hanson auditory filters...@.")
  3592. MAN_END
  3593. MAN_BEGIN (U"Sound: To FormantFilter...", U"djmw", 20141024)
  3594. INTRO (U"A #deprecated command that creates a @FormantFilter object from every selected @Sound object by "
  3595. "@@band filtering in the frequency domain@ with a bank of filters whose bandwidths depend on the pitch of the signal.")
  3596. NORMAL (U"The analysis proceeds in two steps:")
  3597. LIST_ITEM (U"1. We perform a pitch analysis (see @@Sound: To Pitch...@ for details).")
  3598. LIST_ITEM (U"2. We perform a filter bank analysis on a linear frequency scale. The bandwidth of the filters depends on "
  3599. "the measured pitch (see @@Sound & Pitch: To Spectrogram...@ for details).")
  3600. MAN_END
  3601. MAN_BEGIN (U"Sound: To Spectrogram (pitch-dependent)...", U"djmw", 20141024)
  3602. INTRO (U"A command that creates a @Spectrogram object from every selected "
  3603. "@Sound object by @@band filtering in the frequency domain@ with a "
  3604. "bank of formant filters whose bandwidths vary with the local pitch of the signal.")
  3605. NORMAL (U"The analysis proceeds in two steps:")
  3606. LIST_ITEM (U"1. We perform a pitch analysis (see @@Sound: To Pitch...@ for details).")
  3607. LIST_ITEM (U"2. We perform a filter bank analysis on a linear frequency scale. "
  3608. "The bandwidth of the filters depends on the measured pitch (see @@Sound & Pitch: To Spectrogram...@ for details).")
  3609. MAN_END
  3610. MAN_BEGIN (U"Sound: Paint where...", U"djmw", 20170829)
  3611. INTRO (U"A command to paint only those parts of a @Sound where a condition holds. The painted area is the area "
  3612. "between the Sound and a horizontal line at a certain level.")
  3613. ENTRY (U"Settings")
  3614. SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (6), U""
  3615. Manual_DRAW_SETTINGS_WINDOW ("Sound: Paint where...", 6)
  3616. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Colour (0-1, name, {r,g,b})", "0.5")
  3617. Manual_DRAW_SETTINGS_WINDOW_RANGE("Time range (s)", "0.0", "0.0 (= all)")
  3618. Manual_DRAW_SETTINGS_WINDOW_RANGE ("Vertical range", "0.0", "0.0 (= all)")
  3619. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Fill from level", "0")
  3620. Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("Garnish", 1)
  3621. Manual_DRAW_SETTINGS_WINDOW_TEXT ("Paint only those parts where the following condition holds",
  3622. "1; always")
  3623. )
  3624. TAG (U"##Colour")
  3625. DEFINITION (U"defines the @@Colour|colour@ of the paint.")
  3626. TAG (U"##Time range (s)")
  3627. DEFINITION (U"selects the time domain for the drawing.")
  3628. TAG (U"##Vertical range")
  3629. DEFINITION (U"defines the vertical limits; larger amplitudes will be clipped.")
  3630. TAG (U"##Fill from level")
  3631. DEFINITION (U"defines the level of the horizontal line. ")
  3632. TAG (U"##Formula")
  3633. DEFINITION (U"determines the part of the sound that will be painted. All parts where the formula evaluates to true will be painted. "
  3634. "This formula may ##not# contain references to the sampling of the sound, i.e. don't use 'col', 'x1', 'dx' and 'ncol' in it.")
  3635. ENTRY (U"Example 1")
  3636. NORMAL (U"The following script paints the area under a sine curve in red and the area above in green."
  3637. "For the first paint the horizontal line is at y=-1, for the second paint the line is at y=+1. "
  3638. "The formula always evaluates to true.")
  3639. CODE (U"s = Create Sound from formula: \"s\", 1, 0, 1, 10000, ~ 0.5*sin(2*pi*5*x)")
  3640. CODE (U"Paint where: \"Red\", 0, 0, -1, 1, -1, \"yes\", ~ 1")
  3641. CODE (U"Paint where: \"Green\", 0, 0, -1, 1, 1, \"no\", ~ 1 ")
  3642. SCRIPT (8, 5,
  3643. U"s = Create Sound from formula: \"s\", 1, 0, 1, 10000, ~ 0.5*sin(2*pi*5*x)\n"
  3644. "Paint where: \"Red\", 0, 0, -1, 1, -1, \"no\", ~ 1\n"
  3645. "Paint where: \"Green\", 0, 0, -1, 1, 1, \"yes\", ~ 1\n"
  3646. "Remove\n")
  3647. ENTRY (U"Example 2")
  3648. NORMAL (U"The following script paints the area below zero in red and the area above in green."
  3649. "The horizontal line is now always at y=0 and we use the formula to differentiate the areas.")
  3650. CODE (U"s = Create Sound from formula: \"s\", 1, 0, 1, 10000, ~ 0.5*sin(2*pi*5*x)")
  3651. CODE (U"Paint where: \"Red\", 0, 0, -1, 1, 0, \"no\", ~ self > 0")
  3652. CODE (U"Paint where: \"Green\", 0, 0, -1, 1, 0, \"yes\", ~ self < 0")
  3653. SCRIPT (8, 5,
  3654. U"s = Create Sound from formula: \"s\", 1, 0, 1, 10000, ~ 0.5*sin(2*pi*5*x)\n"
  3655. "Paint where: \"Red\", 0, 0, -1, 1, 0, \"no\", ~ self < 0\n"
  3656. "Paint where: \"Green\", 0, 0, -1, 1, 0, \"yes\", ~ self > 0\n"
  3657. "removeObject: s\n")
  3658. ENTRY (U"Example 3")
  3659. NORMAL (U"To give an indication that the area under a 1/x curve between the points %a and %b and the area "
  3660. "between %c and %d are equal if %b/%a = %d/%c. For example, for %a=1, %b=2, %c=4 and %d=8: ")
  3661. CODE (U"Create Sound from formula: \"1dx\", \"Mono\", 0, 20, 100, ~ 1.0 / x ")
  3662. CODE (U"Draw: 0, 20, 0, 1.5, \"yes\", \"Curve\"")
  3663. CODE (U"Paint where: \"Grey\", 0, 20, 0, 1.5, 0, \"yes\", ~ (x >= 1 and x < 2) or (x >= 4 and x < 8)")
  3664. CODE (U"One mark bottom: 1, \"yes\", \"yes\", \"no\", \"\"")
  3665. CODE (U"One mark bottom: 2, \"yes\", \"yes\", \"no\", \"\"")
  3666. CODE (U"One mark bottom: 4, \"yes\", \"yes\", \"no\", \"\"")
  3667. CODE (U"One mark bottom: 8, \"yes\", \"yes\", \"no\", \"\"")
  3668. SCRIPT (8, 5,
  3669. U"s = Create Sound from formula: \"1dx\", \"Mono\", 0, 20, 100, ~ 1.0 / x\n"
  3670. "Draw: 0, 20, 0, 1.5, \"yes\", \"Curve\"\n"
  3671. "Paint where: \"Grey\", 0, 20, 0, 1.5, 0, \"yes\", ~ (x >= 1 and x < 2) or (x >= 4 and x < 8)\n"
  3672. "One mark bottom: 1, \"yes\", \"yes\", \"no\", \"\"\n"
  3673. "One mark bottom: 2, \"yes\", \"yes\", \"no\", \"\"\n"
  3674. "One mark bottom: 4, \"yes\", \"yes\", \"no\", \"\"\n"
  3675. "One mark bottom: 8, \"yes\", \"yes\", \"no\", \"\"\n"
  3676. "removeObject: s\n")
  3677. MAN_END
  3678. MAN_BEGIN (U"Sounds: Paint enclosed...", U"djmw", 20170829)
  3679. INTRO (U"Paints the area between the two selected @@Sound@s. ")
  3680. ENTRY (U"Settings")
  3681. SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (4), U""
  3682. Manual_DRAW_SETTINGS_WINDOW ("Sounds: Paint enclosed", 4)
  3683. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Colour (0-1, name, {r,g,b})", "0.5")
  3684. Manual_DRAW_SETTINGS_WINDOW_RANGE("Time range (s)", "0.0", "0.0 (= all)")
  3685. Manual_DRAW_SETTINGS_WINDOW_RANGE ("Vertical range", "0.0", "0.0 (= all)")
  3686. Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("Garnish", 1)
  3687. )
  3688. TAG (U"##Colour")
  3689. DEFINITION (U"defines the @@Colour|colour@ of the paint.")
  3690. TAG (U"##Time range (s)")
  3691. DEFINITION (U"selects the time domain for the drawing.")
  3692. TAG (U"##Vertical range")
  3693. DEFINITION (U"defines the vertical limits, larger amplitudes will be clipped.")
  3694. ENTRY (U"Example")
  3695. NORMAL (U"The following script paints the area enclosed between a sine tone of 5 Hz and the straight line %y = %x/2.")
  3696. CODE (U"s1 = Create Sound from formula: \"sine\", \"Mono\", 0, 1, 10000, ~ 1/2 * sin(2*pi*5*x)\"")
  3697. CODE (U"s2 = Create Sound from formula: \"line\", \"Mono\", 0, 1, 10000, ~ x / 2")
  3698. CODE (U"plusObject (s1)")
  3699. CODE (U"Paint enclosed: \"Grey\", 0, 0, -1, 1, ~ yes")
  3700. SCRIPT ( 4, 2,
  3701. U"s1 = Create Sound from formula: \"sine\", \"Mono\", 0, 1, 10000, ~ 1/2 * sin(2*pi*5*x)\n"
  3702. "s2 = Create Sound from formula: \"line\", \"Mono\", 0, 1, 10000, ~ x / 2\n"
  3703. "selectObject: s1, s2\n"
  3704. "Paint enclosed: \"Grey\", 0, 0, -1, 1, \"yes\"\n"
  3705. "removeObject: s1, s2\n")
  3706. MAN_END
  3707. MAN_BEGIN (U"Sound: To Polygon...", U"djmw", 20170829)
  3708. INTRO (U"A command that creates a @@Polygon@ from a selected @@Sound@, where the Polygon's "
  3709. " points are defined by the (%time, %amplitude) pairs of the sound. ")
  3710. ENTRY (U"Settings")
  3711. TAG (U"##Channel")
  3712. DEFINITION (U"defines which channel of the sound is used.")
  3713. TAG (U"##Time range (s)")
  3714. DEFINITION (U"defines the part of the sound whose (%time, %amplitude) pairs have to be included.")
  3715. TAG (U"##Vertical range")
  3716. DEFINITION (U"defines the vertical limits, larger amplitudes will be clipped.")
  3717. TAG (U"##Connection y-value")
  3718. DEFINITION (U"defines the y-value of the first and last point of the Polygon. This gives the opportunity to "
  3719. " draw a closed Polygon with the horizontal connection line at any position you like. ")
  3720. ENTRY (U"Example")
  3721. NORMAL (U"The following script paints the area under a sound curve in red and the area above in green.")
  3722. CODE (U"s = Create Sound from formula: \"s\", 1, 0, 1, 10000, ~ 0.5*sin(2*pi*5*x)")
  3723. CODE (U"\\# Connection y-value is at amplitude -1: area under the curve.")
  3724. CODE (U"p1 = To Polygon: 1, 0, 0, -1, 1, -1")
  3725. CODE (U"Paint: \"{1,0,0}\", 0, 0, -1, 1")
  3726. CODE (U"selectObject: s")
  3727. CODE (U"\\# Connection y-value is now at amplitude 1: area above the curve.")
  3728. CODE (U"p2 = To Polygon: 1, 0, 0, -1, 1, 1")
  3729. CODE (U"Paint: \"{0,1,0}\", 0, 0, -1, 1")
  3730. SCRIPT (4.5, 2,
  3731. U"s = Create Sound from formula: \"s\", 1, 0, 1, 10000, ~ 0.5*sin(2*pi*5*x)\n"
  3732. "p1 = To Polygon: 1, 0, 0, -1, 1, -1\n"
  3733. "Paint: \"{1,0,0}\", 0, 0, -1, 1\n"
  3734. "selectObject: s\n"
  3735. "p2 = To Polygon: 1, 0, 0, -1, 1, 1\n"
  3736. "Paint: \"{0,1,0}\", 0, 0, -1, 1\n"
  3737. "removeObject: p2, p1, s\n"
  3738. )
  3739. MAN_END
  3740. #define xxx_to_TextGrid_detectSilences_COMMON_PARAMETERS_HELP \
  3741. TAG (U"##Silence threshold (dB)") \
  3742. DEFINITION (U"determines the maximum silence intensity value in dB with respect to the maximum " \
  3743. "intensity. For example, if %imax is the maximum intensity in dB then the maximum silence " \
  3744. "intensity is calculated as %%imax - silenceThreshold%; intervals with an intensity smaller " \
  3745. "than this value are considered as silent intervals.") \
  3746. TAG (U"##Minimum silent interval duration (s)") \
  3747. DEFINITION (U"determines the minimum duration for an interval to be considered as silent. " \
  3748. "If you don't want the closure for a plosive to count as silent then use a large enough value.") \
  3749. TAG (U"##Minimum sounding interval duration (s)") \
  3750. DEFINITION (U"determines the minimum duration for an interval to be ##not# considered as silent. " \
  3751. "This offers the possibility to filter out small intense bursts of relatively short duration.") \
  3752. TAG (U"##Silent interval label") \
  3753. DEFINITION (U"determines the label for a silent interval in the TextGrid.") \
  3754. TAG (U"##Sounding interval label") \
  3755. DEFINITION (U"determines the label for a sounding interval in the TextGrid.")
  3756. MAN_BEGIN (U"Sound: To TextGrid (silences)...", U"djmw", 20160406)
  3757. INTRO (U"A command that creates a @TextGrid in which the silent and sounding intervals of the selected @Sound are marked.")
  3758. ENTRY (U"Settings")
  3759. xxx_to_TextGrid_detectSilences_COMMON_PARAMETERS_HELP
  3760. ENTRY (U"Algorithm")
  3761. NORMAL (U"First a copy of the sound is @@Sound: Filter (pass Hann band)...|bandpass filtered@ between 80 and 8000 Hz to "
  3762. "remove especially the low frequency noise that can have a significant influence on the intensity measurement but does not "
  3763. "really contribute to the sound. Next the @@Sound: To Intensity...|intensity of the filtered sound@ is determined. "
  3764. "Finally the silent and sounding intervals are determined @@Intensity: To TextGrid (silences)...|from the intensity curve@.")
  3765. MAN_END
  3766. MAN_BEGIN (U"Intensity: To TextGrid (silences)...", U"djmw", 20061201)
  3767. INTRO (U"A command that creates a @TextGrid in which the silent and sounding intervals of the selected @Intensity are marked.")
  3768. ENTRY (U"Settings")
  3769. xxx_to_TextGrid_detectSilences_COMMON_PARAMETERS_HELP
  3770. ENTRY (U"Algorithm")
  3771. NORMAL (U"First the intensity contour is evaluated and the intervals above and below the silence threshold are marked as "
  3772. "%sounding and %silent. "
  3773. "We then remove sounding intervals with a duration smaller than the %%Minimum sounding interval duration%. "
  3774. "This step is followed by joining the neighbouring silent intervals that resulted because of this removal. "
  3775. "Finally we remove silent intervals with a duration smaller than the %%Minimum silent interval duration%. "
  3776. "This is followed by joining the neighbouring sounding intervals that resulted because of this removal.")
  3777. NORMAL (U"Experience showed that first removing short intensity bursts instead of short silences gave better results than doing it the other way around.")
  3778. ENTRY (U"Important")
  3779. NORMAL (U"The effectiveness of the %%Minimum silent interval duration% and %%Minimum sounding interval duration% "
  3780. "depends on the effective analysis window duration that was used to determine the intensity contour. "
  3781. "For example, if you have chosen 100 Hz for the \"Minimum pitch\" parameter in the @@Sound: To Intensity...@ analysis, "
  3782. "the effective analysis window duration was 32 ms. Don't expect to find sounding "
  3783. "or silent intervals with a duration smaller than this effective analysis window duration.")
  3784. MAN_END
  3785. MAN_BEGIN (U"Sound: Trim silences...", U"djmw", 20120323)
  3786. INTRO (U"A command that creates from the selected @Sound a new sound in which all silence durations are not longer than a specified value.")
  3787. ENTRY (U"Settings")
  3788. TAG (U"%%Trim duration (s)%,")
  3789. DEFINITION (U"specifies the maximum allowed silence duration.")
  3790. TAG (U"%%Minimum pitch (Hz)%, and, %Time step (s)%,")
  3791. DEFINITION (U"determine how we measure the intensities on which the determination of silent intervals is based. See @@Sound: To Intensity...@ for more info.")
  3792. TAG (U"%%Silence threshold (dB)%, %%Minimum silent interval duration (s)%, and %%Minimum sounding interval duration%,")
  3793. DEFINITION (U"determine how the silent intervals will be determined. See @@Intensity: To TextGrid (silences)...@ for more info.")
  3794. TAG (U"%%Save trimming info as TextGrid%,")
  3795. DEFINITION (U"determines if a TextGrid with trimming information will also be created. The TextGrid will have one tier where interval of the %%originating% sound that were trimmed have been labeled. ")
  3796. TAG (U"%%Trim label%,")
  3797. DEFINITION (U"determines the label that the trimmed intervals in the TextGrid will get.")
  3798. MAN_END
  3799. MAN_BEGIN (U"Sound & Pitch: To Spectrogram...", U"djmw", 20141024)
  3800. INTRO (U"A command that creates a @Spectrogram object from the selected "
  3801. "@Sound and @Pitch objects by @@band filtering in the frequency domain@ with a "
  3802. "bank of filters whose bandwidths depend on the local pitch.")
  3803. NORMAL (U"The filter functions used are:")
  3804. FORMULA (U"%#H(%f, %F__0_) = 1 / (((%f__%c_^^2^ - %f^2) /%f\\.c%B(%F__0_)))^2 + 1),")
  3805. NORMAL (U"where %f__%c_ is the central (resonance) frequency of the filter. "
  3806. "%B(%F__0_) is the bandwidth in Hz and determined as")
  3807. FORMULA (U"%B(%F__0_) = %relativeBandwidth\\.c%F__0_, ")
  3808. NORMAL (U"where %F__0_ is the fundamental frequency as determined from the Pitch "
  3809. "object. Whenever the value of %F__0_ is undefined, a value of 100 Hz is taken.")
  3810. MAN_END
  3811. MAN_BEGIN (U"Sound: To MelFilter...", U"djmw", 20141022)
  3812. INTRO (U"A deprecated command. Use @@Sound: To MelSpectrogram...@ instead.")
  3813. MAN_END
  3814. MAN_BEGIN (U"Sound: To MelSpectrogram...", U"djmw", 20141022)
  3815. INTRO (U"A command that creates a @MelSpectrogram object from every selected "
  3816. "@Sound object by @@band filtering in the frequency domain@ with a "
  3817. "set of triangular filters.")
  3818. NORMAL (U"The filter functions used are all triangular in shape on a %mel "
  3819. "frequency scale. Each filter function depends on three parameters, the "
  3820. "lower frequency %f__%l_, the central frequency %f__%c_ and the higher "
  3821. "frequency %f__%h_. "
  3822. "On a %mel scale, the distances %f__%c_-%f__%l_ and %f__%h_-%f__%c_ "
  3823. "are equal for each filter. The filter function is as follows:" )
  3824. FORMULA (U"%#H(%f) = 0 for %f \\<_ %f__%l_ and %f \\>_ %f__%h_")
  3825. FORMULA (U"%#H(%f) = (%f - %f__%l_) / (%f__%c_ - %f__%l_) for %f__%l_ \\<_ %f \\<_ %f__%c_")
  3826. FORMULA (U"%#H(%f) = (%f__%h_ - %f) / (%f__%h_ - %f__%c_) for %f__%c_ \\<_ %f \\<_ %f__%h_")
  3827. NORMAL (U"In general the number of filter values stored in each frame of the MelSpectrogram is an order of magnitude smaller than the number of sound samples in the corresponding analysis frame.")
  3828. MAN_END
  3829. MAN_BEGIN (U"Sound: To Pitch (shs)...", U"djmw", 19970402)
  3830. INTRO (U"A command that creates a @Pitch object from every selected @Sound object.")
  3831. ENTRY (U"Purpose")
  3832. NORMAL (U"to perform a pitch analysis based on a spectral compression model. "
  3833. "The concept of this model is that each spectral component not only activates "
  3834. "those elements of the central pitch processor that are most sensitive to the "
  3835. "component's frequency, but also elements that have a lower harmonic "
  3836. "relation with this component. Therefore, when a specific element of the "
  3837. "central pitch processor is most sensitive at a frequency %f__0_, it receives "
  3838. "contributions from spectral components in the "
  3839. "signal at integral multiples of %f__0_.")
  3840. ENTRY (U"Algorithm")
  3841. NORMAL (U"The spectral compression consists of the summation of a sequence of "
  3842. "harmonically compressed spectra. "
  3843. "The abscissa of these spectra is compressed by an integral factor, the rank "
  3844. "of the compression. The maximum of the resulting sum spectrum is the "
  3845. "estimate of the pitch. Details of the algorithm can be "
  3846. "found in @@Hermes (1988)@")
  3847. ENTRY (U"Settings")
  3848. TAG (U"##Time step (s)# (standard value: 0.01 s)")
  3849. DEFINITION (U"the measurement interval (frame duration), in seconds.")
  3850. TAG (U"##Minimum pitch (Hz)# (standard value: 50 Hz)")
  3851. DEFINITION (U"candidates below this frequency will not be recruited. This parameter "
  3852. "determines the length of the analysis window.")
  3853. TAG (U"##Max. number of candidates# (standard value: 15)")
  3854. DEFINITION (U"The maximum number of candidates that will be recruited.")
  3855. TAG (U"##Maximum frequency (Hz)# (standard value: 1250 Hz)")
  3856. DEFINITION (U"higher frequencies will not be considered.")
  3857. TAG (U"##Max. number of subharmonics# (standard value: 15)")
  3858. DEFINITION (U"the maximum number of harmonics that add up to the pitch.")
  3859. TAG (U"##Compression factor# (standard value: 0.84)")
  3860. DEFINITION (U"the factor by which successive compressed spectra are multiplied before the summation.")
  3861. TAG (U"##Number of points per octave# (standard value: 48)")
  3862. DEFINITION (U"determines the sampling of the logarithmic frequency scale.")
  3863. TAG (U"##Ceiling (Hz)# (standard value: 500 Hz)")
  3864. DEFINITION (U"candidates above this frequency will be ignored.")
  3865. MAN_END
  3866. MAN_BEGIN (U"Spectra: Multiply", U"djmw", 20100318)
  3867. INTRO (U"Returns a new Spectrum object that is the product of the two selected "
  3868. "@Spectrum objects.")
  3869. MAN_END
  3870. MAN_BEGIN (U"Spectrum: Conjugate", U"djmw", 20031023)
  3871. INTRO (U"Reverses the sign of the complex part of the selected @Spectrum object(s).")
  3872. NORMAL (U"For real signals, conjugation in the spectral domain amounts to time-inversion in the time domain.")
  3873. MAN_END
  3874. MAN_BEGIN (U"Spectrum: Shift frequencies...", U"djmw", 20121028)
  3875. INTRO (U"Creates a new @Spectrum by shifting all frequencies of the selected Spectrum upwards or downwards.")
  3876. ENTRY (U"Settings")
  3877. TAG (U"##Shift by (Hz)")
  3878. DEFINITION (U"a positive value shifts the spectrum towards higher frequencies, a negative value shifts the spectrum "
  3879. "towards lower frequencies.")
  3880. TAG (U"##New maximum frequency (Hz)")
  3881. DEFINITION (U"the maximum frequency in the new Spectrum.")
  3882. TAG (U"##Precision")
  3883. DEFINITION (U"the number of neighbouring frequency points that are used in the calculation of the new frequency points. "
  3884. "The precision relates linearly to the amount of computing time needed to get the new shifted spectrum.")
  3885. MAN_END
  3886. MAN_BEGIN (U"SpeechSynthesizer", U"djmw", 20120413)
  3887. INTRO (U"The SpeechSynthesizer is one of the @@types of objects@ in Praat. It creates a speech sound from text. The actual text-to-speech synthesis is performed by the @@Espeak|eSpeak NG@ speech synthsizer and therefore our SpeechSynthsizer is merely an interface to Espeak.")
  3888. ENTRY (U"Commands")
  3889. NORMAL (U"Creation:")
  3890. LIST_ITEM (U"\\bu @@Create SpeechSynthesizer...@")
  3891. NORMAL (U"Playing:")
  3892. LIST_ITEM (U"\\bu @@SpeechSynthesizer: Play text...|Play text...@")
  3893. LIST_ITEM (U"\\bu @@SpeechSynthesizer: To Sound...|To Sound...@")
  3894. NORMAL (U"Modification:")
  3895. LIST_ITEM (U"\\bu @@SpeechSynthesizer: Set text input settings...|Set text input settings...@")
  3896. LIST_ITEM (U"\\bu @@SpeechSynthesizer: Set speech output settings...|Set speech output settings...@")
  3897. MAN_END
  3898. MAN_BEGIN (U"Create SpeechSynthesizer...", U"djmw", 20171101)
  3899. INTRO (U"Creates the @@Espeak|eSpeak NG@ speech synthesizer.")
  3900. ENTRY (U"Settings")
  3901. TAG (U"##Language#")
  3902. DEFINITION (U"determines the language of the synthesizer.")
  3903. TAG (U"##Voice variant#")
  3904. DEFINITION (U"determines which voice type the synthesizer uses (male, female or whispered voices).")
  3905. MAN_END
  3906. MAN_BEGIN (U"SpeechSynthesizer: Play text...", U"djmw", 20171101)
  3907. INTRO (U"The selected @@SpeechSynthesizer@ plays a text.")
  3908. ENTRY (U"Settings")
  3909. TAG (U"##Text#")
  3910. DEFINITION (U"is the text to be played. Text within [[ ]] is treated as phonemes codes in @@Kirshenbaum phonetic encoding@. For example, besides a text like \"This is text\", you might also input \"This [[Iz]] text\".")
  3911. MAN_END
  3912. MAN_BEGIN (U"SpeechSynthesizer: To Sound...", U"djmw", 20171101)
  3913. INTRO (U"The selected @@SpeechSynthesizer@ converts a text to the corresponding speech sound.")
  3914. ENTRY (U"Settings")
  3915. TAG (U"##Text#")
  3916. DEFINITION (U"is the text to be played. Text within [[ ]] is treated as phonemes codes in @@Kirshenbaum phonetic encoding@. For example, besides a text like \"This is text\", you might also input \"This [[Iz]] text\".")
  3917. TAG (U"##Create TextGrid with annotations#")
  3918. DEFINITION (U"determines whether, besides the sound, a @@TextGrid@ with multiple-tier annotations will appear.")
  3919. MAN_END
  3920. MAN_BEGIN (U"SpeechSynthesizer: Set text input settings...", U"djmw", 20171101)
  3921. INTRO (U"A command available in the ##Modify# menu when you select a @@SpeechSynthesizer@.")
  3922. ENTRY (U"Settings")
  3923. TAG (U"##Input text format is#")
  3924. DEFINITION (U"determines how the input text will be synthesized.")
  3925. TAG (U"##Input phoneme codes are#")
  3926. DEFINITION (U"currently only @@Kirshenbaum phonetic encoding@ is available.")
  3927. MAN_END
  3928. MAN_BEGIN (U"SpeechSynthesizer: Set speech output settings...", U"djmw", 20171102)
  3929. INTRO (U"A command available in the ##Modify# menu when you select a @@SpeechSynthesizer@.")
  3930. ENTRY (U"Settings")
  3931. TAG (U"##Sampling frequency#")
  3932. DEFINITION (U"determines how the sampling frequency of the sound.")
  3933. TAG (U"##Gap between words#")
  3934. DEFINITION (U"determines the amount of silence between words.")
  3935. TAG (U"##Pitch multiplier (0.5-2.0)#")
  3936. DEFINITION (U"determines how much the pitch will be changed. The extremes 0.5 and 2.0 represent, respectively, one octave "
  3937. "below and one octave above the default pitch. ")
  3938. TAG (U"##Pitch range multiplier (0.0-2.0)#")
  3939. DEFINITION (U"determines how much the pitch range will be scaled. A value of 0.0 means monotonous pitch while a value of 2.0 means twice the default range.")
  3940. TAG (U"##Words per minute#")
  3941. DEFINITION (U"determines the speaking rate in words per minute.")
  3942. TAG (U"##Output phoneme codes are#")
  3943. MAN_END
  3944. MAN_BEGIN (U"SpeechSynthesizer: Set speech rate from speech...", U"djmw", 20171102)
  3945. INTRO (U"A command available in the ##Modify# menu when you select a @@SpeechSynthesizer@.")
  3946. ENTRY (U"Settings")
  3947. TAG (U"##Estimate speech rate from speech#")
  3948. DEFINITION (U"determines how speech rate is chosen. This is only used for the alignment of speech with text. If on, the speech rate is estimated from the part of speech that has to be aligned. ")
  3949. MAN_END
  3950. MAN_BEGIN (U"SSCP", U"djmw", 19981103)
  3951. INTRO (U"One of the @@types of objects@ in P\\s{RAAT}.")
  3952. NORMAL (U"An object of type SSCP represents the sums of squares and cross products of "
  3953. "a multivariate data set.")
  3954. NORMAL (U"Besides the matrix part, an object of type SSCP also contains a "
  3955. "vector with centroids.")
  3956. ENTRY (U"Inside a SSCP")
  3957. NORMAL (U"With @Inspect you will see that this type contains the same "
  3958. "attributes as a @TableOfReal with the following extras:")
  3959. TAG (U"%numberOfObservations")
  3960. TAG (U"%centroid")
  3961. MAN_END
  3962. MAN_BEGIN (U"SSCP: Draw sigma ellipse...", U"djmw", 19990222)
  3963. INTRO (U"A command to draw for the selected @SSCP an ellipse that "
  3964. "covers a part of the multivariate data.")
  3965. ENTRY (U"Setting")
  3966. TAG (U"##Number of sigmas")
  3967. DEFINITION (U"determines the @@concentration ellipse|data coverage@.")
  3968. MAN_END
  3969. MAN_BEGIN (U"SSCP: Get sigma ellipse area...", U"djmw", 20000525)
  3970. INTRO (U"A command to query the selected @SSCP object for the area of a "
  3971. "sigma ellipse.")
  3972. ENTRY (U"Algorithm")
  3973. NORMAL (U"The algorithm proceeds as follows:")
  3974. LIST_ITEM (U"1. The four array elements in the SSCP-matrix that correspond to the chosen dimensions "
  3975. "are copied into a two-dimensional matrix #%S (symmetric of course).")
  3976. LIST_ITEM (U"2. The eigenvalues of #%S are determined, call them %s__1_ and %s__2_.")
  3977. LIST_ITEM (U"3. The lengths %l__%i_ of the axes of the ellipse can be obtained as the "
  3978. "square root of the %s__i_ multiplied by a scale factor: %l__%i_ = %scaleFactor \\.c "
  3979. "\\Vr (%s__%i_ ), "
  3980. "where %scaleFactor = %numberOfSigmas / \\Vr(%numberOfObservations \\-- 1).")
  3981. LIST_ITEM (U"4. The area of the ellipse will be %\\pi\\.c%l__1_\\.c%l__2_.")
  3982. MAN_END
  3983. MAN_BEGIN (U"SSCP: Get confidence ellipse area...", U"djmw", 20000525)
  3984. INTRO (U"A command to query the selected @SSCP object for the area of a "
  3985. "confidence ellipse.")
  3986. ENTRY (U"Algorithm")
  3987. NORMAL (U"The algorithm proceeds as follows:")
  3988. LIST_ITEM (U"1. The four array elements in the SSCP-matrix that correspond to the chosen dimensions "
  3989. "are copied into a two-dimensional matrix #%S (symmetric of course).")
  3990. LIST_ITEM (U"2. The eigenvalues of #%S are determined, call them %s__1_ and %s__2_.")
  3991. LIST_ITEM (U"3. The lengths %l__1_ and %l__2_ of the two axes of the ellipse can be obtained as "
  3992. "(see for example @@Johnson (1998)@, page 410): ")
  3993. FORMULA (U" %l__%i_ = %scaleFactor \\.c \\Vr (%s__%i_ ),")
  3994. LIST_ITEM (U" where")
  3995. FORMULA (U"%scaleFactor = \\Vr (%f \\.c %p \\.c (%n \\-- 1) / (%n \\.c (%n \\-- %p))),")
  3996. LIST_ITEM (U" in which %f = $$@@invFisherQ@$ (1 \\-- %confidenceLevel, %p, %n \\-- %p), "
  3997. "where %p is the numberOfRows from the SSCP object and %n the %numberOfObservations.")
  3998. LIST_ITEM (U"4. The area of the ellipse will be %\\pi\\.c%l__1_\\.c%l__2_.")
  3999. MAN_END
  4000. MAN_BEGIN (U"SSCP: Get diagonality (bartlett)...", U"djmw", 20011111)
  4001. INTRO (U"Tests the hypothesis that the selected @SSCP matrix object is "
  4002. "diagonal.")
  4003. ENTRY (U"Setting")
  4004. TAG (U"##Number of constraints")
  4005. DEFINITION (U"modifies the number of independent observations. "
  4006. "The default value is 1.")
  4007. ENTRY (U"Algorithm")
  4008. NORMAL (U"The test statistic is |#R|^^N/2^, the N/2-th power of the determinant"
  4009. " of the correlation matrix. @@Bartlett (1954)@ developed the following "
  4010. "approximation to the limiting distribution:")
  4011. FORMULA (U"\\ci^2 = -(%N - %numberOfConstraints - (2%p + 5) /6) ln |#R|")
  4012. NORMAL (U"In the formula's above, %p is the dimension of the correlation "
  4013. "matrix, %N-%numberOfConstraints is the number of independent "
  4014. "observations. Normally %numberOfConstraints would "
  4015. "equal 1, however, if the matrix has been computed in some other way, "
  4016. "e.g., from within-group sums of squares and cross-products of %k "
  4017. "independent groups, %numberOfConstraints would equal %k.")
  4018. NORMAL (U"We return the probability %\\al as ")
  4019. FORMULA (U"%\\al = chiSquareQ (\\ci^2 , %p(%p-1)/2).")
  4020. NORMAL (U"A very low %\\al indicates that it is very improbable that the "
  4021. "matrix is diagonal.")
  4022. MAN_END
  4023. MAN_BEGIN (U"SSCP: Get fraction variation...", U"djmw", 20040210)
  4024. INTRO (U"A command to ask the selected @SSCP object for the fraction "
  4025. "of the total variation that is accounted for by the selected dimension(s).")
  4026. NORMAL (U"Further details can be found in @@Covariance: Get fraction variance...@.")
  4027. MAN_END
  4028. MAN_BEGIN (U"SSCP: To CCA...", U"djmw", 20031103)
  4029. INTRO (U"A command that creates a @@CCA|canonical correlation@ object from the "
  4030. "selected @SSCP object.")
  4031. ENTRY (U"Setting")
  4032. TAG (U"##Dimension of dependent variate (ny)")
  4033. DEFINITION (U"defines a partition of the square %n x %n SSCP matrix S into the parts S__yy_ of "
  4034. "dimension %ny x %ny, S__xx_ of dimension %nx x %nx, and the parts "
  4035. "S__xy_ and S__yx_ of dimensions %nx x %ny and %ny x %nx, respectively.")
  4036. ENTRY (U"Algorithm")
  4037. NORMAL (U"The partition for the square SSCP-matrix is as follows:")
  4038. PICTURE (2.0, 2.0, drawPartionedMatrix)
  4039. NORMAL (U"The canonical correlation equations we have to solve are:")
  4040. FORMULA (U"(1) (#S__%yx_ #S__%xx_^^-1^ #S__%yx_\\'p -\\la #S__%yy_)#y = #0")
  4041. FORMULA (U"(2) (#S__%yx_\\'p #S__%yy_^^-1^ #S__%yx_ -\\la #S__%xx_)#x = #0")
  4042. NORMAL (U"where #S__%yy_ [%ny \\xx %ny] and #S__%xx_ [%nx \\xx %nx] are "
  4043. "symmetric, positive definite matrices belonging to the dependent and the "
  4044. "independent variables, respectively. ")
  4045. NORMAL (U"These two equations are not independent and we will show that both "
  4046. "equations have the same eigenvalues and that the eigenvectors #x for "
  4047. "equation (2) can be obtained from the eigenvectors #y of equation (1).")
  4048. NORMAL (U"We can solve equation (1) in several ways, however, the numerically "
  4049. "stablest algorithm is probably by performing first a Cholesky decomposition "
  4050. "of #S__xx_ and #S__yy_, followed by a @@generalized singular value "
  4051. "decomposition@. The algorithm goes as follows:")
  4052. NORMAL (U"The Cholesky decompositions (\"square roots\") of #S__yy_ and #S__xx_ are:")
  4053. FORMULA (U"#S__yy_ = #U\\'p #U and #S__xx_ = #H\\'p #H,")
  4054. NORMAL (U"where #U and H are upper triangular matrices. From these decompositions, "
  4055. "the inverse for #S__xx_^^-1^ is easily computed. Let #K be the inverse of #H, "
  4056. "then we can write: ")
  4057. FORMULA (U"#S__xx_^^-1^ = #K #K\\'p.")
  4058. NORMAL (U"We next substitute in equation (1) and rewrite as:")
  4059. FORMULA (U"((#K\\'p#S__yx_\\'p)\\'p (#K\\'p#S__yx_\\'p) - \\la #U\\'p #U)#x = 0")
  4060. NORMAL (U"This equation can be solved for eigenvalues and eigenvectors by the "
  4061. "generalized singular value decomposition because it is of the form "
  4062. "#A\\'p#A -\\la #B\\'p#B.")
  4063. NORMAL (U"Now, given the solution for equation (1) we can find the solution "
  4064. "for equation (2) by first multiplying (1) from the left with "
  4065. "#S__yx_\\'p#S__yy_^^-1^, resulting in:")
  4066. FORMULA (U"(#S__yx_\\'p#S__yy_^^-1^#S__yx_#S__xx_^^-1^#S__yx_\\'p -\\la #S__yx_\\'p) #y = 0")
  4067. NORMAL (U"Now we split of the term #S__xx_^^-1^#S__yx_\\'p and obtain:")
  4068. FORMULA (U"(#S__yx_\\'p#S__yy_^^-1^#S__yx_ - \\la #S__xx_) #S__xx_^^-1^#S__yx_\\'p #y = 0")
  4069. NORMAL (U"This equation is like equation (2) and it has therefore the same eigenvalues "
  4070. "and eigenvectors. (We also proved this fact in the algorithmic section of "
  4071. "@@TableOfReal: To CCA...@.)")
  4072. NORMAL (U"The eigenvectors #x is now")
  4073. FORMULA (U"#x = #S__xx_^^-1^#S__yx_\\'p #y.")
  4074. MAN_END
  4075. MAN_BEGIN (U"SSCP: To Covariance...", U"djmw", 20090624)
  4076. INTRO (U"A command that creates a @Covariance object from each selected @SSCP object.")
  4077. ENTRY (U"Setting")
  4078. TAG (U"##Number of constraints")
  4079. DEFINITION (U"determines the factor by which each entry in the "
  4080. "SSCP-matrix is scaled to obtain the Covariance matrix.")
  4081. ENTRY (U"Details")
  4082. NORMAL (U"The relation between the numbers %c__%ij_ in the covariance matrix and the numbers %s__%ij_ in "
  4083. "the originating SSCP matrix is:")
  4084. FORMULA (U"%c__%ij_ = %s__%ij_ / (%numberOfObservations - %numberOfConstraints)")
  4085. NORMAL (U"Normally %numberOfConstraints will equal 1. However, when the SSCP was the "
  4086. "result of summing %g SSCP objects, as is, for example, the case when you obtained the total "
  4087. "within-groups SSCP from pooling the individual group SSCP's, %numberOfConstraints will equal the number of pooled SSCP's, %g.")
  4088. MAN_END
  4089. MAN_BEGIN (U"SSCP & TableOfReal: Extract quantile range...", U"djmw", 20040225)
  4090. INTRO (U"Extract those rows from the selected @TableOfReal object whose @@Mahalanobis "
  4091. "distance@, with respect to the selected @SSCP object, are within the "
  4092. "quantile range.")
  4093. MAN_END
  4094. MAN_BEGIN (U"Create Strings as tokens...", U"djmw", 20170417)
  4095. INTRO (U"Create a new @@Strings@ object as a list of tokens.")
  4096. ENTRY (U"Settings")
  4097. TAG (U"##Text#")
  4098. DEFINITION (U"the text to be tokenized.")
  4099. TAG (U"##Separators#")
  4100. DEFINITION (U"determines the separator characters. If left empty a space will be used as a separator")
  4101. ENTRY (U"Behaviour")
  4102. NORMAL (U"Multiple consecutive separators in the text will be treated as one.")
  4103. ENTRY (U"Examples")
  4104. TAG (U"Example 1")
  4105. CODE (U"Create Strings as tokens: \"a b c\", \" \"")
  4106. DEFINITION (U"will produce a Strings object with 3 strings in it: \"a\", \"b\" and \"c\".")
  4107. TAG (U"Example 2")
  4108. CODE (U"Create Strings as tokens: \"a b c \", \" \"")
  4109. DEFINITION (U"will also produce a Strings object with 3 strings in it: \"a\", \"b\" and \"c\".")
  4110. TAG (U"Example 3")
  4111. CODE (U"Create Strings as tokens: \"a,b,c\", \",\"")
  4112. DEFINITION (U"will produce a Strings object with 3 strings in it: \"a\", \"b\" and \"c\".")
  4113. TAG (U"Example 4")
  4114. CODE (U"Create Strings as tokens: \"a, b, c\", \",\"")
  4115. DEFINITION (U"will produce a Strings object with 3 strings in it: \"a\", \" b\" and \" c\".")
  4116. TAG (U"Example 5")
  4117. CODE (U"Create Strings as tokens: \"a, b, c\", \" ,\"")
  4118. DEFINITION (U"will produce a Strings object with 3 strings in it: \"a\", \"b\" and \"c\".")
  4119. TAG (U"Example 6")
  4120. CODE (U"Create Strings as tokens: \"a,,b,c\", \" ,\"")
  4121. DEFINITION (U"will also produce a Strings object with 3 strings in it: \"a\", \"b\" and \"c\".")
  4122. TAG (U"Example 7")
  4123. CODE (U"Create Strings as tokens: \"a, ,b,c\", \",\"")
  4124. DEFINITION (U"will produce a Strings with 4 strings in it: \"a\",\" \", \"b\" and \"c\".")
  4125. TAG (U"Example 8")
  4126. CODE (U"Create Strings as tokens: \"a,b,c,\", \",\"")
  4127. DEFINITION (U"will produce a Strings object with 3 strings in it: \"a\", \"b\" and \"c\".")
  4128. TAG (U"Example 9")
  4129. CODE (U"Create Strings as tokens: \"a,b,c, \", \",\"")
  4130. DEFINITION (U"will produce a Strings object with 4 strings in it: \"a\", \"b\", \"c\" and \" \".")
  4131. TAG (U"Example 10")
  4132. CODE (U"Create Strings as tokens: \"A string\" + tab\\$ + \"of ..tokens\" + newline\\$ + \"and some more tokens\", \" .,\" + tab\\$ + newline\\$ ")
  4133. DEFINITION (U"will produce a Strings object with 8 strings in it: \"A\", \"string\", \"of\", \"tokens\", \"and\", \"some\", \"more\" and \"tokens\".")
  4134. MAN_END
  4135. MAN_BEGIN (U"T-test", U"djmw", 20020117)
  4136. INTRO (U"A test on the mean of a normal variate when the variance is unknown.")
  4137. NORMAL (U"In Praat, the t-test is used to query a @Covariance object and:")
  4138. LIST_ITEM (U"1. get the significance of one mean. See @@Covariance: Get "
  4139. "significance of one mean...@.")
  4140. LIST_ITEM (U"2. get the significance of the %difference between two means. "
  4141. "See @@Covariance: Get significance of means difference...@.")
  4142. NORMAL (U"You should use a t-test when you want to test a hypothesis about "
  4143. "the mean of one column in a @TableOfReal object, or, if you want to test "
  4144. "a hypothesis about the difference between the means of two columns in "
  4145. "this object.")
  4146. NORMAL (U"You can perform these t-tests in Praat by first transforming the "
  4147. "TableOfReal object into a Covariance object (see @@TableOfReal: To "
  4148. "Covariance@) and then choosing the appropriate query method on the "
  4149. "latter object.")
  4150. MAN_END
  4151. MAN_BEGIN (U"BHEP multivariate normality test", U"djmw", 20101124)
  4152. INTRO (U"The Baringhaus–Henze–Epps–Pulley multivariate normality test.")
  4153. NORMAL (U"According to @@Henze & Wagner (1997)@ the test has:")
  4154. LIST_ITEM (U"\\bu affine invariance,")
  4155. LIST_ITEM (U"\\bu consistency against each fixed nonnormal alternative distribution,")
  4156. LIST_ITEM (U"\\bu asymptotic power against contiguous alternatives of order \\Vr (%n),")
  4157. LIST_ITEM (U"\\bu feasibility for any dimension and any sample size.")
  4158. NORMAL (U"The test depends on a smoothing parameter %%h% that can be chosen in various ways:")
  4159. NORMAL (U"@@Henze & Wagner (1997)@ recommend %h = 1.41, while")
  4160. NORMAL (U"@@Tenreiro (2009)@ recommends %h__%%s% _= 0.448 + 0.026\\.c%d for short tailed alternatives and "
  4161. " %h__%%l%_ = 0.928 + 0.049\\.c%d for long tailed alternatives.")
  4162. MAN_END
  4163. MAN_BEGIN (U"Table: Normal probability plot...", U"djmw", 20130619)
  4164. NORMAL (U"In a normal probability plot, the data in the selected column of the @Table are plotted "
  4165. "against a normal distribution in such a way that the points should form approximately a straight line. "
  4166. "Departures from a straight line indicate departures from normality.")
  4167. ENTRY (U"Settings")
  4168. TAG (U"##Number of quantiles#")
  4169. DEFINITION (U"the number of quantile points, %n, in the plot. From this number %n, the quantile points are "
  4170. "determined as follows: the last quantile point is %q__%n_ = 0.5^^1/%n^ and the first quantile point is "
  4171. "%q__1_=1\\--%q__%n_. The intermediate quantile points %q__%i_ are determined according to "
  4172. "%q__%i_=(%i \\-- 0.3175)/(%n + 0.365), where %i runs from 2 to %n\\--1.")
  4173. TAG (U"##Number of sigmas#")
  4174. DEFINITION (U"determines the horizontal and vertical drawing ranges in units of standard deviations. ")
  4175. MAN_END
  4176. MAN_BEGIN (U"Table: Quantile-quantile plot...", U"djmw", 20130619)
  4177. NORMAL (U"In a quantile-quantile plot the quantiles of the data in the first selected column of the @Table are plotted against "
  4178. "the quantiles of the data in the second selected column. If the two sets come from a population with the "
  4179. "same distribution, the points should fall approximately along the reference line.")
  4180. MAN_END
  4181. MAN_BEGIN (U"Table: Bar plot where...", U"djmw", 20140509)
  4182. INTRO (U"Draws a bar plot from data in one or more columns of the selected @Table. In a bar plot the horizontal axis has nominal values (labels). ")
  4183. ENTRY (U"Settings")
  4184. SCRIPT (6, Manual_SETTINGS_WINDOW_HEIGHT (10), U""
  4185. Manual_DRAW_SETTINGS_WINDOW ("Table: Bar plot where", 10)
  4186. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Vertical column(s)", "")
  4187. Manual_DRAW_SETTINGS_WINDOW_RANGE("Vertical range", "0.0", "0.0 (= autoscaling)")
  4188. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Column with labels", "")
  4189. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Distance of first bar from border", "1.0")
  4190. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Distance between bar groups", "1.0")
  4191. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Distance between bars within group", "0.0")
  4192. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Colours (0-1, name, {r,g,b})", "Grey")
  4193. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Label text angle (degrees)", "0.0")
  4194. Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("Garnish", 1)
  4195. Manual_DRAW_SETTINGS_WINDOW_TEXT("Formula:", "row>1 and row < 10")
  4196. )
  4197. TAG (U"##Vertical column(s)")
  4198. DEFINITION (U"you list the table columns that you want to represent in the bar plot. The number of selected columns is the group size.")
  4199. TAG (U"##Vertical range")
  4200. DEFINITION (U"determine the lower and upper limit of the display.")
  4201. TAG (U"##Column with labels")
  4202. DEFINITION (U"determines the column whose labels will be put at the bottom of the plot.")
  4203. TAG (U"##Distance of first bar from border")
  4204. DEFINITION (U"determines how far the first (and last) bar wil be positioned from the borders (in units of the width of one bar).")
  4205. TAG (U"##Distance between bar groups")
  4206. DEFINITION (U"determines how far groups of bars are from each other. ")
  4207. TAG (U"##Distance between bars within group")
  4208. DEFINITION (U"determines the distance between the bars within each group.")
  4209. TAG (U"##Colours")
  4210. DEFINITION (U"determines the colours of the bars in a group.")
  4211. TAG (U"##Label text angle (degrees)")
  4212. DEFINITION (U"determines the angle of the labels written below the plot. If you have very long label texts you can prevent the label texts from overlapping.")
  4213. TAG (U"##Formula:")
  4214. DEFINITION (U"can be used to supply an expression to select only those rows for plotting where the expression evaluates to %%true%. A 1 value always evaluates to %%true%.")
  4215. ENTRY (U"Examples")
  4216. NORMAL (U"@@Keating & Esposito (2006)@ present a bar plot in their fig. 3 from which we estimate the following data table")
  4217. CODE (U"Language Modal Breathy")
  4218. CODE (U"Chong -1.5 5")
  4219. CODE (U"Fuzhou 2 10")
  4220. CODE (U"Green Hmong 3 12")
  4221. CODE (U"White Hmong 2 11")
  4222. CODE (U"Mon -1.5 0")
  4223. CODE (U"SADV Zapotec -6 -4")
  4224. CODE (U"SLQ Zapotec 3.5 14")
  4225. CODE (U"Tlacolula Zapotec 3 13")
  4226. CODE (U"Tamang 1 1")
  4227. CODE (U"!Xoo 1 14")
  4228. NORMAL (U"Given that we have these data in a Table with the three columns labeled \"Language\", \"Modal\" and \"Breathy\", "
  4229. "respectively, we can first try to reproduce their figure 3 (a bar plot with both Modal and Breathy columns displayed) ")
  4230. NORMAL (U"As you can see the labels in the first column are very long texts and they will surely overlap if "
  4231. "plotted at the bottom of a plot. We therefore use a value of 15 degrees for the \"Label text angle\" " "parameter. This "
  4232. "will make the label texts nonoverlapping. We cannot make this angle much larger because then the label texts will run out of "
  4233. "the viewport. ")
  4234. NORMAL (U"Sometimes you need to plot only a part of the Table and for the selection of this part, the \"Formula\" field can be "
  4235. "used. Since we only have a small table we put a \"1\" in this field which always evaluates to true. In effect, all the rows will be selected. The following script line will produce the picture below.")
  4236. CODE (U"Bar plot where: \"Modal Breathy\", -10, 20, \"Language\", 1.0, 1.0, 0.0, \"0.9 0.5\", 15.0, \"yes\", \"1\"")
  4237. SCRIPT (5, 3, U"h1h2 = Create H1H2 table (Esposito 2006)\n"
  4238. "Font size: 10\n"
  4239. "Bar plot where: \"Modal Breathy\", -10, 20, \"Language\", 1.0, 1.0, 0.0, \"0.9 0.5\", 15.0, \"yes\", \"1\"\n"
  4240. "removeObject: h1h2\n")
  4241. NORMAL (U"The essentials of the bart plot in their paper are perfectly reproduced in the figure above. If you want the bars within a group to be placed somewhat more apart say 0.2 (times the bar width) you can set the \"Distance between bars in a group\" to a value of 0.2:")
  4242. CODE (U"Bar plot where: \"Modal Breathy\", -10, 20, \"Language\", 1.0, 1.0, 0.2, \"0.9 0.5\", 15.0, \"yes\", \"1\"")
  4243. SCRIPT (5, 3, U"h1h2 = Create H1H2 table (Esposito 2006)\n"
  4244. "Font size: 10\n"
  4245. "Bar plot where: \"Modal Breathy\", -10, 20, \"Language\", 1.0, 1.0, 0.2, \"0.9 0.5\", 15.0, \"yes\", \"1\"\n"
  4246. "removeObject: h1h2\n")
  4247. NORMAL (U"Of course we can also work with colours and we can add vertical marks as the following sriptlet shows")
  4248. CODE (U"Bar plot where: \"Modal Breathy\", -10, 20, \"Language\", 1.0, 1.0, 0.0, \"Green Red\", 15.0, \"yes\", \"1\"")
  4249. CODE (U"Marks left every: 1, 5, 1, 1, 1")
  4250. CODE (U"Text left: 1, \"H__1_-H__2_ (dB)\"")
  4251. SCRIPT (5, 3, U"h1h2 = Create H1H2 table (Esposito 2006)\n"
  4252. "Font size: 10\n"
  4253. "Bar plot where: \"Modal Breathy\", -10, 20, \"Language\", 1.0, 1.0, 0.0, \"Green Red\", 15.0, \"yes\", \"1\"\n"
  4254. "Marks left every: 1, 5, 1, 1, 1\n"
  4255. "Text left: 1, \"H__1_-H__2_ (dB)\"\n"
  4256. "removeObject: h1h2\n")
  4257. MAN_END
  4258. MAN_BEGIN (U"Table: Box plots where...", U"djmw", 20140509)
  4259. INTRO (U"A command to draw @@box plot@s from the data in a column of the selected @Table object.")
  4260. ENTRY (U"Example")
  4261. NORMAL (U"To draw separate box plots for the male, female and children F0 for the @@Peterson & Barney (1952)@ data: ")
  4262. CODE (U"Create formant table (Peterson & Barney 1952)")
  4263. CODE (U"Box plots where: \"F0\", \"Type\", 70, 400, \"1\"")
  4264. CODE (U"Text left: \"yes\", \"F0 (Hz)\"")
  4265. SCRIPT (5,3, U"pb = Create formant table (Peterson & Barney 1952)\n"
  4266. "Box plots where: \"F0\", \"Type\", 70, 400, \"yes\", \"1\"\n"
  4267. "Text left: \"yes\", \"F0 (Hz)\"\n"
  4268. "removeObject: pb\n"
  4269. )
  4270. MAN_END
  4271. MAN_BEGIN (U"Table: Line graph where...", U"djmw", 20170829)
  4272. INTRO (U"Draws a line graph from the data in a column of the selected @Table. In a line plot the horizontal axis can have a nominal scale or a numeric scale. The data point are connected by line segments.")
  4273. ENTRY (U"Settings")
  4274. SCRIPT (7, Manual_SETTINGS_WINDOW_HEIGHT (8), U""
  4275. Manual_DRAW_SETTINGS_WINDOW ("Table: Line graph where", 8)
  4276. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Vertical column", "")
  4277. Manual_DRAW_SETTINGS_WINDOW_RANGE ("Vertical range", "0.0", "0.0 (= autoscaling)")
  4278. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Horizontal column", "")
  4279. Manual_DRAW_SETTINGS_WINDOW_RANGE ("Horizontal range", "0.0", "0.0 (= autoscaling)")
  4280. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Text", "+")
  4281. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Label text angle (degrees)", "0.0")
  4282. Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("Garnish", 1)
  4283. Manual_DRAW_SETTINGS_WINDOW_TEXT("Formula:", "1; (= everything)")
  4284. )
  4285. TAG (U"##Vertical column")
  4286. DEFINITION (U"The column whose data points you want to plot.")
  4287. TAG (U"##Vertical range")
  4288. DEFINITION (U"determine the lower and upper limits of the plot.")
  4289. TAG (U"##Horizontal column")
  4290. DEFINITION (U"determines the horizontal scale. If you leave it empty, or, if the (selected part of the) selected column contains nominal values, i.e. the values are not numeric but text, the horizontal "
  4291. "distance between the data points will be constant (i.e. 1) and the nominal values (texts) will be put as labels at the bottom of the horizontal axis. "
  4292. "On the other hand, if this column contains only numerical values, the horizontal position of the data points will be determined by the values in this column.")
  4293. TAG (U"##Horizontal range")
  4294. DEFINITION (U"determines the left and right limit of the plot.")
  4295. TAG (U"##Text")
  4296. DEFINITION (U"The text to put at the position of the data point in the plot.")
  4297. TAG (U"##Label text angle (degrees)")
  4298. DEFINITION (U"determines the angle of the labels written %%below% the plot. If you have very long label texts in the \"Horizontal column\", you can prevent the label texts from overlapping. This only has effect for a horizontal column with nominal values.")
  4299. TAG (U"##Formula")
  4300. DEFINITION (U"can be used to supply an expression to select only those rows for plotting where the expression evaluates to %%true%. A 1 value always evaluates to %%true%.")
  4301. ENTRY (U"Examples")
  4302. NORMAL (U"The following table was estimated from fig. 3 in @@Ganong (1980)@ and represents the fraction /d/ responses as a function of a "
  4303. "voice onset time (VOT) continuum. The second column shows the responses in a word - nonword continuum, while the third column shows "
  4304. "the responses to a nonword - word continuum.")
  4305. CODE (U"VOT dash-tash dask-task")
  4306. CODE (U"-17.5 0.98 0.92")
  4307. CODE (U" -7.5 0.95 0.83")
  4308. CODE (U" -2.5 0.71 0.33")
  4309. CODE (U" 2.5 0.29 0.10")
  4310. CODE (U" 7.5 0.12 0.02")
  4311. CODE (U" 17.5 0.10 0.02")
  4312. NORMAL (U"We can reproduce fig. 3 from Ganong (1980) with the following script, where we labeled the word - nonword curve with \"wn\" and the nonword - word curve with \"nw\". We deselect \"Garnish\" because we want to put special marks at the bottom.")
  4313. CODE (U"Dotted line\n")
  4314. CODE (U"Line graph where: \"dash-tash\", 0, 1, \"VOT\", -20, 20, \"wn\", 0, 0, \"1\"")
  4315. CODE (U"Dashed line\n")
  4316. CODE (U"Line graph where: \"dask-task\", 0, 1, \"VOT\", -20, 20, \"nw\", 0, 0, \"1\"")
  4317. CODE (U"Draw inner box")
  4318. CODE (U"One mark bottom: 2.5, 0, 1, 0, \"+2.5\"")
  4319. CODE (U"One mark bottom: -2.5, 1, 1, 0, \"\"")
  4320. CODE (U"One mark bottom: -7.5,1, 1, 0, \"\"")
  4321. CODE (U"One mark bottom: 7.5, 0, 1, 0, \"+7.5\"")
  4322. CODE (U"One mark bottom: 2.5, 0, 0, 0, \"+2.5\"")
  4323. CODE (U"One mark bottom: -20, 0, 0, 0, \"Short VOT\"")
  4324. CODE (U"One mark bottom: 20, 0, 0, 0, \"Long VOT\"")
  4325. CODE (U"Text bottom: 1, \"VOT (ms)\"")
  4326. CODE (U"Marks left every: 1, 0.2, 1, 1, 0")
  4327. CODE (U"Text left: 1, \"Prop. of voiced responses\"")
  4328. SCRIPT (5,3, U"ganong = Create Table (Ganong 1980)\n"
  4329. "Dotted line\n"
  4330. "Line graph where: \"dash-tash\", 0, 1, \"VOT\", -20, 20, \"wn\", 0, 0, ~1\n"
  4331. "Dashed line\n"
  4332. "Line graph where: \"dask-task\", 0, 1, \"VOT\", -20, 20, \"nw\", 0, 0, ~1\n"
  4333. "Draw inner box\n"
  4334. "One mark bottom: 2.5, 0, 1, 0, \"+2.5\"\n"
  4335. "One mark bottom: -2.5, 1, 1, 0, \"\"\n"
  4336. "One mark bottom: -7.5,1, 1, 0, \"\"\n"
  4337. "One mark bottom: 7.5, 0, 1, 0, \"+7.5\"\n"
  4338. "One mark bottom: 2.5, 0, 0, 0, \"+2.5\"\n"
  4339. "One mark bottom: -20, 0, 0, 0, \"Short VOT\"\n"
  4340. "One mark bottom: 20, 0, 0, 0, \"Long VOT\"\n"
  4341. "Text bottom: 1, \"VOT (ms)\"\n"
  4342. "Marks left every: 1, 0.2, 1, 1, 0\n"
  4343. "Text left: 1, \"Prop. of voiced responses\"\n"
  4344. "removeObject: ganong\n"
  4345. )
  4346. NORMAL (U"As an example of what happens if you don't supply an argument for the \"Horizontal column\" we will use the same table as for the previous plot. However the resulting plot may not be as meaningful (note that the horizontal nominal scale makes all points equidistant in the horizontal direction.)")
  4347. CODE (U"Dotted line\")\n")
  4348. CODE (U"Line graph where: \"dash-tash\", 0, 1, \"\", 0, 0, \"wn\", 0, 1, ~ 1")
  4349. CODE (U"One mark bottom: 1, 0, 1, 0, \"Short VOT\"")
  4350. SCRIPT (5,3, U"ganong = Create Table (Ganong 1980)\n"
  4351. "Dotted line\n"
  4352. "Line graph where: \"dash-tash\", 0, 1, \"\", 0, 0, \"wn\", 0, 1, ~1\n"
  4353. "One mark bottom: 1, 0, 1, 0, \"Short VOT\"\n"
  4354. "removeObject: ganong\n"
  4355. )
  4356. MAN_END
  4357. MAN_BEGIN (U"Table: Horizontal error bars plot where...", U"djmw", 20131220)
  4358. INTRO (U"Draws horizontal lines that represent the error intervals of a data column from the selected @@Table@.")
  4359. NORMAL (U"This command behaves analogous to @@Table: Vertical error bars plot where...@.")
  4360. MAN_END
  4361. MAN_BEGIN (U"Table: Horizontal error bars plot...", U"djmw", 20131220)
  4362. INTRO (U"Draws horizontal lines that represent the error intervals of a data column from the selected @@Table@.")
  4363. NORMAL (U"This command behaves analogous to @@Table: Vertical error bars plot where...@.")
  4364. MAN_END
  4365. MAN_BEGIN (U"Table: Vertical error bars plot...", U"djmw", 20131223)
  4366. INTRO (U"Draws vertical lines that represent the error intervals of a data column from the selected @@Table@.")
  4367. NORMAL (U"For more info see @@Table: Vertical error bars plot where...@")
  4368. MAN_END
  4369. MAN_BEGIN (U"Table: Vertical error bars plot where...", U"djmw", 20131223)
  4370. INTRO (U"Draws vertical lines that represent the error intervals of a data column from the selected @@Table@.")
  4371. ENTRY (U"Settings")
  4372. SCRIPT (6, Manual_SETTINGS_WINDOW_HEIGHT (9), U""
  4373. Manual_DRAW_SETTINGS_WINDOW ("Table: Vertical confidence intervals plot where", 9)
  4374. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Horizontal column", "")
  4375. Manual_DRAW_SETTINGS_WINDOW_RANGE ("Horizontal range", "0.0", "0.0 (= autoscaling)")
  4376. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Vertical column", "")
  4377. Manual_DRAW_SETTINGS_WINDOW_RANGE ("Vertical range", "0.0", "0.0 (= autoscaling)")
  4378. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Lower error value column", "")
  4379. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Upper error value column", "")
  4380. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Bar size (mm)", "1.0")
  4381. Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("Garnish", 1)
  4382. Manual_DRAW_SETTINGS_WINDOW_TEXT("Formula", "1; (= everything)")
  4383. )
  4384. TAG (U"##Horizontal column")
  4385. DEFINITION (U"determines the data along the horizontal axis.")
  4386. TAG (U"##Horizontal range")
  4387. DEFINITION (U"determines the lower and upper limits of the plot.")
  4388. TAG (U"##Vertical column")
  4389. DEFINITION (U"determines the data along the horizontal axis.")
  4390. TAG (U"##Vertical range")
  4391. DEFINITION (U"determines the lower and upper limits of the plot.")
  4392. TAG (U"##Lower error value column, Upper error value column")
  4393. DEFINITION (U"determine the size of the vertical lines that will be drawn. These lines are drawn between the points (%x,%y-%low) and (%x, %y+%up), "
  4394. "where %x and %y are the values from the %%horizontal column% and the %%vertical column%, respectively, and, %low and %up are the corresponding values "
  4395. "in the %%lower error value column% and the %%upper error value column%, respectively. If either of these column names is not given the corresponding values (%low and/or %up) will taken as zero. This makes it possible to draw one-sided and two-sided error bars. If your "
  4396. "errors are symmetric around the y-position, your table only needs one column and you can supply the name of this column in both fields.")
  4397. TAG (U"##Bar size (mm)")
  4398. DEFINITION (U"determines the width of the horizontal bars or whishers at the lower an postion of the drawn line. ")
  4399. TAG (U"##Garnish")
  4400. DEFINITION (U"determines whether or not some decoration is drawn.")
  4401. TAG (U"##Formula")
  4402. DEFINITION (U"can be used to supply an expression to select only those rows for plotting where the expression evaluates to %%true%. A 1 value always evaluates to %%true%.")
  4403. MAN_END
  4404. MAN_BEGIN (U"Table: Get median absolute deviation...", U"djmw", 20120405)
  4405. INTRO (U"Get the median absolute deviation (MAD) of the column in the selected @@Table@ (adjusted by a scale factor).")
  4406. ENTRY (U"Algorithm")
  4407. NORMAL (U"From the %n numbers %x__1_, %x__2_, ..., %x__%n_ in the selected column we first calculate the @@quantile algorithm|median@ "
  4408. "value %x__median_. Next we calculate the %n absolute deviations from this median: %d__1_, %d__2_, ..., %d__%n_, "
  4409. "where %d__%j_=|%x__%j_ - %x__median_|. "
  4410. "Then we calculate the MAD value, which is the median of the %n values %d__1_, %d__2_, ..., %d__%n_. Finally we multiply the MAD "
  4411. "value by the scale factor 1.4826. This last multiplication makes the result comparable with the value of the standard deviation if "
  4412. "the %x values are normally distributed.")
  4413. MAN_END
  4414. MAN_BEGIN (U"Table: Report one-way anova...", U"djmw", 20120617)
  4415. INTRO (U"Performs a one-way analysis of variance on the data in one column of a selected @@Table@ and reports the fixed-effects anova table results in the info window.")
  4416. ENTRY (U"Settings")
  4417. TAG (U"##Column with data#")
  4418. DEFINITION (U"the label of the column who's data will be analyzed.")
  4419. TAG (U"##Factor")
  4420. DEFINITION (U"the label of the column with the names of the levels.")
  4421. TAG (U"##Table with means")
  4422. DEFINITION (U"if checked, a Table with the mean values of the levels will be created.")
  4423. TAG (U"##Table with differences between means")
  4424. DEFINITION (U"if checked, a Table with the differences between the mean values of the levels will be created.")
  4425. TAG (U"##Table with Tukey's post-hoc test")
  4426. DEFINITION (U"if checked, a Table with Tukey's HSD tests will be created. Each value in this Table measures the probability that the corresponding difference between the level means happened by chance. The test compares all possible level means and is based on the studentized range distribution.")
  4427. MAN_END
  4428. MAN_BEGIN (U"Table: Report two-way anova...", U"djmw", 20140117)
  4429. INTRO (U"Performs a two-way analysis of variance on the data in one column of a selected %%fully factorial% @@Table@ and reports the fixed-effects anova table in the info window. ")
  4430. ENTRY (U"Settings")
  4431. TAG (U"##Column with data#")
  4432. DEFINITION (U"the label of the column who's data will be analyzed.")
  4433. TAG (U"##First factor")
  4434. DEFINITION (U"the label of the column with the names of the levels for the first factor.")
  4435. TAG (U"##Second factor")
  4436. DEFINITION (U"the label of the column with the names of the levels for the second factor.")
  4437. TAG (U"##Table with means")
  4438. DEFINITION (U"if checked, a Table with the mean values of all the levels will be created.")
  4439. ENTRY (U"Example")
  4440. NORMAL (U"Suppose you want to check if fundamental frequency depends on the type of vowel and speaker type. We will use the "
  4441. "@@Create formant table (Peterson & Barney 1952)|Peterson & Barney@ vowel data set to illustrate this. "
  4442. "The following script will first create the data set and then produce the two-way anova report." )
  4443. CODE (U"Create formant table (Peterson & Barney 1952)")
  4444. CODE (U"Report two-way anova: \"F0\", \"Vowel\", \"Type\"")
  4445. NORMAL (U"This will produce the following anova table in the info window:")
  4446. CODE (U"Two-way analysis of \"F0\" by \"Vowel\" and \"Type\".")
  4447. CODE (U"")
  4448. CODE (U" Source SS Df MS F P")
  4449. CODE (U" Vowel 73719.4 9 8191.05 7.62537 5.25258e-11")
  4450. CODE (U" Type 4.18943e+06 2 2.09471e+06 1950.05 0")
  4451. CODE (U"Vowel x Type 6714.34 18 373.019 0.347258 0.994969")
  4452. CODE (U" Error 1.60053e+06 1490 1074.18")
  4453. CODE (U" Total 5.87039e+06 1519")
  4454. NORMAL (U"The analysis shows that F0 strongly depends on the vowel and also on the speaker type and, luckily, we do not have any "
  4455. "interaction between the vowel and the speaker type. Besides the anova table there is also shown a table with the mean F0 "
  4456. "values for each Vowel-Type combination which looks like:")
  4457. CODE (U" c m w Mean")
  4458. CODE (U" aa 258 124 212 198")
  4459. CODE (U" ae 248 125 208 194")
  4460. CODE (U" ah 263 129 223 205")
  4461. CODE (U" ao 259 127 217 201")
  4462. CODE (U" eh 259 128 220 202")
  4463. CODE (U" er 264 133 219 205")
  4464. CODE (U" ih 270 136 232 213")
  4465. CODE (U" iy 270 136 231 212")
  4466. CODE (U" uh 273 136 234 214")
  4467. CODE (U" uw 278 139 235 218")
  4468. CODE (U" Mean 264 131 223 206")
  4469. NORMAL (U"The first column of this table shows the vowel codes while the first row shows the speaker types (child, man, women). "
  4470. "The last row and the last column of the table shows the averages for the factors Type and Vowel, respectively. The actual "
  4471. "data are unbalanced because we have 300, 660 and 560 replications per column respectively (for each speaker we have two replcations of the data).")
  4472. ENTRY (U"Algorithm")
  4473. NORMAL (U"The formula's to handle unbalanced designs come from @@Khuri (1998)@.")
  4474. MAN_END
  4475. MAN_BEGIN (U"Table: Report one-way Kruskal-Wallis...", U"djmw", 20120617)
  4476. INTRO (U"Performs a one-way Kruskal-Wallis analysis on the data in one column of a selected @@Table@ and reports the results in the info window. This test is sometimes refered to as a one-way analysis of variance for %%non-normally distributed% data.")
  4477. ENTRY (U"Settings")
  4478. TAG (U"##Column with data#")
  4479. DEFINITION (U"the label of the column who's data will be analyzed.")
  4480. TAG (U"##Factor")
  4481. DEFINITION (U"the label of the column with the names of the levels.")
  4482. ENTRY (U"Algorithm")
  4483. NORMAL (U"The analysis is done on the ranked data and consists of the following steps:")
  4484. LIST_ITEM (U"1. Rank all the %N data points together, i.e. rank the data from 1 to %N.")
  4485. LIST_ITEM (U"2. The test statistic is:")
  4486. FORMULA (U"%K = (12 / (%N(%N+1)) \\Si__%i=1_^^%g^ %n__%i_ (meanRank__%i_)^^2^ - 3(%N+1),")
  4487. DEFINITION (U"where %g is the number of levels, %n__%i_ the number of data in %i-th level and meanRank__%i_ "
  4488. "the average rank of the %i-th level.")
  4489. LIST_ITEM (U"3. The %p value is %%approximated by the \\ci^^2^ (%K, %g - 1) distribution.")
  4490. MAN_END
  4491. MAN_BEGIN (U"TableOfReal: Report multivariate normality (BHEP)...", U"djmw", 20090701)
  4492. INTRO (U"Report about multivariate normality according to the @@BHEP multivariate normality test@.")
  4493. ENTRY (U"Settings")
  4494. TAG (U"##Smoothing parameter")
  4495. DEFINITION (U"determines the smoothing parameter %h.")
  4496. MAN_END
  4497. MAN_BEGIN (U"TableOfReal: Change row labels...", U"djmw", 20010822)
  4498. INTRO (U"Changes the row labels of the selected @TableOfReal object according "
  4499. "to the specification in the search and replace fields.")
  4500. NORMAL (U"Both search and replace fields may contain @@regular expressions|"
  4501. "Regular expressions@. The ##Replace limit# parameter limits the number of "
  4502. "replaces that may occur within each label.")
  4503. MAN_END
  4504. MAN_BEGIN (U"TableOfReal: Change column labels...", U"djmw", 20010822)
  4505. INTRO (U"Changes the column labels of the selected @TableOfReal object according "
  4506. "to the specification in the search and replace fields.")
  4507. NORMAL (U"Both search and replace fields may contain @@regular expressions|"
  4508. "Regular expressions@. The %%Replace limit% parameter limits the number of "
  4509. "replaces that may occur within each label.")
  4510. MAN_END
  4511. MAN_BEGIN (U"TableOfReal: Draw biplot...", U"djmw", 20020603)
  4512. INTRO (U"A command to draw a biplot for each column in the selected "
  4513. "@TableOfReal object.")
  4514. ENTRY (U"Settings")
  4515. TAG (U"##Xmin#, ##Xmax#, ##Ymin#, ##Ymax#")
  4516. DEFINITION (U"determine the drawing boundaries.")
  4517. TAG (U"##Split factor")
  4518. DEFINITION (U"determines the weighing of the row and column structure "
  4519. "(see below).")
  4520. ENTRY (U"Behaviour")
  4521. LIST_ITEM (U"1. Get the @@singular value decomposition@ #U #\\Si #V\\'p of the "
  4522. "table.")
  4523. LIST_ITEM (U"2. Calculate weighing factors %\\la for row and columns")
  4524. FORMULA (U"%\\la__r,1_ = %\\si__1_^^%splitFactor^")
  4525. FORMULA (U"%\\la__c,1_ = %\\si__1_^^1-%splitFactor^")
  4526. FORMULA (U"%\\la__r,2_ = %\\si__2_^^%splitFactor^")
  4527. FORMULA (U"%\\la__c,2_ = %\\si__2_^^1-%splitFactor^")
  4528. DEFINITION (U"where %\\si__1_ and %\\si__2_ are the first and the second singular values")
  4529. LIST_ITEM (U"3. For the rows (%i from 1..%numberOfRows) form:")
  4530. FORMULA (U"%xr__%i_ = %U__%i1_ %\\la__%r,1_")
  4531. FORMULA (U"%yr__%i_ = %U__%i2_ %\\la__%r,2_")
  4532. LIST_ITEM (U"4. For the columns (%i from 1..%numberOfColumns) form:")
  4533. FORMULA (U"%xc__%i_ = %V__%i1_ %\\la__%c,1_")
  4534. FORMULA (U"%yc__%i_ = %V__%i2_ %\\la__%c,2_")
  4535. LIST_ITEM (U"5. Plot the points (%xr__%i_, yr__%i_) and (%xc__%i_, yc__%i_) in the "
  4536. "same figure with the corresponding row and column labels.")
  4537. MAN_END
  4538. MAN_BEGIN (U"TableOfReal: Draw box plots...", U"djmw", 20000523)
  4539. INTRO (U"A command to draw a @@box plot@ for each column in the selected "
  4540. "@TableOfReal object.")
  4541. ENTRY (U"Settings")
  4542. TAG (U"##From row#, ##To row#, ##From column#, ##To column#")
  4543. DEFINITION (U"determine the part of the table that you want to analyse.")
  4544. TAG (U"%Ymin and %Ymax")
  4545. DEFINITION (U"determine the drawing boundaries.")
  4546. MAN_END
  4547. MAN_BEGIN (U"TableOfReal: Draw as scalable squares...", U"djmw", 20180304)
  4548. INTRO (U"A command to draw the cells of the table as squares whose areas conform to the cell's value. ")
  4549. ENTRY (U"Settings")
  4550. TAG (U"##From row#, ##To row#")
  4551. DEFINITION (U"determine the rows to be drawn.")
  4552. TAG (U"##From column#, ##To column#")
  4553. DEFINITION (U"determine the columns to be drawn.")
  4554. TAG (U"##Origin")
  4555. DEFINITION (U"determines the drawing orientation. For a table with %%nrow% rows and %%ncol% columns:")
  4556. TAG1 (U"%%top-left%: cel [1][1] will be at the top left position in the drawing, cell [%%nrow%][%%ncol%] will be at bottom right position.")
  4557. TAG1 (U"%%top-right%: cel [1][1] will be at the top right position in the drawing, cell [%%nrow%][%%ncol%] will be at bottom left position.")
  4558. TAG1 (U"%%bottom-left%: cel [1][1] will be at the bottom left position in the drawing, cell [%%nrow%][%%ncol%] will be at top right position.")
  4559. TAG1 (U"%%bottom-right%: cel [1][1] will be at the bottom right position in the drawing, cell [%%nrow%][%%ncol%] will be at top left position.")
  4560. TAG (U"##Cell area scale factor#")
  4561. DEFINITION (U"multiplies the area of each cell's square. If this factor is larger than 1.0 some of the squares might overlap.")
  4562. TAG (U"##Filling order#")
  4563. DEFINITION (U"determines in what order the squares will be drawn. The order is only important if some of the squares overlap, "
  4564. "i.e. if the cell area scale factor is larger than 1.0.")
  4565. TAG1 (U"%%rows%: start with the first row, cell [1][1] to cell [1][%%ncol%], next the second row, etc...")
  4566. TAG1 (U"%%columns% start with column 1, cell [1][1] to cell [%%nrow%][1], next column 2 etc...")
  4567. TAG1 (U"%%increasing-values%: first sort the cell values in increasing order and then start drawing them, the cell with the smallest value first. ")
  4568. TAG1 (U"%%decreasing-values%: first sort the cell values in decreasing order and then start drawing them, the cell with the largest value first.")
  4569. TAG1 (U"%%random%: draw cells in random order. If the cell area scale factor is larger than 1.0 this may result in a different graph of the same table for each successive call.")
  4570. MAN_END
  4571. MAN_BEGIN (U"TableOfReal: Draw rows as histogram...", U"djmw", 20030619)
  4572. INTRO (U"A command to draw a histogram from the rows in the selected "
  4573. "@TableOfReal object.")
  4574. NORMAL (U"The histogram will consist of %groups of bars. The number of groups will "
  4575. "be determined by the number of selected columns from the table, while the "
  4576. "number of bars within each group will be determined from the number of "
  4577. "selected rows.")
  4578. ENTRY (U"Settings")
  4579. TAG (U"##Row numbers# and ##Column range#")
  4580. DEFINITION (U"determine the part of the table that you want to draw. "
  4581. "The column range determines the number of bars that you want to draw for "
  4582. "each row selected by the %%Row numbers% argument.")
  4583. TAG (U"##Ymin# and ##Ymax#")
  4584. DEFINITION (U"the drawing boundaries.")
  4585. NORMAL (U"The following arguments are all relative to the width of a bar "
  4586. "in the histogram. ")
  4587. TAG (U"##Horizontal offset")
  4588. DEFINITION (U"the offset from the left and right margin.")
  4589. TAG (U"##Distance between bar groups")
  4590. DEFINITION (U"the distance between each group, i.e., the distance "
  4591. "between the right side of the last bar in a group to the left side of "
  4592. "the first bar in the next group.")
  4593. TAG (U"##Distance between bars")
  4594. DEFINITION (U"the distance between the bars in a group.")
  4595. TAG (U"##Grey values")
  4596. DEFINITION (U"the grey values of the bars in a group.")
  4597. ENTRY (U"Bar positioning")
  4598. NORMAL (U"If you want to put the labels yourself you will need the following information.")
  4599. NORMAL (U"The width of a bar is determined as follows:")
  4600. FORMULA (U"%width = 1 / (%nc \\.c %nr + 2 \\.c %hoffset + (%nc - 1)\\.c %intergroup +"
  4601. "%nc\\.c(%nr -1)\\.c %interbar),")
  4602. NORMAL (U"where %nc is the number of columns (groups) to draw, %nr is the number of "
  4603. "rows to draw (the number of bars within a group), %hoffset is the horizontal "
  4604. "offset, %intergroup the distance between each group and %interbar "
  4605. "the distance between the bars within a group.")
  4606. NORMAL (U"The spacing between the bars drawn from a row:")
  4607. FORMULA (U"%dx = (%intergroup + %nr + (%nr -1) \\.c %interbar) *% width")
  4608. NORMAL (U"The first bar for the %k-th row starts at:")
  4609. FORMULA (U"%x1 = %hoffset \\.c %width + (%k - 1) \\.c (1 + %interbar) \\.c %width")
  4610. MAN_END
  4611. MAN_BEGIN (U"TableOfReal: Select columns where row...", U"djmw", 20140117)
  4612. INTRO (U"Copy columns from the selected @TableOfReal object to a new "
  4613. "TableOfReal object.")
  4614. ENTRY (U"Settings")
  4615. TAG (U"##Columns")
  4616. DEFINITION (U"defines the indices of the columns to be selected. Ranges can be "
  4617. "defined with a colon \":\". Columns will be selected in the specified "
  4618. "order.")
  4619. TAG (U"##Row condition")
  4620. DEFINITION (U"specifies a condition for the selection of rows. If the "
  4621. "condition evaluates as %true for a particular row, the selected elements "
  4622. "in this row will be copied. See @@Matrix: Formula...@ for the kind of "
  4623. "expressions that can be used here.")
  4624. ENTRY (U"Examples")
  4625. CODE (U"Select columns where row: \"1 2 3\", \"1\"")
  4626. CODE (U"Select columns where row: \"1 : 3\", \"1\"")
  4627. NORMAL (U"Two alternative expressions to copy the first three columns to a new table "
  4628. "with the same number of rows.")
  4629. CODE (U"Select columns where row: \"3 : 1\", \"1\"")
  4630. NORMAL (U"Copy the first three columns to a new table with the same number of "
  4631. "rows. The new table will have the 3 columns reversed.")
  4632. CODE (U"Select columns where row: \"1:6 9:11\", \"self[row,8]>0\"")
  4633. NORMAL (U"Copy the first six columns and columns 9, 10, and 11 to a new table. "
  4634. "Copy only elements from rows where the element in column 8 is greater "
  4635. "than zero.")
  4636. MAN_END
  4637. MAN_BEGIN (U"TableOfReal: Standardize columns", U"djmw", 19990428)
  4638. INTRO (U"Standardizes each column of the selected @TableOfReal.")
  4639. NORMAL (U"The entries %x__%ij_ in the TableOfReal will change to:")
  4640. FORMULA (U"(%x__%ij_ \\-- %\\mu__%j_) / %\\si__%j_, ")
  4641. NORMAL (U"where %\\mu__%j_ and %\\si__%j_ are the mean and the standard deviation as calculated "
  4642. "from the %j^^th^ column, respectively. After standardization all column means will equal zero "
  4643. "and all column standard deviations will equal one.")
  4644. ENTRY (U"Algorithm")
  4645. NORMAL (U"Standard deviations are calculated with the corrected two-pass algorithm as described in @@Chan, Golub & LeVeque (1983)@.")
  4646. MAN_END
  4647. MAN_BEGIN (U"TableOfReal: To Configuration (lda)...", U"djmw", 19981103)
  4648. INTRO (U"Calculates a @Configuration based on the @Discriminant scores obtained "
  4649. "from the selected @TableOfReal. Row labels in the table indicate group membership.")
  4650. ENTRY (U"Setting")
  4651. TAG (U"##Number of dimensions")
  4652. DEFINITION (U"determines the number of dimensions of the resulting Configuration.")
  4653. ENTRY (U"Algorithm")
  4654. NORMAL (U"First we calculate the Discriminant from the data in the TableOfReal. "
  4655. "See @@TableOfReal: To Discriminant@ for details.")
  4656. NORMAL (U"The eigenvectors of the Discriminant determine the directions that "
  4657. "the data in the TableOfReal will be projected unto.")
  4658. MAN_END
  4659. MAN_BEGIN (U"TableOfReal: To Configuration (pca)...", U"djmw", 19980909)
  4660. INTRO (U"Calculates a @Configuration based on the principal components from the "
  4661. "selected @TableOfReal.")
  4662. ENTRY (U"Setting")
  4663. TAG (U"##Number of dimensions")
  4664. DEFINITION (U"determines the number of dimensions of the resulting Configuration.")
  4665. ENTRY (U"Algorithm")
  4666. NORMAL (U"We form principal components without explicitly calculating the covariance matrix "
  4667. "#C = #M\\'p\\.c#M, where #M is the matrix part of the TableOfReal. ")
  4668. LIST_ITEM (U"1. Make the singular value decomposition of #M. This results in "
  4669. "#M = #U\\.c#d\\.c#V\\'p.")
  4670. LIST_ITEM (U"2. Sort singular values #d and corresponding row vectors in #V (descending).")
  4671. LIST_ITEM (U"3. The principalComponent__%ij_ = \\su__%k=1..%numberOfColumns_ %M__%ik_ \\.c %V__%jk_.")
  4672. ENTRY (U"Remark")
  4673. NORMAL (U"The resulting configuration is unique up to reflections along the new principal directions.")
  4674. MAN_END
  4675. MAN_BEGIN (U"TableOfReal: To Correlation", U"djmw", 20151209)
  4676. INTRO (U"A command that creates a (%Pearson) @Correlation object from every "
  4677. "selected @TableOfReal object. The correlations are calculated between "
  4678. "columns.")
  4679. ENTRY (U"Algorithm")
  4680. NORMAL (U"The linear correlation coefficient %r__%ij_ (also called the %%product"
  4681. " moment correlation coefficient% or %%Pearson's correlation coefficient%) "
  4682. " between the elements of columns %i and %j is calculated as:")
  4683. FORMULA (U"%r__%ij_ = \\Si__%k_ (%x__%ki_ - %x\\-^__%i_)(%x__%kj_ - %x\\-^__%j_)/"
  4684. "(\\Vr (\\Si__%k_(%x__%ki_ - %x\\-^__%i_)^2) \\Vr (\\Si__%k_(%x__%kj_ -"
  4685. " %x\\-^__%j_)^2)),")
  4686. NORMAL (U"where %x__%mn_ is the element %m in column %n, and %x\\-^__%n_ "
  4687. "is the mean of column %n.")
  4688. MAN_END
  4689. MAN_BEGIN (U"TableOfReal: To Correlation (rank)", U"djmw", 20151209)
  4690. INTRO (U"A command that creates a (%%Spearman rank-order%) @Correlation object "
  4691. "from every selected @TableOfReal object. The correlations are calculated "
  4692. "between columns.")
  4693. ENTRY (U"Algorithm")
  4694. NORMAL (U"The Spearman rank-order correlation coefficient %r__%ij_ between "
  4695. "the elements of columns %i and %j is calculated as the linear correlation"
  4696. " of the ranks:")
  4697. FORMULA (U"%r__%ij_ = \\Si__%k_ (%R__%ki_ - %R\\-^__%i_) "
  4698. "(%R__%kj_ - %R\\-^__%j_) / (\\Vr (\\Si__%k_(%R__%ki_ - %R\\-^__%i_)^2) "
  4699. "\\Vr (\\Si__%k_(%R__%kj_ - %R\\-^__%j_)^2)),")
  4700. NORMAL (U"where %R__%mn_ is the rank of element %m in column %n, "
  4701. "and %R\\-^__%n_ is the mean of the ranks in column %n.")
  4702. MAN_END
  4703. MAN_BEGIN (U"TableOfReal: To Covariance", U"djmw", 20151209)
  4704. INTRO (U"A command that creates a @Covariance object from every "
  4705. "selected @TableOfReal object. The covariances are calculated between "
  4706. "columns.")
  4707. ENTRY (U"Algorithm")
  4708. NORMAL (U"The covariance coefficients %s__%ij_ "
  4709. " between the elements of columns %i and %j are defined as:")
  4710. FORMULA (U"%s__%ij_ = \\Si__%k_ (%x__%ki_ - %x\\-^__%i_)(%x__%kj_ - %x\\-^__%j_)/"
  4711. "(%numberOfObservations - %numberOfConstraints),")
  4712. NORMAL (U"where %x__%ki_ is the element %k in column %i, %x\\-^__%i_ "
  4713. "is the mean of column %i, %numberOfObservations equals the number of rows in "
  4714. "the table, and %numberOfConstraints equals 1.")
  4715. NORMAL (U"The actual calculation goes as follows")
  4716. LIST_ITEM (U"1. Centralize each column (subtract the mean).")
  4717. LIST_ITEM (U"2. Get its @@singular value decomposition@ #U #\\Si #V\\'p.")
  4718. LIST_ITEM (U"3. Form #S = #V #\\Si #V\\'p.")
  4719. LIST_ITEM (U"4. Divide all elements in #S by (%numberOfObservations - 1).")
  4720. MAN_END
  4721. MAN_BEGIN (U"TableOfReal: To Discriminant", U"djmw", 19990104)
  4722. INTRO (U"A command that creates a @Discriminant object from every selected "
  4723. "@TableOfReal object. Row labels in the table indicate group membership.")
  4724. ENTRY (U"Algorithm")
  4725. NORMAL (U"We solve for directions #x that are eigenvectors of the generalized "
  4726. "eigenvalue equation:")
  4727. FORMULA (U"#%B #x - %\\la #%W #x = 0,")
  4728. NORMAL (U"where #%B and #%W are the between-groups and the within-groups sums of "
  4729. "squares and cross-products matrices, respectively. Both #%B and #%W are symmetric "
  4730. "matrices. Standard formula show that both matrices can also "
  4731. "be written as a matrix product. The formula above then transforms to:")
  4732. FORMULA (U"#%B__1_\\'p#%B__1_ #x - %\\la #%W__1_\\'p#%W__1_ #x = 0")
  4733. NORMAL (U"The equation can be solved with the @@generalized singular value decomposition@. "
  4734. "This procedure is numerically very stable and can even cope with cases when both "
  4735. "matrices are singular.")
  4736. NORMAL (U"The a priori probabilities in the Discriminant will be calculated from the number of "
  4737. "%training vectors %n__%i_ in each group:")
  4738. FORMULA (U"%aprioriProbability__%i_ = %n__%i_ / \\Si__%k=1..%numberOfGroups_ %n__%k_")
  4739. MAN_END
  4740. MAN_BEGIN (U"TableOfReal: To PCA", U"djmw", 20160223)
  4741. INTRO (U"A command that creates a @PCA object from every selected "
  4742. "@TableOfReal object, where the TableOfReal object is interpreted as row-oriented, i.e. %%numberOfRows% data vectors, each data vector has %%numberofColumns% elements.")
  4743. NORMAL (U"In @@Principal component analysis|the tutorial on PCA@ you will find more info on principal component analysis.")
  4744. MAN_END
  4745. MAN_BEGIN (U"TableOfReal: To SSCP...", U"djmw", 19990218)
  4746. INTRO (U"Calculates Sums of Squares and Cross Products (@SSCP) from the selected @TableOfReal.")
  4747. ENTRY (U"Algorithm")
  4748. NORMAL (U"The sums of squares and cross products %s__%ij_ "
  4749. " between the elements of columns %i and %j are calculated as:")
  4750. FORMULA (U"%s__%ij_ = \\Si__%k_ (%x__%ki_ - %x\\-^__%i_)(%x__%kj_ - %x\\-^__%j_),")
  4751. NORMAL (U"where %x__%mn_ is the element %m in column %n and %x\\-^__%n_ "
  4752. "is the mean of column %n.")
  4753. MAN_END
  4754. MAN_BEGIN (U"TableOfReal: To PatternList and Categories...", U"djmw", 20040429)
  4755. INTRO (U"Extracts a @PatternList and a @Categories from the selected @TableOfReal.")
  4756. NORMAL (U"The selected rows and columns are copied into the PatternList and "
  4757. "the corresponding row labels are copied into a Categories. ")
  4758. MAN_END
  4759. MAN_BEGIN (U"TableOfReal: To CCA...", U"djmw", 20020424)
  4760. INTRO (U"A command that creates a @CCA object from the selected "
  4761. "@TableOfReal object.")
  4762. ENTRY (U"Settings")
  4763. TAG (U"%%Dimension of dependent variate (ny)")
  4764. DEFINITION (U"defines the partition of the table into the two parts whose "
  4765. "correlations will be determined. The first %ny columns should be the "
  4766. "dependent part, the rest of the columns will be interpreted as the "
  4767. "independent part (%nx columns). In general %nx should be larger than or "
  4768. "equal to %ny.")
  4769. ENTRY (U"Behaviour")
  4770. NORMAL (U"Calculates canonical correlations between the %dependent and the "
  4771. "%independent parts of the table. The corresponding "
  4772. "canonical coefficients are also determined.")
  4773. ENTRY (U"Algorithm")
  4774. NORMAL (U"The canonical correlation equations for two data sets #T__%y_ "
  4775. "[%n \\xx %p] and #T__%x_ [n \\xx %q] are:")
  4776. FORMULA (U"(1) (#S__%yx_ #S__%xx_^^-1^ #S__%yx_\\'p -\\la #S__%yy_)#y = #0")
  4777. FORMULA (U"(2) (#S__%yx_\\'p #S__%yy_^^-1^ #S__%yx_ -\\la #S__%xx_)#x = #0")
  4778. NORMAL (U"where #S__%yy_ [%p \\xx %p] and #S__%xx_ [%q \\xx %q] are the "
  4779. "covariance matrices of data sets #T__%y_ and #T__%x_, respectively, "
  4780. "#S__%yx_ [%p \\xx %q] is the matrix of covariances between data sets "
  4781. "#T__%y_ and #T__%x_, and the vectors #y and #x are the %%canonical "
  4782. "weights% or the %%canonical function coefficients% for the dependent and "
  4783. "the independent data, respectively. "
  4784. "In terms of the (dependent) data set #T__%y_ and the (independent) data set "
  4785. "#T__%x_, these covariances can be written as:")
  4786. FORMULA (U"#S__%yy_ = #T__%y_\\'p #T__%y_, #S__%yx_ = #T__%y_\\'p #T__%x_ and "
  4787. "#S__%xx_ = #T__%x_\\'p #T__%x_.")
  4788. NORMAL (U"The following @@singular value decomposition@s ")
  4789. FORMULA (U"#T__%y_ = #U__%y_ #D__%y_ #V__%y_\\'p and #T__%x_ = #U__%x_ #D__%x_ "
  4790. "#V__%x_\\'p ")
  4791. NORMAL (U"transform equation (1) above into:")
  4792. FORMULA (U"(3) (#V__%y_ #D__%y_ #U__%y_\\'p#U__%x_ #U__%x_\\'p #U__%y_ #D__%y_ "
  4793. "#V__%y_\\'p - \\la #V__%y_ #D__%y_ #D__%y_ #V__%y_\\'p)#y = 0 ")
  4794. NORMAL (U"where we used the fact that:")
  4795. FORMULA (U"#S__%xx_^^-1^ = #V__%x_ #D__%x_^^-2^ #V__%x_\\'p.")
  4796. NORMAL (U"Equation (3) can be simplified by multiplication from the left by "
  4797. "#D__%y_^^-1^ #V__%y_' to:")
  4798. FORMULA (U" (4) ((#U__%x_\\'p #U__%y_)\\'p (#U__%x_\\'p #U__%y_) - \\la #I)#D__%y_ "
  4799. "#V__%y_\\'p #y = #0")
  4800. NORMAL (U"This equation can, finally, be solved by a substitution of the s.v.d "
  4801. "of #U__%x_\\'p #U__%y_ = #U #D #V\\'p into (4). This results in")
  4802. FORMULA (U"(5) (#D^^2^ - \\la #I) #V\\'p #D__%y_ #V__%y_\\'p #y = #0")
  4803. NORMAL (U"In an analogous way we can reduce eigenequation (2) to:")
  4804. FORMULA (U"(6) (#D^^2^ - \\la #I) #U\\'p #D__%x_ #V__%x_\\'p #x = #0")
  4805. NORMAL (U"From (5) and (6) we deduce that the eigenvalues in both equations "
  4806. "are equal to the squared singular values of the product matrix "
  4807. "#U__%x_\\'p#U__%y_. "
  4808. "These singular values are also called %%canonical "
  4809. "correlation coefficients%. The eigenvectors #y and #x can be obtained "
  4810. "from the columns of the following matrices #Y and #X:")
  4811. FORMULA (U"#Y = #V__%y_ #D__%y_^^-1^ #V")
  4812. FORMULA (U"#X = #V__%x_ #D__%x_^^-1^ #U")
  4813. NORMAL (U"For example, when the vector #y equals the first column of #Y and "
  4814. "the vector #x equals "
  4815. "the first column of #X, then the vectors #u = #T__%y_#y and #v = #T__%x_#x "
  4816. "are the linear combinations from #T__%y_ and #T__%x_ that have maximum "
  4817. "correlation. Their correlation coefficient equals the first canonical "
  4818. "correlation coefficient.")
  4819. MAN_END
  4820. MAN_BEGIN (U"TableOfReal: To TableOfReal (means by row labels)...", U"djmw", 20140117)
  4821. INTRO (U"A command that appears in the ##Multivariate statistics# menu if you select a @@TableOfReal@. "
  4822. "It calculates the multivariate means for the different row labels from the selected TableOfReal.")
  4823. ENTRY (U"Setting")
  4824. TAG (U"##Expand")
  4825. DEFINITION (U"when %off, then for a table with %n rows and %m different labels (%m\\<_%n), the resulting table will have %m rows. "
  4826. "When %on, the dimensions of the resulting table will be the same as the originating, and corresponding means substituded "
  4827. "in each row.")
  4828. ENTRY (U"Example")
  4829. NORMAL (U"The following commands")
  4830. CODE (U"@@Create TableOfReal (Pols 1973)...|Create TableOfReal (Pols 1973)@: \"no\"")
  4831. CODE (U"To TableOfReal (means by row labels): 0")
  4832. NORMAL (U"will result in a new TableOfReal that has 12 rows. Each row will contain the mean F1, F2 and F3 values for a particular vowel. These means "
  4833. " were obtained from 50 representations of that vowel.")
  4834. NORMAL (U"If we had chosen the %expansion:")
  4835. CODE (U"To TableOfReal (means by row labels): \"yes\"")
  4836. NORMAL (U"the resulting TableOfReal would have had 600 rows. This representation comes in handy when, for example, you have to calculate deviations from the mean.")
  4837. MAN_END
  4838. MAN_BEGIN (U"TextGrid: Extend time...", U"djmw", 20020702)
  4839. INTRO (U"Extends the domain of the selected @TextGrid object.")
  4840. ENTRY (U"Settings")
  4841. TAG (U"##Extend domain by")
  4842. DEFINITION (U"defines the amount of time by which the domain will be extended.")
  4843. TAG (U"##At")
  4844. DEFINITION (U"defines whether starting times or finishing times will be "
  4845. "modified.")
  4846. ENTRY (U"Behaviour")
  4847. NORMAL (U"We add an extra (empty) interval into each %%interval tier%. "
  4848. "This is necessary to keep original intervals intact. According to the "
  4849. "value of the second argument, the new interval will be added at the "
  4850. "beginning or at the end of the tier.")
  4851. NORMAL (U"For %%point tiers% only the domain will be changed.")
  4852. MAN_END
  4853. MAN_BEGIN (U"TextGrid & DurationTier: To TextGrid (scale times)", U"djmw", 20170612)
  4854. INTRO (U"Scales the durations of the selected @@TextGrid@ intervals as specified by the selected @@DurationTier@.")
  4855. MAN_END
  4856. MAN_BEGIN (U"TextGrid: To DurationTier...", U"djmw", 20170617)
  4857. INTRO (U"Returns a @@DurationTier@ that could scale the durations of the specified intervals of the selected @@TextGrid@ with a specified factor.")
  4858. ENTRY (U"Settings")
  4859. SCRIPT (6, Manual_SETTINGS_WINDOW_HEIGHT (5), U""
  4860. Manual_DRAW_SETTINGS_WINDOW ("TextGrid: To DurationTier", 5)
  4861. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Tier number", "1")
  4862. Manual_DRAW_SETTINGS_WINDOW_FIELD("Time scale factor", "2.0")
  4863. Manual_DRAW_SETTINGS_WINDOW_FIELD("Left transition duration", "1e-10")
  4864. Manual_DRAW_SETTINGS_WINDOW_FIELD("Right transition duration", "1e-10")
  4865. Manual_DRAW_SETTINGS_WINDOW_FIELD ("Scale intervals whose labels", "starts with")
  4866. Manual_DRAW_SETTINGS_WINDOW_FIELD ("...the text", "hi")
  4867. )
  4868. TAG (U"##Tier number#")
  4869. DEFINITION (U"specifies the tier with the intervals.")
  4870. TAG (U"##Time scale factor")
  4871. DEFINITION (U"specifies the scale factor by which the duration of a selected interval has to be multiplied.")
  4872. TAG (U"##Left transition duration#")
  4873. DEFINITION (U"specifies how long it takes to go from a time scale factor of 1.0 to the specified one. Default a very small duration is used. ")
  4874. TAG (U"##Right transition duration#")
  4875. DEFINITION (U"specifies the time it takes to go from the specified time scale factor to 1.0. Default a very small duration is used.")
  4876. TAG (U"##Scale intervals whose labels")
  4877. DEFINITION (U"specifies the interval selection criterion.")
  4878. TAG (U"##...the text")
  4879. DEFINITION (U"specifies the text used in the selection criterion.")
  4880. ENTRY (U"Algorithm")
  4881. SCRIPT (5, 3, U"ymin = 0.9\n"
  4882. "Axes: 0, 1, ymin, 2.0\n"
  4883. "t1 = 0.2\n"
  4884. "t4 = 0.9\n"
  4885. "timeScaleFactor = 1.5\n"
  4886. "leftTransitionDuration = 0.1\n"
  4887. "rightTransitionDuration = 0.2\n"
  4888. "t2 = t1 + leftTransitionDuration\n"
  4889. "t3 = t4 - rightTransitionDuration\n"
  4890. "Solid line\n"
  4891. "Draw line: t1, 1, t2, timeScaleFactor\n"
  4892. "Draw line: t2, timeScaleFactor, t3, timeScaleFactor\n"
  4893. "Draw line: t3, timeScaleFactor, t4, 1.0\n"
  4894. "Dotted line\n"
  4895. "Draw line: 0, 1, t1, 1\n"
  4896. "Draw line: t4, 1.0, 1.0, 1.0\n"
  4897. "Draw line: t1, ymin, t1, timeScaleFactor+0.1\n"
  4898. "Draw line: t2, ymin, t2, timeScaleFactor+0.1\n"
  4899. "Draw two-way arrow: t1, timeScaleFactor+0.1, t2, timeScaleFactor+0.1\n"
  4900. "Text: (t1+t2)/2, \"Centre\", timeScaleFactor+0.1, \"Bottom\", \"leftTransitionDuration\"\n"
  4901. "Draw line: t3, ymin, t3, timeScaleFactor+0.1\n"
  4902. "Draw line: t4, ymin, t4, timeScaleFactor+0.1\n"
  4903. "Draw two-way arrow: t3, timeScaleFactor+0.1, t4, timeScaleFactor+0.1\n"
  4904. "Text: (t3+t4)/2, \"Centre\", timeScaleFactor+0.1, \"Bottom\", \"rightTransitionDuration\"\n"
  4905. "One mark bottom: t1, \"no\", \"yes\", \"no\", \"t__1_\"\n"
  4906. "One mark bottom: t2, \"no\", \"yes\", \"no\", \"t__2_\"\n"
  4907. "One mark bottom: t3, \"no\", \"yes\", \"no\", \"t__3_\"\n"
  4908. "One mark bottom: t4, \"no\", \"yes\", \"no\", \"t__4_\"\n"
  4909. "One mark left: 1.0, \"yes\", \"yes\", \"no\", \"\"\n"
  4910. "Text bottom: \"yes\", \"Time (s) \\->\"\n"
  4911. "Text left: \"yes\", \"Duration scale factor \\->\"\n"
  4912. "Draw inner box\n"
  4913. )
  4914. NORMAL (U"For each selected interval its duration will be specified by four points in the duration tier as the figure above shows. "
  4915. "Given that the start time "
  4916. "and the end time of the interval are at %t__1_ and %t__4_, respectively, the times of these four points will be "
  4917. "%t__1_, %t__2_=%t__1_+%%leftTransitionDuration%, %t__3_=%t__4_-%%rightTransitionDuration% and %t__4_. The associated duration scale factors "
  4918. "will be 1.0, %%timeScalefactor%, %%timeScalefactor% and 1.0, respectively.")
  4919. NORMAL (U"Normally we would use very small values for the right and the left transition durations and the curve in the figure above "
  4920. "would look more like a rectangular block instead of the trapezium above. If, on the contrary, larger values for the durations are taken, such that the sum of "
  4921. "the left and the right transition durations %%exceeds% the interval's width, then the ordering of the time points at %t__1_ to %t__4_ changes "
  4922. "which will have unexpected results on the duration tier.")
  4923. ENTRY (U"Examples")
  4924. NORMAL (U"Suppose you want to change the durations of some parts in a sound. The way to go is:")
  4925. LIST_ITEM (U"1. Create a TextGrid with at least one interval tier with the segments of interest labeled.")
  4926. LIST_ITEM (U"2. Select the TextGrid and choose the ##To DurationTier...# option.")
  4927. LIST_ITEM (U"3. Use the selected sound to create a @@Manipulation@ object from it. Check and eventually correct the pitch measurements in this object (##View & Edit#) as the quality of the resynthesis depends critically on the quality of the pitch measurements.")
  4928. LIST_ITEM (U"4. Select the Manipulation object and the newly created DurationTier object together and choose ##Replace duration tier#.")
  4929. LIST_ITEM (U"5. Select the Manipulation object and choose ##Get resynthesis (overlap-add)#. The newly created sound object will have the "
  4930. "durations of its selected intervals changed.")
  4931. LIST_ITEM (U"6. Optionally you might also want to scale the TextGrid to line up with the newly created sound too. You can do so by selecting the "
  4932. "TextGrid and the DurationTier together and choose ##To TextGrid (scale times)#. You will get a new TextGrid that is nicely "
  4933. "aligned with the new sound.")
  4934. MAN_END
  4935. MAN_BEGIN (U"TIMIT acoustic-phonetic speech corpus", U"djmw", 19970320)
  4936. INTRO (U"A large American-English speech corpus that resulted from the joint efforts "
  4937. "of several American research sites.")
  4938. NORMAL (U"The TIMIT corpus contains a total of 6300 sentences, 10 sentences spoken by "
  4939. "630 speakers selected from 8 major dialect regions of the USA. 70\\% of "
  4940. "the speakers are male, 30\\% are female.")
  4941. NORMAL (U"The text corpus design was done by the Massachusetts Institute of "
  4942. "Technology (MIT), Stanford Research Institute and Texas Instruments (TI). "
  4943. "The speech was recorded at TI, transcribed at MIT, and has been maintained, "
  4944. "verified and prepared for CDROM production by the American National Institute "
  4945. "of Standards and Technology (NIST) (@@Lamel et al. (1986)@).")
  4946. MAN_END
  4947. MAN_BEGIN (U"VowelEditor", U"djmw", 20111124)
  4948. INTRO (U"An Editor for generating vowel-like @@sound|Sound@s from mouse movements.")
  4949. ENTRY (U"How to get a sound")
  4950. NORMAL (U"With the mouse button down, you can move the mouse cursor around in the plane "
  4951. "spanned by the first two formants. While you move the cursor around, the positions you trace will be "
  4952. "indicated by blue dots. After you release the mouse button, the color of the trajectory will change "
  4953. "to black. Next you will hear the vowel-like sound whose "
  4954. "first two formants follow this trajectory. (The small bars on the trajectory are time markers. With "
  4955. "default settings, time markers are at 50 milliseconds apart and they may give you an indication of the speed by which you traversed the trajectory.)")
  4956. ENTRY (U"The interface")
  4957. NORMAL (U"In the lower part of the editor a number of buttons and fields are displayed.")
  4958. TAG (U"##Play")
  4959. DEFINITION (U"will play the trajectory.")
  4960. TAG (U"##Reverse")
  4961. DEFINITION (U"will reverse the trajectory and play it.")
  4962. TAG (U"##Publish")
  4963. DEFINITION (U"will publish the sound in the list of objects.")
  4964. TAG (U"##Duration (s)")
  4965. DEFINITION (U"allows to modify the duration of the current trajectory. ")
  4966. TAG (U"##Extend (s)")
  4967. DEFINITION (U"determines the duration of the straight line trajectory that connects the endpoint of the current trajectory with the startpoint of a new trajectory. You may extend the current trajectory by starting a new trajectory with the shift button pressed. After you finished the new trajectory, three trajectories will be appended: the current one, the straight line one and the new one.")
  4968. TAG (U"##Start F0 (Hz)")
  4969. DEFINITION (U"determines the fundamental frequency at the start of the trajectory.")
  4970. TAG (U"##F0 slope (oct/s)")
  4971. DEFINITION (U"determines how many octaves the pitch will changes during the course of the trajectory.")
  4972. NORMAL (U"The bottom line in the Editor displays the first and second formant frequency and the fundamental frequency at the start point and the endpoint of the trajectory.")
  4973. ENTRY (U"Edit menu")
  4974. TAG (U"##Set F0...")
  4975. DEFINITION (U"Set pitch and slope.")
  4976. TAG (U"##Set F3 & F4...")
  4977. DEFINITION (U"Set the frequencies and bandwidths for the third and fourth formant.")
  4978. TAG (U"##Reverse trajectory")
  4979. DEFINITION (U"Reverses the trajectory (like editor button).") // ??
  4980. TAG (U"##Modify trajectory duration...")
  4981. DEFINITION (U"Modifies trajectory duration (like editor field).") // ??
  4982. TAG (U"##New trajectory...")
  4983. DEFINITION (U"Set startpoint, endpoint and duration of a new trajectory.")
  4984. TAG (U"##Extend trajectory...")
  4985. DEFINITION (U"Extend current trajectory to...")
  4986. TAG (U"##Shift trajectory...")
  4987. DEFINITION (U"Shift current trajectory.")
  4988. ENTRY (U"View menu")
  4989. TAG (U"##F1 & F2 range...#")
  4990. DEFINITION (U"Modify the horizontal and vertical scales.")
  4991. TAG (U"##Show vowel marks from fixed set...#")
  4992. DEFINITION (U"Show the vowel marks in the editor from a fixed set of vowel inventories.")
  4993. TAG (U"##Show vowel marks from Table file...#")
  4994. DEFINITION (U"Put your own marks in the editor. The Table needs to have at least three mandatory columns "
  4995. "labeled \"Vowel\", \"F1\" and \"F2\" and "
  4996. "one optional column labeled \"Size\". The Vowel column contains the vowel marker labels, the F1 and "
  4997. "F2 columns have the first and second formant frequencies in Hertz. The optional Size column contains "
  4998. "the font size of the vowel markers.")
  4999. TAG (U"##Show trajectory time markers every...")
  5000. DEFINITION (U"Shows time markers as small bars orthogonal to the trajectory. ")
  5001. ENTRY (U"Publishing")
  5002. TAG (U"##Publish Sound")
  5003. TAG (U"##Extract FormantTier")
  5004. TAG (U"##Extract PitchTier")
  5005. DEFINITION (U"Publish the Sound, the PitchTier and the FormantTier from the trajectory.")
  5006. TAG (U"##Draw trajectory...")
  5007. DEFINITION (U"Draws the trajectory in the picture window")
  5008. MAN_END
  5009. MAN_BEGIN (U"VowelEditor: Show vowel marks from Table file...", U"djmw", 20111124)
  5010. INTRO (U"A command in the @@VowelEditor@ that lets you set your own vowel marks. ")
  5011. ENTRY (U"Layout of the Table")
  5012. NORMAL (U"The Table needs at least three mandatory columns labeled \"Vowel\", \"F1\" and \"F2\" and "
  5013. "one optional column labeled \"Size\". The Vowel column contains the vowel marker labels, the F1 and "
  5014. "F2 columns have the first and second formant frequencies in Hertz. The optional Size column contains "
  5015. "the font size of the vowel markers.")
  5016. MAN_END
  5017. /********************** GSL ********************************************/
  5018. MAN_BEGIN (U"incompleteBeta", U"djmw", 20071024)
  5019. TAG (U"##incompleteBeta (%a, %b, %x)")
  5020. DEFINITION (U"I__x_(%a,%b) = 1/beta(%a,%b)\\in__0_^%x %t^^%a-1^(1-%t)^^%b-1^ dt,")
  5021. NORMAL (U"for 0 \\<_ %x \\<_ 1 and %a and %b and %a+%b not equal to a negative integer.")
  5022. //double incompleteBeta (double a, double b, double x);
  5023. //Pre: 0<= x <= 1; a> 0, b>0
  5024. //Def: $I_x(a,b)=B_x(a,b)/B(a,b)=1/B(a,b) \int_0^x t^{a-1}(1-t)^{b-1)dt$
  5025. //Limiting values: $I_0(a,b)=0 I_1(a,b)=1$
  5026. //Symmetry: $I_x(a,b) = 1 - I_{1-x}(b,a)$
  5027. MAN_END
  5028. MAN_BEGIN (U"incompleteGammaP", U"djmw", 20170531)
  5029. TAG (U"##incompleteGammaP (%a, %x)")
  5030. DEFINITION (U"incompleteGammaP = 1/\\Ga(%a)\\in__0_^%x e^^-%t^%t^^%a-1^ dt,")
  5031. NORMAL (U"where %x and %a are real numbers that satisfy %x\\>_ 0 and %a not being a negative integer.")
  5032. MAN_END
  5033. MAN_BEGIN (U"lnBeta", U"djmw", 20071024)
  5034. TAG (U"##lnBeta (%a, %b)")
  5035. DEFINITION (U"Computes the logarithm of the #beta function, subject to %a and %b and %a+%b not being negative integers.")
  5036. MAN_END
  5037. /********************* References **************************************/
  5038. MAN_BEGIN (U"Bai & Demmel (1993)", U"djmw", 19981007)
  5039. NORMAL (U"Z. Bai & J. Demmel (1993): \"Computing the generalized singular value "
  5040. "decomposition.\" %%SIAM J. Sci. Comput.% #14: 1464\\--1486.")
  5041. MAN_END
  5042. MAN_BEGIN (U"Bartlett (1954)", U"djmw", 20011111)
  5043. NORMAL (U"M.S. Bartlett (1954): \"A note on multiplying factors for various "
  5044. "chi-squared approximations.\", %%Joural of the Royal Statistical Society, "
  5045. "Series B% #16: 296\\--298")
  5046. MAN_END
  5047. MAN_BEGIN (U"Boll (1979)", U"djmw", 20121021)
  5048. NORMAL (U"S.F. Boll (1979): \"Suppression of acoustic noise in speech using spectral subtraction.\""
  5049. "%%IEEE Transactions on ASSP% #27: 113\\--120.")
  5050. MAN_END
  5051. MAN_BEGIN (U"Boomsma (1977)", U"djmw", 20020524)
  5052. NORMAL (U"A. Boomsma (1977): \"Comparing approximations of confidence intervals "
  5053. "for the product-moment correlation coefficient.\" %%Statistica Neerlandica% "
  5054. "#31: 179-186.")
  5055. MAN_END
  5056. MAN_BEGIN (U"Chan, Golub & LeVeque (1983)", U"djmw", 20170802)
  5057. NORMAL (U"T.F. Chan, G.H. Golub & R.J. LeVeque (1983): \"Algorithms for computing the sample variance: Analysis and recommendations.\" %%The American Statistician% #37: 242\\--247.")
  5058. MAN_END
  5059. MAN_BEGIN (U"Chan, Golub & LeVeque (1979)", U"djmw", 20170802)
  5060. NORMAL (U"T.F. Chan, G.H. Golub & R.J. LeVeque (1979): \"Updating formulae and an pairwise algorithm for computing sample variances.\" %%Stanford working paper STAN-CS-79-773%, 1\\--22.")
  5061. MAN_END
  5062. MAN_BEGIN (U"Cooley & Lohnes (1971)", U"djmw", 20060322)
  5063. NORMAL (U"W.W. Colley & P.R. Lohnes (1971): %%Multivariate data analysis%. "
  5064. "John Wiley & Sons.")
  5065. MAN_END
  5066. MAN_BEGIN (U"Davis & Mermelstein (1980)", U"djmw", 20010419)
  5067. NORMAL (U"S.B. Davis & P. Mermelstein (1980), \"Comparison of parametric "
  5068. "representations for monosyllabic word recognition in continuously spoken sentences.\" "
  5069. "%%IEEE Transactions on ASSP% #28: 357\\--366.")
  5070. MAN_END
  5071. MAN_BEGIN (U"Deng & Tang (2011)", U"djmw", 20170915)
  5072. NORMAL (U"X. Deng & Z. Tang (2011). \"Moving surface spline interpolation based on Green's function\": "
  5073. "%%Mathematical Geosciences% #43: 663\\--680.")
  5074. MAN_END
  5075. MAN_BEGIN (U"Efron & Tibshirani (1993)", U"djmw", 20031103)
  5076. NORMAL (U"B. Efron & R.J. Tibshirani (1993): %%An introduction "
  5077. "to the bootstrap%. Chapman & Hall.")
  5078. MAN_END
  5079. #define xstr(s) str(s)
  5080. #define str(s) #s
  5081. MAN_BEGIN (U"Espeak", U"djmw", 20171101)
  5082. NORMAL (U"Espeak is a free text to speech synthesizer. It was developed by Jonathan Duddington and its development has stopped in 2015. "
  5083. "In 2015 Reece Dunn has taken a copy of espeak and together with a group of developers they maintain and actualize their version of espeak which they call \"eSpeak NG\". eSpeak NG uses formant synthesis. "
  5084. "Currently it supports 100 languages with varying quality of the voices. The current version of eSpeakNG incorporated in Praat is " xstr(ESPEAK_NG_VERSIONX) ".")
  5085. NORMAL (U"The wikipedia page https://en.wikipedia.org/wiki/ESpeakNG gives more details.")
  5086. MAN_END
  5087. MAN_BEGIN (U"Flanagan (1960)", U"djmw", 19980713)
  5088. NORMAL (U"J.L. Flanagan (1960): \"Models for approximating basilar membrane "
  5089. "displacement.\" %%Bell System Technical Journal% #39: 1163\\--1191.")
  5090. MAN_END
  5091. MAN_BEGIN (U"Friedl (1997)", U"djmw", 20010710)
  5092. NORMAL (U"J.E.F. Friedl (1997): %%Mastering Regular Expressions%. "
  5093. "O'Reilly & Associates.")
  5094. MAN_END
  5095. MAN_BEGIN (U"Ganong (1980)", U"djmw", 20130622)
  5096. NORMAL (U"W.F. Ganong III (1980): \"Phonetic categorization in auditory word perception.\" %%Journal of Experimental Psychology: Human Perception and Performance% #6: 110\\--125.")
  5097. MAN_END
  5098. MAN_BEGIN (U"Greiner & Hormann (1998)", U"djmw", 20110617)
  5099. NORMAL (U"G. Greiner & K. Hormann (1998): \"Efficient clipping of arbitrary polygons.\" %%ACM Transactions on Graphics% #17: 71\\--83.")
  5100. MAN_END
  5101. MAN_BEGIN (U"Heath et al. (1986)", U"djmw", 19981007)
  5102. NORMAL (U"M.T. Heath, J.A. Laub, C.C. Paige & R.C. Ward (1986): \"Computing the "
  5103. "singular value decomposition of a product of two matrices.\" "
  5104. "%%SIAM J. Sci. Statist. Comput.% #7: 1147\\--1159.")
  5105. MAN_END
  5106. MAN_BEGIN (U"Hermes (1988)", U"djmw", 19980123)
  5107. NORMAL (U"D.J. Hermes (1988): \"Measurement of pitch by subharmonic "
  5108. "summation.\" %%Journal of the Acoustical Society of America% #83: 257\\--264.")
  5109. MAN_END
  5110. MAN_BEGIN (U"Henze & Wagner (1997)", U"djmw", 20090630)
  5111. NORMAL (U"N. Henze & T. Wagner (1997): \"A new npproach to the BHEP Tests for Multivariate Normality.\" "
  5112. "%%Journal of Multivariate Analysis% #62: 1\\--23.")
  5113. MAN_END
  5114. MAN_BEGIN (U"Hormann & Agathos (2001)", U"djmw", 20110617)
  5115. NORMAL (U"K. Hormann & A. Agathos (2001): \"The point in polygon problem for arbitrary polygons.\" "
  5116. "%%Computational Geometry% #20: 131\\--144.")
  5117. MAN_END
  5118. MAN_BEGIN (U"Irino & Patterson (1997)", U"djmw", 20100517)
  5119. NORMAL (U"T. Irino & R.D. Patterson (1997): \"A time-domain, level-dependent "
  5120. "auditory filter: The gammachirp.\" %%Journal of the Acoustical Society of America% #101: 412\\--419.")
  5121. MAN_END
  5122. MAN_BEGIN (U"Johannesma (1972)", U"djmw", 19980123)
  5123. NORMAL (U"P.I.M. Johannesma (1972): \"The pre-response stimulus ensemble of "
  5124. "neurons in the cochlear nucleus.\" In %%Symposium on Hearing Theory% "
  5125. "(IPO, Eindhoven, Holland), 58\\--69.")
  5126. MAN_END
  5127. MAN_BEGIN (U"Johnson (1998)", U"djmw", 20000525)
  5128. NORMAL (U"D.E. Johnson (1998): %%Applied multivariate methods%.")
  5129. MAN_END
  5130. MAN_BEGIN (U"Keating & Esposito (2006)", U"djmw", 20130620)
  5131. NORMAL (U"P.A. Keating & C. Esposito (2006): \"Linguistic voice quality.\" %%UCLA Working Papers in Phonetics% #105: 85\\--91.")
  5132. MAN_END
  5133. MAN_BEGIN (U"Khuri (1998)", U"djmw", 20120702)
  5134. NORMAL (U"A. Khuri (1998): \"Unweighted sums of squares in unbalanced analysis of variance.\", %%Journal of Statistical Planning "
  5135. "and Inference% #74: 135\\--147.")
  5136. MAN_END
  5137. MAN_BEGIN (U"Kim & Kim (2006)", U"djmw", 20110617)
  5138. NORMAL (U"D.H. Kim & M.-J. Kim (2006): \"An extension of polygon clipping to resolve degenerate cases.\" %%Computer-Aided Design & Applications% #3: 447\\--456.")
  5139. MAN_END
  5140. MAN_BEGIN (U"Kostlan & Gokhman (1987)", U"djmw", 20170530)
  5141. NORMAL (U"E. Kostlan & D. Gokhman (1987): \"A program for calculating the incomplete gamma function.\" %%Technical report, Dept. of Mathematics, Univ. of California, Berkeley, 1987.")
  5142. MAN_END
  5143. MAN_BEGIN (U"Krishnamoorthy & Yu (2004)", U"djmw", 20090813)
  5144. NORMAL (U"K. Krishnamoorthy & J. Yu (2004): \"Modified Nel and Van der Merwe test for multivariate "
  5145. "Behrens-Fisher problem.\" %%Statistics & Probability Letters% #66: 161\\--169.")
  5146. MAN_END
  5147. MAN_BEGIN (U"Lamel et al. (1986)", U"djmw", 19980123)
  5148. NORMAL (U"L.F. Lamel, R.H. Kassel & S. Sennef (1986): \"Speech Database "
  5149. "Development: Design and Analysis of the Acoustic-Phonetic Corpus.\" "
  5150. "%%Proc. DARPA Speech Recognition Workshop%, Report No. SAIC-86/1546, "
  5151. "100\\--119.")
  5152. MAN_END
  5153. MAN_BEGIN (U"Morrison (1990)", U"djmw", 19980123)
  5154. NORMAL (U"D.F. Morrison (1990): %%Multivariate statistical methods%. "
  5155. "New York: McGraw-Hill.")
  5156. MAN_END
  5157. MAN_BEGIN (U"Peterson & Barney (1952)", U"djmw", 20020620)
  5158. NORMAL (U"G.E. Peterson & H.L. Barney (1952): \"Control methods used in a study "
  5159. "of the vowels.\" %%Journal of the Acoustical Society of America% #24: 175\\--184")
  5160. MAN_END
  5161. MAN_BEGIN (U"Pols et al. (1973)", U"djmw", 19990426)
  5162. NORMAL (U"L.C.W. Pols, H.R.C. Tromp & R. Plomp (1973): "
  5163. "\"Frequency analysis of Dutch vowels from 50 male speakers.\" "
  5164. "%%Journal of the Acoustical Society of America% #53: 1093\\--1101.")
  5165. MAN_END
  5166. MAN_BEGIN (U"Press et al. (1992)", U"djmw", 19980114)
  5167. NORMAL (U"W.H. Press, S.A. Teukolsky, W.T. Vetterling & B.P. Flannery (1992): "
  5168. "%%Numerical recipes in C: The art of scientific computing%. "
  5169. "Second Edition. Cambridge University Press.")
  5170. MAN_END
  5171. MAN_BEGIN (U"Sakoe & Chiba (1978)", U"djmw", 20050302)
  5172. NORMAL (U"H. Sakoe & S. Chiba (1978): \"Dynamic programming algorithm optimization for spoken word recognition.\" "
  5173. "%%Transactions on ASSP% #26: 43\\--49.")
  5174. MAN_END
  5175. MAN_BEGIN (U"Sandwell (1987)", U"djmw", 20170915)
  5176. NORMAL (U"D.T. Sandwell (1987): \"Biharmonic spline interpolation of GEOS-3 and SEASAT altimeter data.\", "
  5177. "%%Geophysica Research Letters% #14: 139\\--142.")
  5178. MAN_END
  5179. MAN_BEGIN (U"Sekey & Hanson (1984)", U"djmw", 20050302)
  5180. NORMAL (U"A. Sekey & B.A. Hanson (1984): \"Improved 1-Bark bandwidth auditory filter.\" "
  5181. "%%Journal of the Acoustical Society of America% #75: 1902\\--1904.")
  5182. MAN_END
  5183. MAN_BEGIN (U"Schott (2001)", U"djmw", 20090629)
  5184. NORMAL (U"J. R. Schott (2001): \"Some tests for the equality of covariance matrices.\" "
  5185. "%%Journal of Statistical Planning and Inference% #94: 25\\-–36.")
  5186. MAN_END
  5187. MAN_BEGIN (U"Shepard (1964)", U"djmw", 19980114)
  5188. NORMAL (U"R.N. Shepard (1964): \"Circularity in judgments of relative pitch.\" "
  5189. "%%Journal of the Acoustical Society of America% #36: 2346\\--2353.")
  5190. MAN_END
  5191. MAN_BEGIN (U"Slaney (1993)", U"djmw", 19980712)
  5192. NORMAL (U"M. Slaney (1993): \"An efficient implementation of the "
  5193. "Patterson-Holdsworth auditory filterbank.\" "
  5194. "%%Apple Computer Technical Report% #35, 41 pages.")
  5195. MAN_END
  5196. MAN_BEGIN (U"Tribolet et al. (1979)", U"djmw", 20010114)
  5197. NORMAL (U"J.M. Tribolet & T.F. Quatieri (1979): \"Computation of the Complex "
  5198. "Cepstrum.\" In %%Programs for Digital Signal Processing%, "
  5199. "Digital Signal Processing Committee (eds.), IEEE Press.")
  5200. MAN_END
  5201. MAN_BEGIN (U"Tukey (1977)", U"djmw", 20000524)
  5202. NORMAL (U"J.W. Tukey (1977): %%Exploratory data analysis%. Reading, MA: Addison-Wesley.")
  5203. MAN_END
  5204. MAN_BEGIN (U"Van Nierop et al. (1973)", U"djmw", 20020620)
  5205. NORMAL (U"D.J.P.J. Van Nierop, L.C.W. Pols & R. Plomp (1973): \"Frequency "
  5206. "analysis of Dutch vowels from 25 female speakers.\" %%Acustica% #29: 110\\--118")
  5207. MAN_END
  5208. MAN_BEGIN (U"Weenink (1985)", U"djmw", 20111010)
  5209. NORMAL (U"D.J.M. Weenink (1985), \"Formant analysis of Dutch vowels from 10 children\", "
  5210. "%%Proceedings of the Institute of Phonetic Sciences of the "
  5211. "University of Amsterdam% #9, 45\\--52.")
  5212. MAN_END
  5213. MAN_BEGIN (U"Watrous (1991)", U"djmw", 20080125)
  5214. NORMAL (U"R.L. Watrous (1991): \"Current status of Peterson-Barney vowel formant data.\" "
  5215. "%%Journal of the Acoustical Society of America% #89: 2459\\--2460.")
  5216. MAN_END
  5217. MAN_BEGIN (U"Weenink (1999)", U"djmw", 20041217)
  5218. NORMAL (U"D.J.M. Weenink (1999): \"Accurate algorithms for performing "
  5219. "principal component analysis and discriminant analysis.\" "
  5220. "%%Proceedings of the Institute of Phonetic Sciences of the "
  5221. "University of Amsterdam% #23: 77\\--89.")
  5222. MAN_END
  5223. MAN_BEGIN (U"Weenink (2003)", U"djmw", 20040225)
  5224. NORMAL (U"D.J.M. Weenink (2003): \"Canonical correlation analysis.\" "
  5225. "%%Proceedings of the Institute of Phonetic Sciences of the "
  5226. "University of Amsterdam% #25: 81\\--99.")
  5227. MAN_END
  5228. MAN_BEGIN (U"Wessel & Bercovici (1989)", U"djmw", 20170917)
  5229. NORMAL (U"P. Wessel & D. Bercovici (1998): \"Interpolation with splines in tension: a Green's function approach.\" "
  5230. "%%Mathematical Geology% #30: 77\\--93.")
  5231. MAN_END
  5232. }
  5233. /* End of file manual_dwtools.cpp */