edfcore 0.5.41 → 0.5.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -109,5 +109,5 @@ export declare const SIGNAL_FIELD_BLOCK_OFFSETS: {
109
109
  readonly reserved: 224;
110
110
  };
111
111
  /** Published package version. Kept in sync with package.json by a test. */
112
- export declare const VERSION = "0.5.41";
112
+ export declare const VERSION = "0.5.43";
113
113
  //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -79,5 +79,5 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
79
79
  reserved: 224,
80
80
  };
81
81
  /** Published package version. Kept in sync with package.json by a test. */
82
- export const VERSION = '0.5.41';
82
+ export const VERSION = '0.5.43';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,51 @@ alone does not tell you whether you were affected.
6
6
  edfcore is pre-1.0. Patch releases have carried behaviour changes where the old behaviour was a
7
7
  defect; those are called out below.
8
8
 
9
+ ## 0.5.43
10
+
11
+ - **Added** the two halves of what a sample width decides, written side by side. EDF stores each
12
+ sample in two bytes and BDF in three; that is the whole difference between the families as far as
13
+ the data records go, and `decodeDigital` keeps it where it belongs. The suite tested each width
14
+ against expected values and never one against the other.
15
+ - For a value both widths can hold, the two files disagree about everything except the number: the
16
+ record is half again as long, the declared digital range is 256 times wider, `bitValue` differs by
17
+ the same factor — and the decoded samples are bit-identical. That is "the width is an encoding",
18
+ asserted where it could fail.
19
+ - For a value only BDF can hold, the EDF file does not hold it. Two bytes cannot carry −300,000, so
20
+ what is written is the low sixteen bits and what comes back is those bits sign-extended: 27,680.
21
+ edfcore reports it with no diagnostic and no `outOfDigitalRangeCount`, which is correct and worth
22
+ writing down — the file is well formed, 27,680 is inside its declared range, and the loss happened
23
+ before edfcore saw a byte. Nothing in an EDF header can record that a writer had a number it could
24
+ not store.
25
+ - The whole low-bits sequence is asserted rather than the first value, and the same waveform in the
26
+ two families is shown to be two different recordings carrying identical diagnostics — which is the
27
+ point. `out-of-range.test.ts` covers the other case, a sample outside the DECLARED range in a
28
+ width that can hold it; this is the case where the width itself is the limit.
29
+
30
+ ## 0.5.42
31
+
32
+ - **Added** the transformation that changes what the samples MEAN without changing the samples.
33
+ Rewriting `physicalMinimum`/`physicalMaximum` in the header leaves every stored integer identical
34
+ — `decodeDigital` never looks at the range and `toPhysical` never looks at the bytes — and moves
35
+ everything derived from it onto the new scale. Nothing tested the two against each other:
36
+ `physical-values.md` is checked against printed numbers and `out-of-range.test.ts` against the
37
+ digital path, and the relationship between them was prose.
38
+ - The interesting half is the part that does **not** hold. Multiplying the declared range by ten
39
+ multiplies `bitValue` by exactly ten and leaves `offset` untouched — both exact in float64 — and
40
+ yet a quarter of the converted values are not exactly ten times their counterpart.
41
+ `bitValue * (offset + digital)` is a float64 multiply, and scaling an operand is not the same
42
+ operation as scaling the result.
43
+ - That is worth pinning because it is a mistake a caller makes on purpose. Given microvolts and
44
+ wanting millivolts, the obvious move is to divide the values, and the obvious check is that
45
+ dividing the declared range agrees. It does not, in the last place, for a quarter of the range —
46
+ and the last place is what `physical-values.md` spends a page refusing to be casual about.
47
+ - So four things are asserted together: the digital path is bit-identical under the transformation
48
+ and so are the structural numbers and the observed digital range; the scale moves by exactly the
49
+ factor the declaration moved by; every converted value is on its own declared scale exactly; and
50
+ the rescaling identity fails, by at most one unit in the last place and for neither none nor all
51
+ of the values. Distributing the multiply in `toPhysical` — an algebraically equivalent
52
+ rearrangement — fails three of them.
53
+
9
54
  ## 0.5.41
10
55
 
11
56
  - **Added** a metamorphic test: reordering the signals in a header changes where the bytes are and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.5.41",
3
+ "version": "0.5.43",
4
4
  "description": "Modern, typed, zero-dependency reader for EDF, EDF+, BDF and BDF+ biosignal files. Works in browsers and Node with true random access.",
5
5
  "keywords": [
6
6
  "edf",
package/src/constants.ts CHANGED
@@ -93,4 +93,4 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
93
93
  } as const;
94
94
 
95
95
  /** Published package version. Kept in sync with package.json by a test. */
96
- export const VERSION = '0.5.41';
96
+ export const VERSION = '0.5.43';