当前位置:网站首页>STM32-遥感数据处理
STM32-遥感数据处理
2022-08-04 01:55:00 【ValentineHP】
一. 简介
在上篇文章中,以及知道如何采集遥感数据了,可是采集到的数据是0-4096范围内的,实际上,下边界不为0,上边界也不为4096。为了方便后续的处理,本文将采集到的遥感数据归一到0-100范围内。
二. 遥感数据校准
这个部分是必要的,可以确定真实情况下上下边界的数据。其具体做法为,连续采集一些边界数据,求和,取平均就可以了。具体做法如下。当采集到的数据靠近我们认为的边界时,就认为是有效数据,否则丢弃,其他四个边界的做法也是如此。
/*XL方向校准*/
void Rocker1CalibrationXL(void)
{
uint8_t i;
uint32_t valueSum = 0;
for(i = 0 ;i < 400; )
{
uint16_t value = getX1Value();
if(value > 0xf600)
{
valueSum += value;
i++;
}
}
XOffSetL = valueSum / 400;
}
三. 数据归一化
这部分也是关键的一步。其具体做法分为如下几个步骤:
- 获取原始数据
- 计算原始数据到对应两边界直接的距离(也就是相减)
- 将计算得到的结果扩大100倍,然后除以两边界的差值
- 左 边加(100-右边) 除以二,得到最终结果
具体代码实现如下
XValue = getX1Value(); //获取X方向遥感数值
if(XValue > XOffSetL)
XtempL = 0; /*小于左边界,直接复制为0*/
else
XtempL = XOffSetL - XValue ;
if(XValue < XOffSetR)
XtempR = 0; /*大于右边界,直接复制为0*/
else
XtempR = XValue - XOffSetR;
uint32_t XtL = XtempL * 100;
uint32_t XtR = XtempR * 100;
XtL = XtL / (XOffSetL - XOffSetR);
XtR = XtR / (XOffSetL - XOffSetR);
X = (XtL + (100 - XtR)) / 2; /*结果为遥感到左边界的距离,0 - 100*/
至此就完成啦。
还有关注微信公众号 FPGA之旅
边栏推荐
- Use of lombok annotation @RequiredArgsConstructor
- 实例038:矩阵对角线之和
- thinkphp 常用技巧
- Small Turtle Compilation Notes
- Example 035: Setting the output color
- nodejs+npm的安装与配置
- [store mall project 01] environment preparation and testing
- 阿里云国际版基于快照与镜像功能迁移云服务器数据
- 一个项目的整体测试流程有哪几个阶段?测试方法有哪些?
- Flask Framework Beginner-05-Command Management Manager and Database Use
猜你喜欢
Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
Small Turtle Compilation Notes
持续投入商品研发,叮咚买菜赢在了供应链投入上
云开发校园微社区微信小程序源码/二手交易/兼职交友微信小程序开源源码
Presto中broadcast join和partition join执行计划的处理过程
halcon自定义函数基本操作
lombok注解@RequiredArgsConstructor的使用
html select tag assignment database query result
Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
持续投入商品研发,叮咚买菜赢在了供应链投入上
随机推荐
sql有关问题,小时粒度,找到前一个小时内的数据
GNSS[0]- Topic
Example 035: Setting the output color
实例038:矩阵对角线之和
Hey, I had another fight with HR in the small group!
nodejs+express实现数据库mysql的访问,并展示数据到页面上
贪吃蛇游戏Bug解析及功能扩展
企业虚拟偶像产生了实质性的价值效益
Web APIs BOM - operating browser: swiper plug-in
Engineering drawing review questions (with answers)
What is SVN (Subversion)?
【QT小记】QT中信号和槽的基本使用
织梦响应式酒店民宿住宿类网站织梦模板(自适应手机端)
实例039:有序列表插入元素
[store mall project 01] environment preparation and testing
DHCP服务详解
Apache DolphinScheduler actual combat task scheduling platform - a new generation of distributed workflow
【Untitled】
KunlunBase 1.0 发布了!
【无标题】