GithubHelp home page GithubHelp logo

kalman-rts-objc's Introduction

Kalman-RTS-Objc

Usage


int main(int argc, char *argv[]) {
    @autoreleasepool {
        KalmanFilter * kf = [KalmanFilter new];
        NSArray * arr = @[
            @-53, @-54, @-55, @-59, @-59, @-60, @-52, @-44, @-44, @-49, @-45, @-46, @-46, @-49, @-47, @-50, @-50, @-50, @-46, @-43, @-43, @-44, @-47, @-46, @-46, @-46, @-46, @-46, @-44, @-42, @-46, @-46, @-46, @-43, @-46
        ];
        
        [kf setupRTSCount:arr.count];
        
        NSArray * kamlam = [kf estimateArray:arr];
        
        NSArray * rts = [kf smoothArrayWithRTS];
        
        NSLog(@"kalman: %@ rts: %@", kamlam, rts);
    }
}


过程

Python 3 的实现:

image_6490965230939171

RTS 的结果是蓝色线条,对比设备提供的测量结果(绿线),我们认为这是一个理想的结果。

OC 实现

首先是 RTS 的算法实现:

image_0329179758197623

考虑现状,我们只需要实现 一维的 RTS,于是我们讲 A、H 等参数默认为 1(上图Python 的实现也是 1 )。

以下是我的实现:

image_06116335727788269

其中蓝色线条是 最终的实现。橙色线条是,利用 10^((baseRSSI-currentRSSI)/(10 * 2)) 计算得到的距离曲线用来参考。灰色线条是原始值。

最后。放大最后一部分细看,我认为是一个比较理想的实现。

image_20047064422098015

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.