Skip to content

This repository is a compilation of Cosine-Beamforming implementation in python.

Notifications You must be signed in to change notification settings

pranjallk1995/Beamforming-Research

Repository files navigation

Modules

numpy numpy (latest) scipy scipy (latest) plotly plotly (latest) prettytable prettytable (latest) dash dash (latest) tqdm tdqm (latest)

Introduction

This Repository is a compilation of Cosine-Beamforming implementation in python.

Owner

Pranjall Kumar, Jr. Data Scientist @ Siemens Gamesa (DVL)

Aim

To find the exact position of the source of sound with the help of two microphone arrays in a 2D plane.

Experimental Setup:

Calculation of angular location (θ):

Calculation of source location (p):

Assumptions

  1. There are 3 omnidirectional microphones in a linear array which are d distance apart.
  2. There are 2 linear microphone arrays which are Δ distance apart.
  3. All microphones are at a common fixed distance away from each other.
  4. The position of the source of sound is unknown in a 2D plane.
  5. There is only a single source of sound.
  6. The souce of sound is to left of the normal to microphone array (minor change in code will fix this).
  7. The source of sound is a point source.
  8. The source of sound is sufficiently far away from the microphone array.
  9. The source of sound is in a fixed position with respect to all the microphones.
  10. The source of sound produces some sound for a very breif amount of time (max 0.2 seconds).
  11. The source of sound is stationary.
  12. There is minimal noise (max 0.5 units).
  13. There is no echo.
  14. There is minimal distortion.
  15. The sound medium is dry air at 20 oC.
  16. Microphones are of good quality.

Formulas

  • \Large speed=\frac{distance}{time}

  • \Large sin(\theta)=\frac{opposite-side}{hypotenus}

  • \Large similarity(A,B)=\frac{A.B}{||A||*||B||}

  • \Large \delta_{i}^{j}=S*delay_{i}

  • \Large \theta_{j}^{i}=sin^{-1}(\frac{\delta^{j}_{i}}{d})

  • \Large \theta_{j}=\frac{1}{n}*\sum_{i=1}^{n}\theta_{j}^{i+1}

  • \Large p_{x}=\frac{2d+\Delta}{tan(\theta_{2})-tan(\theta_{1})}

  • \Large p_{y}=tan(\theta_{2})*p_{x}

Units

Metrics Units
Distance meters
Sampling samples/seconds
Time seconds
Angle degrees
Speed meters/second
Temperature Celsius

Parameter List

Parameter Value Descripttion
Number of microphones (n+1) 3 Represents the number of microphones in the microphone array.
Number of microphone arrays 2 Represents the number of microphone arrays being used.
Reference Pulse NA The first sound pulse received by any microphone.
Resultant Pulse NA The final amplified sound pulse.
D Unknown Longitudinal distance of the source of sound from the microphone array.
θj Unknown Angle made by the source of sound from the normal to the jth microphone array.
d 0.1 meters Distance between each microphone.
δ Variable Distance of the incident wavefront from the previous/subsequent incident microphone.
Δ 0.5 meters Distance between the microphone arrays.
delayi Variable Delay in time for sound wavefront to reach the ith microphone.
mij NA ith microphone of jth microphone array.
px Unknown x-coordinate of the source of sound in meters with respect to microphone 2.
py Unknown y-coordinate of the source of sound in meters with respect to microphone 2.
S 343 meters/second Speed of sound in dry air at 20 oC.
delay Variable Time taken by the incident wavefront to reach the previous/subsequent incident microphone.
Sampling Rate 44100 samples/second The number of samples taken from a continuous signal to make a digital signal.
Scanning Window 0.2 seconds The duration of signal considered for finding the source.
Shift Variable Represents the shift of signal in time from source to the closest microphone.
Offset Variable Represents the shift of signal in time from microphone to microphone (depends on d and θ).
Step 1 Represents the increments of shift in time for a signal.

Caution

  • Verify the right value of d.
  • Verify the right value of Δ.