当前位置:网站首页>K210 - sound source location and sound recognition
K210 - sound source location and sound recognition
2022-07-29 02:46:00 【Me and nano】
Preface
coming ,K210 Sound source location of .
[2022 Electric competition ] Sound source location and tracking system (E topic )k210 Microphone array effect measurement !
sipeed It's official , It's not bad .
One 、 modular
sipeed Home sound source positioning module ,K210 You can use whatever you often use 
Connect the microphone array module with pyAI-K210 Use FPC 10P Connect with a flat cable , The interface is on the back of the development board ( The flat cable is connected under the golden finger ).
The microphone array expansion module consists of 7 A digital microphone , among 6 They are distributed in different directions around ,1 In the center of the module , It is easy to identify sound sources in all directions . in addition 12 individual LED Indicator light , It is convenient to indicate the location of the sound source .
Two 、 Instructions
1. Correlation function


2. Code
# Import MIC_ARRAY and LCD modular
from Maix import MIC_ARRAY as mic
import lcd
# Initialization module
lcd.init()
mic.init()
while True:
# Get the original black-and-white bitmap of the sound source , Size 16*16
imga = mic.get_map()
# Get the sound source direction and set LED Show
b = mic.get_dir(imga)
a = mic.set_led(b,(0,0,255))
# Reset the sound source map to a square , Rainbow color
imgb = imga.resize(160,160)
imgc = imgb.to_rainbow(1)
# Display sound source diagram
lcd.display(imgc)
mic.deinit()
Phenomenon display 
There is a problem , No coordinates , Without coordinates, there is no way to locate
This is the code written by a big man , You can refer to , Enclosed Link to the original text
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) # Calculate the coordinate conversion value
AngleY=round(AngleY,6)
if AngleY<0:AngleAddPi=180
if AngleX<0 and AngleY > 0:AngleAddPi=360
if AngleX!=0 or AngleY!=0: # Parameter correction
if AngleY==0:
Angle=90 if AngleX>0 else 270 # fill X Shaft angle
else:
Angle=AngleAddPi+round(math.degrees(math.atan(AngleX/AngleY)),4) # Calculation angle
AngleR=round(math.sqrt(AngleY*AngleY+AngleX*AngleX),4) # Calculate the strength
mic_list.append(AngleX)
mic_list.append(AngleY)
mic_list.append(AngleR)
mic_list.append(Angle)
a = mic.set_led(b,(0,0,255))# To configure RGB LED Color value
return mic_list # Returns a list of ,X coordinate ,Y coordinate , Strength , angle
while True:
print(get_mic_dir())
time.sleep_ms(100)

边栏推荐
- Deliver temperature with science and technology, vivo appears at the digital China Construction Summit
- 多重继承与派生类成员标识
- Rust list (VEC) replication
- php 进程通信系列 (一) 命名管道
- 第五天实验
- Quickly master nodejs installation and getting started
- QT qstringlist usage
- 自组织是管理者和成员的双向奔赴
- TCP重传机制有哪些?
- Stm32f103xx firmware function library-1
猜你喜欢

Which is a good automatic account distribution system?

C language to achieve the three chess game

以科技传递温度,vivo亮相数字中国建设峰会

A good-looking IAPP donation list source code

C语言:小乐乐与欧几里得

UE4.25 Slate源码解读

Asemi rectifier bridge s25vb100, s25vb100 parameters, s25vb100 application

Family relationship calculator wechat applet source code

关于时间复杂度的一些新认识

ROCBOSS开源微社区轻论坛类源码
随机推荐
Three expiration strategies
HTTP断点续传以及缓存问题
外挂---线段树懒标记板子+简单数学推理
h. 264 code stream explanation
This blogger has a comprehensive classification of QT. If you are free, go to study and summarize it and record it.
How to migrate thinkphp5 projects to Alibaba cloud function computing to cope with traffic peaks?
time_wait和close_wait产生原因
这个博主,qt归类比较全,有空去学习总结,记录一下。
xxxxx
Shell 脚本 快速入门 -01
第六天笔记
CUDA details GPU architecture
HTTP缓存
一款好看的iapp捐赠榜单源码
区区区间---线段树lazy标记板子题
New UI Sifang aggregate payment system source code / new usdt withdrawal / latest update security upgrade to fix XSS vulnerability patch vulnerability
物联网组件
6 years of testing experience, teaching you how to test ~ how to control the project
owt-server源码剖析(四)--video模块分析之Mixer Out
Quickly master nodejs installation and getting started