来自Apple Watch的心率数据非常不准确

时间:2017-05-16 00:40:58

标签: ios sensor apple-watch health-kit

我有一个iOS健身应用程序,可以从蓝牙胸带收集心率数据。我最近添加了一个Apple Watch扩展,并将手表的心率传感器作为胸带的替代品。不幸的是,我发现它是如此不准确,基本上没用。以下是3英里徒步旅行的示例,其中红线显示从胸带收集的数据,蓝线显示从Apple Watch收集的数据:

watch versus chest strap chart

我可以告诉胸带数据是两者中更准确的,因为当叠加在高程数据上时,较高的心率与上坡部分非常接近。 (另外,我不会指望我的心率从60秒跳到120或110到160,如Apple Watch所示......也不能一次保持相同的值一分钟。)

这是我用来收集观看数据的代码。是否有另一种方法来配置它以获得更准确的数据,或者这是否与使用此硬件一样好?

- (void)startWorkoutSession {
    if (self.workoutSession) {
        return;
    }

    // configure a HealthKit workout
    HKWorkoutConfiguration *configuration = [[HKWorkoutConfiguration alloc] init];
    configuration.activityType = HKWorkoutActivityTypeHiking;
    configuration.locationType = HKWorkoutSessionLocationTypeOutdoor;

    // start the workout
    NSError *error = nil;
    self.workoutSession = [[HKWorkoutSession alloc] initWithConfiguration:configuration error:&error];
    if (!self.workoutSession) {
        //NSLog(@"*** Unable to create the workout session: %@ ***", error.localizedDescription);
        NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
            @"createWorkoutSession", @"error",
            error.localizedDescription, @"description",
        nil];
        [self.iosApp sendMessage:data replyHandler:nil errorHandler:^(NSError * _Nonnull error) {
            // maybe show a local alert here?
        }];
        return;
    }
    self.workoutSession.delegate = self;
    [self.healthStore startWorkoutSession:self.workoutSession];

    // update the controls view and show the tracking view
    self.controls.status = StatusStarted;
    if (![self.activeController isEqual:self.tracking]) {
        [self.tracking becomeCurrentPage];
    }
}

- (void)workoutSession:(HKWorkoutSession *)workoutSession didChangeToState:(HKWorkoutSessionState)toState fromState:(HKWorkoutSessionState)fromState date:(NSDate *)date {
    // required method
    if (toState == HKWorkoutSessionStateRunning) {
        [self requestHeartRate:date];
    }
}

- (void)requestHeartRate:(NSDate *)date {
    __weak typeof(self) weakSelf = self;
    NSPredicate *predicate = [HKQuery predicateForSamplesWithStartDate:date endDate:nil options:HKQueryOptionNone];
    HKSampleType *heartRateType = [HKSampleType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate];
    HKAnchoredObjectQuery *query = [[HKAnchoredObjectQuery alloc] initWithType:heartRateType predicate:predicate anchor:0 limit:0 resultsHandler:^(HKAnchoredObjectQuery *query, NSArray<HKSample *> *samples, NSArray<HKDeletedObject *> *deletedObjects, HKQueryAnchor *anchor, NSError *error) {
        if ((!error)&&(samples.count > 0)) {
            [weakSelf receiveHeartRate:(HKQuantitySample *)[samples objectAtIndex:0]];
        } else {
            NSLog(@"error with initial heart rate query: %@", error);
        }
    }];
    [query setUpdateHandler:^(HKAnchoredObjectQuery *query, NSArray<HKSample *> *samples, NSArray<HKDeletedObject *> *deletedObjects, HKQueryAnchor *anchor, NSError *error) {
        if ((!error)&&(samples.count > 0)) {
            [weakSelf receiveHeartRate:(HKQuantitySample *)[samples objectAtIndex:0]];
        } else {
            NSLog(@"error with updated heart rate query: %@", error);
        }
    }];
    [self.healthStore executeQuery:query];
}

- (void)receiveHeartRate:(HKQuantitySample *)sample {
    HKQuantity *quantity = sample.quantity;
    int value = (int)[quantity doubleValueForUnit:[HKUnit unitFromString:@"count/min"]];
    //NSLog(@"got heart rate %i", value);

    // display the heart rate in the tracking view
    [self.tracking updateHeartRate:value];
}

更新

我看this comparison chart表示我应该从Apple Watch获得的准确性。现在我意识到这只是将Apple Watch与另一款基于手表的(手腕)传感器进行比较。所以也许这张图表只是表明两种基于手腕的模型同样不准确。

令人困惑,因为您可以在网上搜索&#34; Apple观看心率准确度&#34;并且找到很多关于它有多准确的故事,但是没有人能够看到像我看到的结果,我认为这些结果很差。

2 个答案:

答案 0 :(得分:1)

您的应用在Apple Watch上提高心率报告频率和准确度的唯一方法就是使用准确的from core.py import function1 记录锻炼时段。由于看起来你已经这样做了,你应该file a radar与Apple谈论测量的准确性。

答案 1 :(得分:1)

我对Apple Watch 2的体验是一样的。这是非常不准确的:当我爬楼梯5分钟时它显示70,或者在低强度运动时报告不可读的高读数。但最令人讨厌的是,它甚至在行走时也会定期失去心率!

我应该等到第4代或第5代。仍然AW2无法替代Polar HRM。遗憾的是,Apple无法提供一致的心率测量准确度。