当前位置:网站首页>K210——声源定位、声音识别
K210——声源定位、声音识别
2022-07-29 02:04:00 【我与nano】
前言
来了,K210的声源定位。
[2022电赛] 声源定位跟踪系统(E题)k210 麦克风阵列效果实测!
sipeed官方做的,效果还不错。
一、模块
sipeed家的声源定位模块,K210常用的都可以用
将麦克风阵列模块与 pyAI-K210 使用 FPC 10P 排线进行连接,接口在开发板背部(排线金手指下接)。
麦克风阵列扩展模块由 7 个数字麦克风组成,其中 6 个分布在四周不同方向,1 个在模块正中央,便于识别各个方向声源。另外 12 个 LED 指示灯,方便指示声源位置。
二、使用说明
1.相关函数


2.代码
#导入MIC_ARRAY和LCD模块
from Maix import MIC_ARRAY as mic
import lcd
#初始化模块
lcd.init()
mic.init()
while True:
#获取原始的声源黑白位图,尺寸 16*16
imga = mic.get_map()
#获取声源方向并设置LED显示
b = mic.get_dir(imga)
a = mic.set_led(b,(0,0,255))
#将声源地图重置成正方形,彩虹色
imgb = imga.resize(160,160)
imgc = imgb.to_rainbow(1)
#显示声源图
lcd.display(imgc)
mic.deinit()
现象展示
有个问题,没有坐标,没有坐标就没法定位
这是一个大佬写的代码,可以去参考看一下,附上原文链接
for i in range(len(b)):
if b[i]>=2:
AngleX+= b[i] * math.sin(i * math.pi/6)
AngleY+= b[i] * math.cos(i * math.pi/6)
AngleX=round(AngleX,6) #计算坐标转换值
AngleY=round(AngleY,6)
if AngleY<0:AngleAddPi=180
if AngleX<0 and AngleY > 0:AngleAddPi=360
if AngleX!=0 or AngleY!=0: #参数修正
if AngleY==0:
Angle=90 if AngleX>0 else 270 #填补X轴角度
else:
Angle=AngleAddPi+round(math.degrees(math.atan(AngleX/AngleY)),4) #计算角度
AngleR=round(math.sqrt(AngleY*AngleY+AngleX*AngleX),4) #计算强度
mic_list.append(AngleX)
mic_list.append(AngleY)
mic_list.append(AngleR)
mic_list.append(Angle)
a = mic.set_led(b,(0,0,255))# 配置 RGB LED 颜色值
return mic_list #返回列表,X坐标,Y坐标,强度,角度
while True:
print(get_mic_dir())
time.sleep_ms(100)

边栏推荐
- redis为什么快,消息队列,单线程
- How to migrate thinkphp5 projects to Alibaba cloud function computing to cope with traffic peaks?
- Three expiration strategies
- Excel uses countif statistics
- 多边形点测试
- virsh console连接失败问题
- ES6 event binding (v-on usage)
- Three methods of STM32 delay function
- Thermistor temperature calculation formula program
- Quickly master nodejs installation and getting started
猜你喜欢

MySQL basic operation and comprehensive instance project based on MySQL basic operation

一文读懂Okaleido Tiger近期动态,挖掘背后价值与潜力

Understanding service governance in distributed development

Talk about 11 tips for interface performance optimization

线上3d数字展厅制作方案及优点

Ten methods to prevent blackmail software from attacking data

Responsive Zhimeng template decoration design website
![[quality] code quality evaluation standard](/img/33/2c2256fd98b908ddaf5573f644ad7f.png)
[quality] code quality evaluation standard

Object based real-time spatial audio rendering - Dev for dev column

如果非要在多线程中使用 ArrayList 会发生什么?
随机推荐
2022/07/28 学习笔记 (day18) 常用API
Esbuild Bundler HMR
Responsive dream weaving template home decoration website
How does the Devops team defend against API attacks?
工程经济学简答题
How to use RPA to achieve automatic customer acquisition?
详解异步任务:任务的状态及生命周期管理
Three implementation methods of Servlet
ES6事件绑定(v-on用法)
When I look at the source code, what am I thinking?
TCP重传机制有哪些?
Altium designer outputs Gerber and other production documents
How awesome is the architecture of "12306"?
ES6 event binding (v-on usage)
JMeter's BeanShell generates MD5 encrypted data and writes it to the database
[mqtt from introduction to improvement series | 09] Wireshark packet capturing and analyzing mqtt messages
C language to achieve the three chess game
Code random notes_ Hash_ 349 intersection of two numbers
详解JS的四种异步解决方案:回调函数、Promise、Generator、async/await
如何快速设计一套支持渲染富文本内容的跨端组件