Skip to content

Commit

Permalink
clarify docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinschmidt committed Jul 17, 2023
1 parent e2f5eee commit b3d72ba
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/export_edf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,17 @@ end
"""
reencode_samples(samples::Samples, sample_type::Type{<:Integer}=Int16)
Re-compute encoding parameters for `samples` so that they can be encoded as
`sample_type`. The default `sample_type` is `Int16` which is the target for EDF
format.
Encode `samples` so that they can be encoded as `sample_type`. The default
`sample_type` is `Int16` which is the target for EDF format. The returned
`Samples` will be encoded, with a `info.sample_type` that is either equal to
`sample_type` or losslessly `convert`ible.
This uses the actual signal extrema, choosing a resolution/offset that maps them
to `typemin(sample_type), typemax(sample_type)`.
If the `info.sample_type` of the input samples cannot be losslessly converted to
`sample_type`, new quantization settings are chosen based on the actual signal
extrema, choosing a resolution/offset that maps them to `typemin(sample_type),
typemax(sample_type)`.
Returns an encoded `Samples`, possibly with updated info. If the current
Returns an encoded `Samples`, possibly with updated `info`. If the current
encoded values can be represented with `sample_type`, nothing is changed. If
they cannot, the `sample_type`, `sample_resolution_in_unit`, and
`sample_offset_in_unit` fields are changed to reflect the new encoding.
Expand Down

0 comments on commit b3d72ba

Please sign in to comment.