Skip to content

Commit

Permalink
Squashed 'praat/' changes from 1601ce6b8..81259e1ad
Browse files Browse the repository at this point in the history
81259e1ad Merge pull request #1573 from PaulBoersma/master
94a82a9d5 make Praat start up on Windows
e5ed7bc9d fix Windows IO calls in Opus
a4b03cfd2 Merge pull request #1572 from PaulBoersma/master
52e22471e disambiguate config.h file name
c25a26ced for version 6.1.38
edd23c1fa Merge pull request #1571 from PaulBoersma/master
820d2bc0c missing files?
1e73dd1be compile Opus on Windows
d7665b783 Merge pull request #1570 from PaulBoersma/master
47b0cf2d6 prevent having to define a Praatwide config symbol just for Opus
957eaf175 Merge pull request #1569 from PaulBoersma/master
a24a4f237 winport moved to melder
eaf0311f6 Merge remote-tracking branch 'refs/remotes/praat/master'
0aab56a8a for version 6.1.38
2088d5a76 Merge pull request #1568 from davidweenink/master
3ea25e740 include opus licence
ff454b052 read opus files
c8e78a72d libopus
f900fc5af also needed
b67822c82 raw opus/celt and opus/silk
bfffc2f82 Ogg Opus audio files can be read on Linux
a5ef2d7d9 Merge branch 'master' into opus
09747ad0e start with read Ogg Opus files
e8556ef8a opusfile
0b2a516bb manual
15ea00628 Merge pull request #1567 from PaulBoersma/master
9e1239633 Big Sur 11.1 bold-italic
1bbb15996 Merge pull request #1566 from PaulBoersma/master
8b9b95c9e use the term "folder" instead of "directory"
ece4e1554 Merge pull request #1565 from PaulBoersma/master
3352bc763 Merge remote-tracking branch 'refs/remotes/praat/master'
e2e786e4a string vector documentation
02a0b21cc Merge pull request #1564 from PaulBoersma/master
87dc5e619 consistent names for tensor functions
2391b115b transpose_MAT
d89b4aea5 Merge pull request #1563 from PaulBoersma/master
bc0cd08a6 raw_MAT
60859a0be zero_MAT
57ce349ef Merge pull request #1562 from PaulBoersma/master
82444f3ea sort_VEC
3b0550247 Merge pull request #1561 from PaulBoersma/master
9bcce3e2d raw_VEC
db20d2d54 raw_INTVEC
d198dffbc zero_INTVEC
f2051fdcd Merge pull request #1560 from PaulBoersma/master
010da8534 zero_VEC
6281d64d6 Merge pull request #1559 from PaulBoersma/master
25bf3f6ee more consistent naming of tensor functions
4221e8911 Merge pull request #1558 from davidweenink/master
836f5e97a removed again old ogg reader
bc4294cd7 more tests for chaining
5715d2f22 Merge pull request #1557 from davidweenink/master
91f51ac72 Ogg Vorbis manual page
3e209d90e Merge https://github.com/praat/praat
4cb351ae7 Merge pull request #1556 from PaulBoersma/master
04cc4b243 _VEC
c7f95d39a Merge pull request #1555 from PaulBoersma/master
82b6cd2b8 fileNames$#
40d4ab24a Merge https://github.com/praat/praat
7e5ee30d8 Merge pull request #1554 from PaulBoersma/master
9f40e368f rid quadratic-time null substitution
e88f8dc84 fileNames$#
e991682f2 Merge pull request #1553 from davidweenink/master
13277a46b Merge https://github.com/praat/praat
a9535ce5f Table: List row numbers where...
f43e4bb8b Merge pull request #1552 from davidweenink/master
cda97251e style
80331c0d3 Merge pull request #1551 from davidweenink/master
6e455785a example vorbis audio file
16147d178 removed code based on buggy vorbisfile_example.c
56e884e45 ogg vorbis audio works on Linux
f06df0596 Merge pull request #1550 from PaulBoersma/master
fc2993017 Vorbis license
f37c386b2 Merge pull request #1549 from PaulBoersma/master
61d0f3b73 folders$#
33612fc5e Merge pull request #1548 from davidweenink/master
0b2fac790 rename shadowed variable
144ca8642 use nullptr
5f5f284bc KlattGlobal_create should not crash
cb95027f7 Merge pull request #1547 from PaulBoersma/master
0026d58fa files_STRVEC
65b65b805 safer STRVEC insert and append
618ff7148 clean up melder_alloc
839e694cf MelderFile_readLine explicitly 8-bit
528302de9 vorbis compiles and links
897d642a6 four potential buffer overflows
bfb52f4b2 Merge branch 'master' into ogg
d8b1c1384 Merge https://github.com/praat/praat
1439a5efb vorbis, more code cleanup
5172a0ea1 Merge pull request #1546 from PaulBoersma/master
1182152f1 splitByWhitespace_STRVEC, readFile_STRVEC, left_STR
bd077d19d corrected compiler warning about shadowed variables
cb044ab39 (incomplete) vorbis compiles
5d7262b36 Merge pull request #1545 from PaulBoersma/master
86173f89b manual
e95f40989 Merge pull request #1544 from PaulBoersma/master
19fe03afa turned inline static in header files into just inline
20ac62aff Merge pull request #1543 from PaulBoersma/master
cd6f5c208 STRVEC_readFile
cb194d606 ogg compiles with Melder_malloc
53ba25d8a resizable STRVEC
80f84bc95 ogg
5731dd9b8 prepare for ogg vorbis
cbb028c3a stack corrections
ca370e24b Merge pull request #1541 from PaulBoersma/master
3275b3fe6 basic use of string vectors in scripts
4276c8aef Merge pull request #1540 from davidweenink/master
1665e91bf improved manual on getting a cepstral peak prominence value
4ae0618d4 Merge pull request #1539 from PaulBoersma/master
34fa8a5bc Merge pull request #1538 from PaulBoersma/master
5f3786f45 for version 6.1.37
56af5f52e rid crash with TextGrid: Get points (preceded)
2b4149bd7 Merge pull request #1537 from PaulBoersma/master
771766048 rid crash in Sound_record_fixedTime
2d5208977 Merge pull request #1535 from PaulBoersma/master
b1be02a1b rid TextGridEditor crash command-clicking a boundary when a point was selected
833949107 two new contributors
ac75c2cbd Merge pull request #1534 from PaulBoersma/master
862edbec6 inline variables (rid 3 TODOs)
fc725224d clearer and more uniform checking
3a3093cdb some Melder_require
d975928d6 disallow tryToWriteFile inside manuals
28f83202d Merge pull request #1532 from davidweenink/master
2825f9a00 PoerCepstrogram: replace square smoothing by integration
dcfc4fe1f Merge https://github.com/praat/praat
0c4350a18 Merge pull request #1531 from PaulBoersma/master
8f6180def for version 6.1.36
3ca755fa5 Merge pull request #1530 from PaulBoersma/master
6c5e17568 IPA chart: sacrifice laminality symbol for breathiness symbol
3501a5f7d better rectangular smoothing by integration
9a36ec52c more spaces around <<= if a tensor copy
e3576eca4 VECclip interface changed, gaussian smoothing
5c37b75fb Merge https://github.com/praat/praat
b451304e7 gaussian smoothing inplace
e619fa866 INTVECto
1b8050469 Merge pull request #1528 from PaulBoersma/master
89740a3f4 more spaces around <<= if a tensor copy
6717931b5 Merge pull request #1527 from PaulBoersma/master
1e93ecd39 numINTVECto
27018d921 Merge remote-tracking branch 'refs/remotes/praat/master'
5317465e1 first time version 6.1.36
961adabc7 INTVEC linear range functions
bf6b31a36 Merge pull request #1526 from PaulBoersma/master
accf19230 tryToWriteFile(), tryToAppendFile()
4c22b4934 obscured scripts: no undisclosed error messages
819aa8a4c formulas can now have size 1 million
a2500f526 Merge pull request #1525 from davidweenink/master
4189c399b Linux: prepare for pulseAudio recording
e116a5c2f PowerCepstrum: preparation for Gaussian smoothing
43b57157a Merge pull request #1524 from PaulBoersma/master
53cf8c3a7 for version 6.1.35
6fa714468 Merge pull request #1523 from PaulBoersma/master
338664e55 Mac correct line numbers in text files with high Unicode (since 6.1.04)
94a513862 sort#(), shuffle#(), between_count#(), from_to_count#(), and doc
49b6b4884 VECshuffle
27675301d exitScript() percolates from obscured scripts
f62679cf7 default icon on files
bf135faad rid FormantPathEditor warnings
70492cf59 Merge pull request #1522 from PaulBoersma/master
c9a2df3c5 TextGridEditor font is stable
eeb58bf60 correct Undo in the Demo window
945680caa Merge pull request #1521 from davidweenink/master
6dcecbb7b typo
70f4cdd7e Merge pull request #1520 from PaulBoersma/master
0ea853112 Merge pull request #1519 from PaulBoersma/master
ad3b75491 for version 6.1.34
e2006e446 GTK 3 deprecation warning
d4d1af1ea Merge remote-tracking branch 'refs/remotes/praat/master'
f265331d7 rid crash when drawing a Matrix with xmin == xmax
077a925b1 Merge pull request #1517 from PaulBoersma/master
c47fe9614 Linux icon
f506b4379 standard character kerning on the Mac
3860e79e4 update Mac development guide
57911502e Merge pull request #1516 from PaulBoersma/master
37b7d4b99 bold and italic on BigSur
1a0beae98 better minimum size of editors
482bf4c45 Merge pull request #1515 from PaulBoersma/master
4e18f3b7e SoundRecorder white background on all platforms
d2ef2f9aa Merge pull request #1514 from PaulBoersma/master
c60f19a63 Linux new PortAudio, for version 6.1.33
fd77ae025 Merge pull request #1513 from PaulBoersma/master
d905e18cd Linux new PortAudio
4c7ffbdc5 Merge pull request #1512 from PaulBoersma/master
54fc16a0f Merge remote-tracking branch 'refs/remotes/praat/master'
9939a162f delete two unused files
ebd19127b Mac: made audio work on Praat versions compiled with the BigSur API
4c0c96d2e Merge pull request #1511 from davidweenink/master
4bab0b74d try to find optimal path
2acd43a0c Merge https://github.com/praat/praat
8dd525567 Merge pull request #1510 from PaulBoersma/master
2f0d48631 documenting project for universal executable
c72083026 Merge pull request #1509 from davidweenink/master
c6676e005 Merge https://github.com/praat/praat
0e5e67fef adjust for compiler warnings
cc274b347 needs overrides
1b6c7c45c Merge pull request #1507 from PaulBoersma/master
1b9f85ae8 document universal executable
d78e56143 Merge pull request #1506 from PaulBoersma/master
f175cd87f document universal executable
557a071e7 header file compatibility
72017226b Merge pull request #1505 from PaulBoersma/master
3f3bf3b2f for version 6.1.32
86f0d4817 slighter better formant dots on Windows
b79fb1b53 Merge remote-tracking branch 'refs/remotes/praat/master'
fdf5f1fb2 Insert picture from file: don't draw twice
8670f056e Merge pull request #1504 from PaulBoersma/master
c36511a34 Mac: fixed an old bug that could make Praat crash after closing a Sound window in a script
0e7d3825f typo
a1f904a79 bool with three values bug
b1230bdc5 code improves by hunting warnings
a3c884c00 Merge pull request #1501 from adriaandegroot/split-external-build
cb73cce5d Makefiles: split external build from Praat-itself
6cf782bd3 fix crash when drawing a Photo with only one column of pixels
c77fa2034 Merge pull request #1499 from davidweenink/master
e406f773a typo
5b437a7f9 Merge pull request #1498 from davidweenink/master
0186d6252 style
febc408ca Merge https://github.com/praat/praat
f6278cbca style
e16e3686c improved feedback for selected ceilings in editor
38850d71e NO_GRAPHICS entails NO_GUI
998552cba Merge pull request #1497 from PaulBoersma/master
421f1bf0e Linux: rid ALLOW_GDK_DRAWING
57f5d7d4d improved viewing of selected ceilings in path
044e8c1f0 Merge pull request #1496 from PaulBoersma/master
e97a4070b lose half of the instances of ALLOW_GDK_DRAWING
4fab71f58 Linux: reinstall tab callbacks
bc36f78fe Raspberry Pi: fixed GTK accelerator group message
87d8221d2 Merge pull request #1495 from PaulBoersma/master
1dee2e4ec Mac: made "Text width..." work correctly from batch
c7976e357 Merge pull request #1494 from PaulBoersma/master
1f2d14fbe Windows: made "Text width..." work correctly from batch
2fc3bc834 Merge pull request #1162 from newbluemoon/jack
9ec272add Merge pull request #1493 from PaulBoersma/master
d97ea8392 Linux: make "Text width..." work correctly from batch
8ab5ac698 Merge https://github.com/praat/praat
2e61aae31 Merge pull request #1492 from PaulBoersma/master
7a9db09f7 Linux: desktop file and icon
2778b49fd Merge pull request #1491 from PaulBoersma/master
e60095d8c for version 6.1.31
3e0e1d050 Merge pull request #1490 from PaulBoersma/master
8018bc85c for version 6.1.31
f26ca7124 Merge pull request #1489 from PaulBoersma/master
edc2a50b1 GTK 3: font size in Info and script windows
7ef1b62f0 Merge https://github.com/praat/praat
5d0644d66 Merge pull request #1488 from PaulBoersma/master
7c31fe74a GTK 3: correct text width even outside expose
ed931f736 Polynomial: removed unused code
fe0f4f593 Merge pull request #1487 from davidweenink/master
54b7eafaf removed unused code
0d3667ec9 Merge pull request #1486 from PaulBoersma/master
dab9db0ea order updateWs after the other updates
dfdc43c9e Merge pull request #1485 from PaulBoersma/master
2e98b2af1 fix HyperPage scrolling
b95c525dc Merge pull request #1484 from davidweenink/master
41969ca64 VowelEditor: removed recursion. Fully functional now
97083e1d5 Merge https://github.com/praat/praat
8d8bc8adf Merge pull request #1483 from PaulBoersma/master
379346197 GTK 3: make manual and Sound window swipable
7988a4ec3 Merge https://github.com/praat/praat
d7baa9b77 Merge pull request #1482 from PaulBoersma/master
f18a5c9ef GTK 3: better window shrinking
2c47cbed5 Merge https://github.com/praat/praat
65621b5d0 Merge pull request #1481 from PaulBoersma/master
b4944fb7b Linux: better scrolling at the edges
22b561b1a Merge pull request #1480 from PaulBoersma/master
38bbd7675 GTK 3: more buggy window shrinking
96c3a7b90 Merge pull request #1479 from PaulBoersma/master
502efb294 GTK 3: an ugly way to shrink a window
d3069721a Merge pull request #1478 from PaulBoersma/master
95adb71de rid Graphics_flushWs()
9c46ae0df Merge pull request #1477 from PaulBoersma/master
1bc82efae GTK 3: fixed visibility and clipping of drawing areas
574c22df3 Merge pull request #1476 from PaulBoersma/master
a4c92983d GTK 3: label alignment
1fbff9d03 Merge https://github.com/praat/praat
5db421ed4 for version 6.1.30
0ae214e61 make stress undefined if number of parameters larger than number of data
d26ab2ce2 Merge pull request #1475 from PaulBoersma/master
e44affe5a for version 6.1.30
637263b9c fewer assumptions about the order click–drag–drop
9a8e290be Merge https://github.com/praat/praat
1d218cd23 Merge pull request #1474 from PaulBoersma/master
8e69ea552 looking for resize and Picture redraw bugs
570ea6328 Merge pull request #1473 from PaulBoersma/master
48a1afb35 GTK 3: align menu buttons in Objects window
9a5487793 Merge pull request #1472 from PaulBoersma/master
ecb394d21 GTK 3: restore rudimentary version of sendpraat sensitivity
b02b9057f Merge https://github.com/praat/praat
628e7f683 Merge https://github.com/praat/praat
9c312d4a1 manual page: description of Sound: To FormantPath algorithm
e745ec8c5 pa_jack.c: fix conditional usage

git-subtree-dir: praat
git-subtree-split: 81259e1ad014fe724c937043b5b3438a954c056f
  • Loading branch information
YannickJadoul committed Feb 4, 2021
1 parent 0d21298 commit e8fff12
Show file tree
Hide file tree
Showing 640 changed files with 102,880 additions and 10,860 deletions.
10 changes: 5 additions & 5 deletions EEG/EEG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,25 +159,25 @@ autoEEG EEG_readFromBdfFile (MelderFile file) {
fread (buffer, 1, 8, f);
buffer [8] = '\0'; // physical dimension of channels
}
autoVEC physicalMinimum = newVECraw (numberOfChannels);
autoVEC physicalMinimum = raw_VEC (numberOfChannels);
for (integer ichannel = 1; ichannel <= numberOfChannels; ichannel ++) {
fread (buffer, 1, 8, f);
buffer [8] = '\0';
physicalMinimum [ichannel] = atof (buffer);
}
autoVEC physicalMaximum = newVECraw (numberOfChannels);
autoVEC physicalMaximum = raw_VEC (numberOfChannels);
for (integer ichannel = 1; ichannel <= numberOfChannels; ichannel ++) {
fread (buffer, 1, 8, f);
buffer [8] = '\0';
physicalMaximum [ichannel] = atof (buffer);
}
autoVEC digitalMinimum = newVECraw (numberOfChannels);
autoVEC digitalMinimum = raw_VEC (numberOfChannels);
for (integer ichannel = 1; ichannel <= numberOfChannels; ichannel ++) {
fread (buffer, 1, 8, f);
buffer [8] = '\0';
digitalMinimum [ichannel] = atof (buffer);
}
autoVEC digitalMaximum = newVECraw (numberOfChannels);
autoVEC digitalMaximum = raw_VEC (numberOfChannels);
for (integer ichannel = 1; ichannel <= numberOfChannels; ichannel ++) {
fread (buffer, 1, 8, f);
buffer [8] = '\0';
Expand Down Expand Up @@ -210,7 +210,7 @@ autoEEG EEG_readFromBdfFile (MelderFile file) {
his numberOfChannels = numberOfChannels;
autoSound me = Sound_createSimple (numberOfChannels, duration, samplingFrequency);
Melder_assert (my nx == numberOfSamplesPerDataRecord * numberOfDataRecords);
autoBYTEVEC dataBuffer = newBYTEVECzero (3 * numberOfSamplesPerDataRecord);
autoBYTEVEC dataBuffer = zero_BYTEVEC (3 * numberOfSamplesPerDataRecord);
for (integer record = 1; record <= numberOfDataRecords; record ++) {
for (integer channel = 1; channel <= numberOfChannels; channel ++) {
double factor = ( channel == numberOfChannels ? 1.0 : physicalMinimum [channel] / digitalMinimum [channel] );
Expand Down
116 changes: 54 additions & 62 deletions EEG/ERPWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,11 @@ static BiosemiLocationData biosemiCapCoordinates32 [1+32] =
};

void ERP_drawScalp_garnish (Graphics graphics, double vmin, double vmax, enum kGraphics_colourScale colourScale) {
integer n = 201;
autoMAT legend = newMATraw (n, 2);
for (integer irow = 1; irow <= n; irow ++) {
for (integer icol = 1; icol <= 2; icol ++) {
const integer n = 201;
autoMAT legend = raw_MAT (n, 2);
for (integer irow = 1; irow <= n; irow ++)
for (integer icol = 1; icol <= 2; icol ++)
legend [irow] [icol] = (irow - 1) / (n - 1.0);
}
}
Graphics_setColourScale (graphics, colourScale);
Graphics_image (graphics, legend.all(), 0.85, 0.98, -0.8, +0.8, 0.0, 1.0);
Graphics_setColourScale (graphics, kGraphics_colourScale::GREY);
Expand All @@ -173,33 +171,30 @@ void ERP_drawScalp (ERP me, Graphics graphics, double tmin, double tmax, double
//Graphics_setGrey (graphics, 1.0);
//Graphics_fillRectangle (graphics, -1.1, 1.1, -1.01, 1.19);
//Graphics_setColour (graphics, Melder_BLACK);
integer numberOfDrawableChannels =
const integer numberOfDrawableChannels =
my ny >= 64 && Melder_equ (my channelNames [64].get(), U"O2") ? 64 :
my ny >= 32 && Melder_equ (my channelNames [32].get(), U"Cz") ? 32 :
0;
BiosemiLocationData *biosemiLocationData = numberOfDrawableChannels == 64 ? biosemiCapCoordinates64 : numberOfDrawableChannels == 32 ? biosemiCapCoordinates32 : 0;
for (integer ichan = 1; ichan <= numberOfDrawableChannels; ichan ++) {
double inclination = (double) biosemiLocationData [ichan]. inclination;
double azimuth = (double) biosemiLocationData [ichan]. azimuth;
bool rightHemisphere = inclination >= 0.0;
double r = fabs (inclination / 115.0);
double theta = rightHemisphere ? azimuth * (NUMpi / 180.0) : (azimuth + 180.0) * (NUMpi / 180.0);
const double inclination = (double) biosemiLocationData [ichan]. inclination;
const double azimuth = (double) biosemiLocationData [ichan]. azimuth;
const bool rightHemisphere = ( inclination >= 0.0 );
const double r = fabs (inclination / 115.0);
const double theta = rightHemisphere ? azimuth * (NUMpi / 180.0) : (azimuth + 180.0) * (NUMpi / 180.0);
biosemiLocationData [ichan]. topX = r * cos (theta);
biosemiLocationData [ichan]. topY = r * sin (theta);
}
integer n = 201;
double d = 2.0 / (n - 1);
autoVEC mean = newVECraw (numberOfDrawableChannels);
for (integer ichan = 1; ichan <= numberOfDrawableChannels; ichan ++) {
mean [ichan] = tmin == tmax ?
Sampled_getValueAtX (me, tmin, ichan, 0, true) :
Vector_getMean (me, tmin, tmax, ichan);
}
autoMAT image = newMATraw (n, n);
const integer n = 201;
const double d = 2.0 / (n - 1);
autoVEC mean = raw_VEC (numberOfDrawableChannels);
for (integer ichan = 1; ichan <= numberOfDrawableChannels; ichan ++)
mean [ichan] = ( tmin == tmax ? Sampled_getValueAtX (me, tmin, ichan, 0, true) : Vector_getMean (me, tmin, tmax, ichan) );
autoMAT image = raw_MAT (n, n);
for (integer irow = 1; irow <= n; irow ++) {
double y = -1.0 + (irow - 1) * d;
const double y = -1.0 + (irow - 1) * d;
for (integer icol = 1; icol <= n; icol ++) {
double x = -1.0 + (icol - 1) * d;
const double x = -1.0 + (icol - 1) * d;
if (x * x + y * y <= 1.0) {
double value = undefined;
longdouble sum = 0.0, weight = 0.0;
Expand All @@ -221,34 +216,33 @@ void ERP_drawScalp (ERP me, Graphics graphics, double tmin, double tmax, double
}
}
}
double whiteValue = colourScale == kGraphics_colourScale::BLUE_TO_RED ? 0.5 * (vmin + vmax) : vmin;
const double whiteValue = ( colourScale == kGraphics_colourScale::BLUE_TO_RED ? 0.5 * (vmin + vmax) : vmin );
Graphics_setColourScale (graphics, colourScale);
for (integer irow = 1; irow <= n; irow ++) {
double y = -1.0 + (irow - 1) * d;
const double y = -1.0 + (irow - 1) * d;
for (integer icol = 1; icol <= n; icol ++) {
double x = -1.0 + (icol - 1) * d;
if (x * x + y * y > 1.0) {
const double x = -1.0 + (icol - 1) * d;
if (x * x + y * y > 1.0)
image [irow] [icol] = whiteValue;
}
}
}
Graphics_image (graphics, image.all(), -1.0-0.5/n, 1.0+0.5/n, -1.0-0.5/n, 1.0+0.5/n, vmin, vmax);
Graphics_setColourScale (graphics, kGraphics_colourScale::GREY);
Graphics_setLineWidth (graphics, 2.0);
/*
* Nose.
*/
Nose.
*/
Graphics_setGrey (graphics, colourScale == kGraphics_colourScale::BLUE_TO_RED ? 1.0 : 0.5);
{// scope
double x [3] = { -0.08, 0.0, 0.08 }, y [3] = { 0.99, 1.18, 0.99 };
const double x [3] = { -0.08, 0.0, 0.08 }, y [3] = { 0.99, 1.18, 0.99 };
Graphics_fillArea (graphics, 3, x, y);
}
Graphics_setColour (graphics, Melder_BLACK);
Graphics_line (graphics, -0.08, 0.99, 0.0, 1.18);
Graphics_line (graphics, 0.08, 0.99, 0.0, 1.18);
/*
* Ears.
*/
Ears.
*/
Graphics_setGrey (graphics, colourScale == kGraphics_colourScale::BLUE_TO_RED ? 1.0 : 0.5);
Graphics_fillRectangle (graphics, -1.09, -1.00, -0.08, 0.08);
Graphics_fillRectangle (graphics, 1.09, 1.00, -0.08, 0.08);
Expand All @@ -260,14 +254,13 @@ void ERP_drawScalp (ERP me, Graphics graphics, double tmin, double tmax, double
Graphics_line (graphics, 1.09, 0.08, 1.09, -0.08);
Graphics_line (graphics, 1.09, -0.08, 0.99, -0.08);
/*
* Scalp.
*/
Scalp.
*/
Graphics_ellipse (graphics, -1.0, 1.0, -1.0, 1.0);
Graphics_setLineWidth (graphics, 1.0);
Graphics_unsetInner (graphics);
if (garnish) {
if (garnish)
ERP_drawScalp_garnish (graphics, vmin, vmax, colourScale);
}
}

void structERPWindow :: v_drawSelectionViewer () {
Expand All @@ -276,40 +269,39 @@ void structERPWindow :: v_drawSelectionViewer () {
Graphics_setColour (our graphics.get(), Melder_WINDOW_BACKGROUND_COLOUR);
Graphics_fillRectangle (our graphics.get(), -1.1, 1.1, -1.01, 1.19);
Graphics_setColour (our graphics.get(), Melder_BLACK);
integer numberOfDrawableChannels =
const integer numberOfDrawableChannels =
erp -> ny >= 64 && Melder_equ (erp -> channelNames [64].get(), U"O2") ? 64 :
erp -> ny >= 32 && Melder_equ (erp -> channelNames [32].get(), U"Cz") ? 32 :
0;
BiosemiLocationData *biosemiLocationData = numberOfDrawableChannels == 64 ? biosemiCapCoordinates64 : numberOfDrawableChannels == 32 ? biosemiCapCoordinates32 : 0;
for (integer ichan = 1; ichan <= numberOfDrawableChannels; ichan ++) {
double inclination = (double) biosemiLocationData [ichan]. inclination;
double azimuth = (double) biosemiLocationData [ichan]. azimuth;
bool rightHemisphere = inclination >= 0.0;
double r = fabs (inclination / 115.0);
double theta = rightHemisphere ? azimuth * (NUMpi / 180.0) : (azimuth + 180.0) * (NUMpi / 180.0);
const double inclination = (double) biosemiLocationData [ichan]. inclination;
const double azimuth = (double) biosemiLocationData [ichan]. azimuth;
const bool rightHemisphere = inclination >= 0.0;
const double r = fabs (inclination / 115.0);
const double theta = rightHemisphere ? azimuth * (NUMpi / 180.0) : (azimuth + 180.0) * (NUMpi / 180.0);
biosemiLocationData [ichan]. topX = r * cos (theta);
biosemiLocationData [ichan]. topY = r * sin (theta);
}
integer n = 201;
double d = 2.0 / (n - 1);
autoVEC means = newVECraw (numberOfDrawableChannels);
for (integer ichan = 1; ichan <= numberOfDrawableChannels; ichan ++) {
const integer n = 201;
const double d = 2.0 / (n - 1);
autoVEC means = raw_VEC (numberOfDrawableChannels);
for (integer ichan = 1; ichan <= numberOfDrawableChannels; ichan ++)
means [ichan] =
our startSelection == our endSelection ?
Sampled_getValueAtX (erp, our startSelection, ichan, 0, true) :
Vector_getMean (erp, our startSelection, our endSelection, ichan);
}
autoMAT image = newMATraw (n, n);
autoMAT image = raw_MAT (n, n);
for (integer irow = 1; irow <= n; irow ++) {
double y = -1.0 + (irow - 1) * d;
const double y = -1.0 + (irow - 1) * d;
for (integer icol = 1; icol <= n; icol ++) {
double x = -1.0 + (icol - 1) * d;
const double x = -1.0 + (icol - 1) * d;
if (x * x + y * y <= 1.0) {
double value = undefined;
longdouble sum = 0.0, weight = 0.0;
for (integer ichan = 1; ichan <= numberOfDrawableChannels; ichan ++) {
double dx = x - biosemiLocationData [ichan]. topX;
double dy = y - biosemiLocationData [ichan]. topY;
const double dx = x - biosemiLocationData [ichan]. topX;
const double dy = y - biosemiLocationData [ichan]. topY;
double distance = sqrt (dx * dx + dy * dy);
if (distance < 1e-12) {
value = means [ichan];
Expand Down Expand Up @@ -346,9 +338,9 @@ void structERPWindow :: v_drawSelectionViewer () {
maximum = absoluteExtremum;
}
for (integer irow = 1; irow <= n; irow ++) {
double y = -1.0 + (irow - 1) * d;
const double y = -1.0 + (irow - 1) * d;
for (integer icol = 1; icol <= n; icol ++) {
double x = -1.0 + (icol - 1) * d;
const double x = -1.0 + (icol - 1) * d;
if (x * x + y * y > 1.0) {
image [irow] [icol] = minimum +
( our p_scalp_colourScale == kGraphics_colourScale::BLUE_TO_RED ? 0.46 : 0.1875 ) * (maximum - minimum);
Expand All @@ -361,19 +353,19 @@ void structERPWindow :: v_drawSelectionViewer () {
Graphics_setColourScale (our graphics.get(), kGraphics_colourScale::GREY);
Graphics_setLineWidth (our graphics.get(), 2.0);
/*
* Nose.
*/
Nose.
*/
Graphics_setGrey (our graphics.get(), our p_scalp_colourScale == kGraphics_colourScale::BLUE_TO_RED ? 1.0 : 0.5);
{// scope
double x [3] = { -0.08, 0.0, 0.08 }, y [3] = { 0.99, 1.18, 0.99 };
const double x [3] = { -0.08, 0.0, 0.08 }, y [3] = { 0.99, 1.18, 0.99 };
Graphics_fillArea (our graphics.get(), 3, x, y);
}
Graphics_setColour (our graphics.get(), Melder_BLACK);
Graphics_line (our graphics.get(), -0.08, 0.99, 0.0, 1.18);
Graphics_line (our graphics.get(), 0.08, 0.99, 0.0, 1.18);
/*
* Ears.
*/
Ears.
*/
Graphics_setGrey (our graphics.get(), our p_scalp_colourScale == kGraphics_colourScale::BLUE_TO_RED ? 1.0 : 0.5);
Graphics_fillRectangle (our graphics.get(), -1.09, -1.00, -0.08, 0.08);
Graphics_fillRectangle (our graphics.get(), 1.09, 1.00, -0.08, 0.08);
Expand All @@ -385,8 +377,8 @@ void structERPWindow :: v_drawSelectionViewer () {
Graphics_line (our graphics.get(), 1.09, 0.08, 1.09, -0.08);
Graphics_line (our graphics.get(), 1.09, -0.08, 0.99, -0.08);
/*
* Scalp.
*/
Scalp.
*/
Graphics_ellipse (our graphics.get(), -1.0, 1.0, -1.0, 1.0);
Graphics_setLineWidth (our graphics.get(), 1.0);
}
Expand Down
28 changes: 14 additions & 14 deletions FFNet/FFNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ static void bookkeeping (FFNet me) {
The following test is essential because when an FFNet is read from file the w array already exists
*/
if (NUMisEmpty (my w))
my w = newVECzero (my numberOfWeights);

my activity = newVECzero (my numberOfNodes);
my isbias = newINTVECzero (my numberOfNodes);
my nodeFirst = newINTVECzero (my numberOfNodes);
my nodeLast = newINTVECzero (my numberOfNodes);
my wFirst = newINTVECzero (my numberOfNodes);
my wLast = newINTVECzero (my numberOfNodes);
my wSelected = newINTVECzero (my numberOfWeights);
my error = newVECzero (my numberOfNodes);
my deriv = newVECzero (my numberOfNodes);
my dwi = newVECzero (my numberOfWeights);
my dw = newVECzero (my numberOfWeights);
my w = zero_VEC (my numberOfWeights);

my activity = zero_VEC (my numberOfNodes);
my isbias = zero_INTVEC (my numberOfNodes);
my nodeFirst = zero_INTVEC (my numberOfNodes);
my nodeLast = zero_INTVEC (my numberOfNodes);
my wFirst = zero_INTVEC (my numberOfNodes);
my wLast = zero_INTVEC (my numberOfNodes);
my wSelected = zero_INTVEC (my numberOfWeights);
my error = zero_VEC (my numberOfNodes);
my deriv = zero_VEC (my numberOfNodes);
my dwi = zero_VEC (my numberOfWeights);
my dw = zero_VEC (my numberOfWeights);
my numberOfOutputs = my numberOfUnitsInLayer [my numberOfLayers];
my isbias [my numberOfInputs + 1] = 1;
my activity [my numberOfInputs + 1] = 1.0;
Expand Down Expand Up @@ -205,7 +205,7 @@ void FFNet_init (FFNet me, integer numberOfInputs, integer nodesInLayer1, intege
if (nodesInLayer2 < 1)
numberOfLayers --;
my numberOfLayers = numberOfLayers;
my numberOfUnitsInLayer = newINTVECzero (numberOfLayers);
my numberOfUnitsInLayer = zero_INTVEC (numberOfLayers);

my numberOfUnitsInLayer [numberOfLayers --] = numberOfOutputs;
if (nodesInLayer2 > 0)
Expand Down
2 changes: 1 addition & 1 deletion FFNet/FFNet_PatternList_ActivationList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void _FFNet_PatternList_ActivationList_learn (FFNet me, PatternList patte
FFNet_setCostFunction (me, costFunctionType);

if (reset) {
autoVEC wbuf = newVECzero (my dimension);
autoVEC wbuf = zero_VEC (my dimension);
integer k = 1;
for (integer i = 1; i <= my numberOfWeights; i ++)
if (my wSelected [i])
Expand Down
24 changes: 13 additions & 11 deletions LPC/Cepstrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@

Thing_implement (Cepstrum, Matrix, 2);

double structCepstrum :: v_getValueAtSample (integer isamp, integer which, int /* units */) {
if (which == 0) {
return z [1] [isamp];
} else {
// dB's
return 20.0 * log10 (fabs (z [1] [isamp]) + 1e-30);
double structCepstrum :: v_getValueAtSample (integer isamp, integer which, int units) {
if (which == 1) {
if (units == 0)
return z [1] [isamp];
else
return 20.0 * log10 (fabs (z [1] [isamp]) + 1e-30); // dB's
}
return undefined;
}
Expand Down Expand Up @@ -68,16 +68,18 @@ void Cepstrum_draw (Cepstrum me, Graphics g, double qmin, double qmax, double mi
integer numberOfSelected = Matrix_getWindowSamplesX (me, qmin, qmax, & imin, & imax);
if (numberOfSelected == 0)
return;
autoVEC y = newVECraw (numberOfSelected);

autoVEC y = raw_VEC (numberOfSelected);
for (integer i = 1; i <= numberOfSelected; i ++)
y [i] = my v_getValueAtSample (imin + i - 1, (power ? 1 : 0), 0);
y [i] = my v_getValueAtSample (imin + i - 1, 1, (power ? 1 : 0));

if (minimum >= maximum) // autoscaling
NUMextrema (y.get(), & minimum, & maximum);
else
VECclip_inplace (y.get(), minimum, maximum);

VECclip_inplace (minimum, y.get(), maximum);
if (maximum == minimum) {
maximum += 1.0;
minimum -= 1.0;
}
Graphics_setWindow (g, qmin, qmax, minimum, maximum);
Graphics_function (g, y.asArgumentToFunctionThatExpectsOneBasedArray(), 1, numberOfSelected, Matrix_columnToX (me, imin), Matrix_columnToX (me, imax));

Expand Down
3 changes: 1 addition & 2 deletions LPC/Cepstrum_and_Spectrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ autoCepstrum Spectrum_to_Cepstrum_hillenbrand (Spectrum me) {
const integer numberOfSamples = my nx - 1;
autoCepstrum thee = Cepstrum_create (0.5 / my dx, my nx);
NUMfft_Table_init (& fftTable, my nx);
autoVEC amp = newVECraw (my nx);

autoVEC amp = raw_VEC (my nx);
for (integer i = 1; i <= my nx; i ++)
amp [i] = my v_getValueAtSample (i, 0, 2);
NUMfft_forward (& fftTable, amp.get());
Expand Down
Loading

0 comments on commit e8fff12

Please sign in to comment.