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

边栏推荐
猜你喜欢

PHP lucky draw system with background source code
![[error reporting] node:internal/modules/cjs/loader:936 [solution]](/img/73/849c58c814c1a47dff0cde0e365c75.png)
[error reporting] node:internal/modules/cjs/loader:936 [solution]

PHP幸运抽奖系统带后台源码

Flink内核源码(七)Flink SQL提交流程

物联网组件

Introduction to network foundation

Small program source code for campus stray cat information recording and sharing / wechat cloud development medium big cat spectrum small program source code

FPGA skimming memory (Verilog implementation of ram and FIFO)

UE4.25 Slate源码解读

STM32F103 learn the steps and template fool tutorial of 1-keil5 project establishment
随机推荐
CUDA details GPU architecture
PHP lucky draw system with background source code
图书管理系统
K210——声源定位、声音识别
Some records during the development of ros2/ros1
Cuda-npp image and video processing
laravel框架中实现封装公共方法全局调用
区区区间---线段树lazy标记板子题
自组织是管理者和成员的双向奔赴
Family relationship calculator wechat applet source code
Code implementation - the greatest common factor of polynomials (linear algebra)
Wechat applet - Advanced chapter Lin UI component library source code analysis button component (II)
New conch movie theme template m3.1 fully decrypted version multifunctional apple cmsv10 background adaptive theme open source fully decrypted version
idea替换所有文件中的内容
第五天实验
主从复制及其原理
(作业)C语言:atoi和strncpy、strncat、strncmp的模拟实现
nacos名字的由来
HTTP缓存
第十天笔记