Skip to content

Commit

Permalink
Merge pull request #367 from open-ephys/issue-358
Browse files Browse the repository at this point in the history
Add voltage conversion equations to Neuropixels DataFrame docs
  • Loading branch information
bparks13 authored Feb 18, 2025
2 parents bdafa9b + 8a14da4 commit 1f15122
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
16 changes: 12 additions & 4 deletions OpenEphys.Onix1/NeuropixelsV1DataFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,25 @@ public NeuropixelsV1DataFrame(ulong[] clock, ulong[] hubClock, int[] frameCount,
/// Gets the spike-band data as a <see cref="Mat"/> object.
/// </summary>
/// <remarks>
/// Spike-band data has 384 rows (channels) with columns representing the samples acquired at 30 kHz. Each sample is a
/// 10-bit, offset binary value encoded as a <see cref="ushort"/>.
/// Spike-band data has 384 electrodes (rows) with columns representing the samples acquired at 30 kHz.
/// Each sample is a 10-bit, offset binary value encoded as a <see cref="ushort"/>. To convert to
/// microvolts, the following equation can be used:
/// <code>
/// V_electrode (uV) = 1171.875 uV / AP Gain × (ADC result – 512)
/// </code>
/// </remarks>
public Mat SpikeData { get; }

/// <summary>
/// Gets the LFP band data as a <see cref="Mat"/> object.
/// </summary>
/// <remarks>
/// LFP data has 32 rows (channels) with columns representing the samples acquired at 2.5 kHz. Each sample is a
/// 10-bit, offset binary value encoded as a <see cref="ushort"/>.
/// LFP-band data has 384 electrodes (rows) with columns representing the samples acquired at 2.5 kHz.
/// Each sample is a 10-bit, offset binary value encoded as a <see cref="ushort"/>. To convert to
/// microvolts, the following equation can be used:
/// <code>
/// V_electrode (uV) = 1171.875 uV / LFP Gain × (ADC result – 512)
/// </code>
/// </remarks>
public Mat LfpData { get; }
}
Expand Down
8 changes: 8 additions & 0 deletions OpenEphys.Onix1/NeuropixelsV2eBetaDataFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ public NeuropixelsV2eBetaDataFrame(ulong[] clock, ulong[] hubClock, Mat amplifie
/// <summary>
/// Gets the amplifier data array.
/// </summary>
/// <remarks>
/// Wide band (0.5 Hz - 10 kHz) electrophysiology data array. Each element is an amplified sample from
/// 384 electrodes (rows) acquired at 30 kHz (columns). Each sample is a 14-bit, offset binary value
/// encoded as a <see cref="ushort"/>. To convert to microvolts, the following equation can be used:
/// <code>
/// V_electrode (µV) = 0.76294 µV/bit × (ADC result – 8192) bits
/// </code>
/// </remarks>
public Mat AmplifierData { get; }

/// <summary>
Expand Down
10 changes: 9 additions & 1 deletion OpenEphys.Onix1/NeuropixelsV2eDataFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ public NeuropixelsV2eDataFrame(ulong[] clock, ulong[] hubClock, Mat amplifierDat
/// <summary>
/// Gets the amplifier data array.
/// </summary>
/// <remarks>
/// Wide band (0.5 Hz - 10 kHz) electrophysiology data array. Each element is an amplified sample from
/// 384 electrodes (rows) acquired at 30 kHz (columns). Each sample is a 12-bit, offset binary value
/// encoded as a <see cref="ushort"/>. To convert to microvolts, the following equation can be used:
/// <code>
/// V_electrode (µV) = 3.05176 µV/bit × (ADC result – 2048) bits
/// </code>
/// </remarks>
public Mat AmplifierData { get; }

internal static unsafe ushort GetProbeIndex(oni.Frame frame)
Expand Down Expand Up @@ -94,7 +102,7 @@ internal static unsafe void CopyAmplifierBuffer(ushort* amplifierData, ushort[,]
{ 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255 }, // Data Index 38, ADC 15
{ 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, 381, 383 }, // Data Index 39, ADC 23

};
};
}

[StructLayout(LayoutKind.Sequential, Pack = 1)]
Expand Down

0 comments on commit 1f15122

Please sign in to comment.