Downsampling C3D force-plate analog to point frames: int() truncation and single-sample pick drift/alias; comment said middle sample
Converting C3D force-plate analog channels to point frames: compute analog_per_point = int(analog_rate / point_rate), then analog_frame = frame_idx * analog_per_point and read a single sample analog[0, ch, analog_frame] (gait_enhanced.ipynb:99,133,137). A comment on that line even says "use middle sample" while the code takes the first sample of the interval.
Two traps: (1) int() silently truncates a non-integer rate ratio, so the chosen analog frame drifts cumulatively across the trial; validate the ratio is integral (or use an explicit round/remap) before indexing. (2) Picking one of the analog_per_point samples that fall inside each point frame rather than averaging them aliases high-frequency force content and is inconsistent with the stated intent; reshape the analog block to (samples_per_frame, ...) and mean over the axis to downsample properly.
Generalizes to any system where a higher-rate analog stream is mapped onto lower-rate motion-capture frames (C3D, mocap, IMU-over-sampled channels).