     ///
     mutating func addSensorData(sensorData: SensorData) {
         sensorDatas += [sensorData]
+    }
+    
+    ///
+    /// Removes ``SensorData`` elements whose end time is before ``time``
+    ///
+    mutating func removeSensorDataEndingBefore(time: CFAbsoluteTime) -> Void {
+        sensorDatas = sensorDatas.filter { sd in
+            let endTime = sd.endTime(self.header.sampleSize, samplesPerSecond: self.header.samplesPerSecond)
+            return endTime < time
+        }
     }
     
     ///

    }

    ///
    /// Adds raw ``data`` received from device ``id`` at some ``time``
    ///
    mutating func decodeAndAdd(data: NSData, fromDeviceId id: DeviceId, at time: CFAbsoluteTime) -> Void {
        decode(data, fromDeviceId: id, at: time)
    }
    
}

        let sampleCount = samples.length / Int(sampleSize)
        return CFTimeInterval(sampleCount / Int(samplesPerSecond))
    }
    
    ///
    /// Computes the end time of the sensor data block given the
