/** * Time and sample index, on the recording's own axis. * * Layer 7. The recording-aware counterpart to `sample-grid.ts`, and the reason it exists is stated * plainly there: `gridSampleIndexAt`, `gridSampleStartTicks` and `gridSampleStartSeconds` take * `(signal, value, recordDurationTicks)` — no index, no timeline — so a gap is not in their * arguments and no arithmetic inside them could find one. They measure the signal's own SAMPLE * GRID, which equals elapsed recording time only when the recording is contiguous. * * These two take the recording, so they can answer the question people actually mean. On a * contiguous file they agree with the grid functions exactly. On an EDF+D file they differ by the * gaps, and `sampleAt` can answer something the grid functions structurally cannot: that an * instant has NO sample at all, because it falls in a hole. * * Both refuse a probed index on a file whose records do not cover its span, for the reason * `segmentAt` does: `undefined` from `sampleAt` means "no sample exists here", and an index that * has read record 0 and the last record cannot say that about anything in between. Merging "there * is a gap here" with "nobody looked" is the confusion this whole area of the API avoids. * * ONE LIMIT, and it belongs to the file rather than to these functions. If two records cover the * same instant — a timeline whose onsets repeat, which EDF+ does not forbid — then more than one * sample exists at that time and no function can return both. * * Repeating onsets are not silent, which this said until 0.6.74. With any positive record * duration they are an overlap, so the probes report `RECORD_ONSET_SPACING_VIOLATION` and a * complete index reports one per overlapping pair. The one file where they pass unremarked is a * `recordDuration` of 0, where every record legally starts at the same instant — and `sampleAt` * refuses such a file outright, so it never reaches this limit. * * `sampleAt` returns the one whose segment `segmentAt` finds. The round-trip "the sample at a * sample's start is that sample" therefore holds for files whose records do not overlap, which is * every file anyone is likely to have; it is not a universal law and 0.2.60 claimed it as one. */ import type { EdfRecording, EdfSampleLocation } from './types.js'; /** * The sample covering `seconds`, or `undefined` when no sample does. * * `undefined` is a real answer rather than a failure: on an EDF+D file an instant inside a gap has * no sample, and so does any time before the recording starts or after it ends. That is the case * `gridSampleIndexAt` cannot express — given only a signal and a record duration it always returns an * index, even one past the end of the file. * * Floor, not round, and in exact integer arithmetic on ticks: a sample covers the half-open * interval from its own start to the next one's, so the sample "at" a time is the one already * running when that time arrives. */ export declare function sampleAt(recording: EdfRecording, signalIndex: number, seconds: number): EdfSampleLocation | undefined; /** * When a sample starts, in exact ticks on the recording's axis. * * The inverse of `sampleAt`, and the recording-aware form of `gridSampleStartTicks`. On a contiguous * file the two agree exactly; on an EDF+D file this one includes the gaps that precede the sample * and `gridSampleStartTicks` does not. * * Rounds UP to a whole tick, as `gridSampleStartTicks` does: a sample boundary need not fall on one — * 128 samples over 0.3 s puts sample 1 at 23,437.5 ticks — and truncating would return a tick * lying inside the previous sample, which `sampleAt` would then map straight back to that * previous sample. */ export declare function sampleStartTicksOf(recording: EdfRecording, signalIndex: number, sampleIndex: number): bigint; /** `sampleStartTicksOf` as float64 seconds. Compare with the ticks, never with this. */ export declare function sampleStartSecondsOf(recording: EdfRecording, signalIndex: number, sampleIndex: number): number; //# sourceMappingURL=sample-locate.d.ts.map