当前位置:网站首页>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)

边栏推荐
猜你喜欢

Flink生产环境经典问题汇总

ECCV 2022 | airdet: a small sample target detection method without fine tuning

Library management system

QT screen adaptive automatic layout, drag the window to automatically grow larger and smaller (I)

Ffmpeg+sdl+qt is a simple video player

Deliver temperature with science and technology, vivo appears at the digital China Construction Summit

laravel框架中实现封装公共方法全局调用

MySQL和Redis的双写一致性

Production scheme and advantages of online 3D digital exhibition hall

一款好看的iapp捐赠榜单源码
随机推荐
童年的快乐时光
C语言:小乐乐与欧几里得
Three expiration strategies
物联网组件
全新UI四方聚合支付系统源码/新增USDT提现/最新更新安全升级修复XSS漏洞补单漏洞
A good-looking IAPP donation list source code
平凡的快乐
Only when you are far away will you miss
6 years of testing experience, teaching you how to test ~ how to control the project
C语言:空心正方形图案
第八天笔记
ASEMI整流桥S25VB100,S25VB100参数,S25VB100应用
CUDA details GPU architecture
Library management system
Rocbos open source micro community light forum source code
laravel框架中实现封装公共方法全局调用
Others' happiness
Family relationship calculator wechat applet source code
QT屏幕自适应自动布局,拖动窗口自动变大变小(一)
What are the TCP retransmission mechanisms?