Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
216cc8b
Initial XS3 implementation.
Nov 30, 2021
3d01c77
Optimized the ISR somewhat
Dec 1, 2021
cd302f2
Made the number of microphones more configurable.
Dec 1, 2021
ebe9ee2
Made more configurable
Dec 2, 2021
8bf7871
Got some of it working.
Dec 16, 2021
836c2f6
Got things almost working.. I think
Jan 17, 2022
120bfa0
Fixed major bug in first stage decimator. Output audio sounds good now.
Jan 19, 2022
7e4bb4a
Clean up
Jan 19, 2022
de8c770
Got it working with stereo
Jan 19, 2022
b80d24d
Refactored the mic array code into a much simpler form.
Jan 21, 2022
8f7b823
Removed the need for the N_MICS, STAGE2_TAP_COUNT and STAGE2_DEC_FACT…
Jan 25, 2022
736c5fb
Removed original 'test' app and renamed 'test2' to 'demo'.
Jan 25, 2022
a41ab1f
Reduced MIPS usage a bit.
Jan 25, 2022
4c96be8
Refactored some of the code to be cleaner
Feb 4, 2022
42bfbe9
Fixed bug in ma_proc-sample_user.
Feb 4, 2022
92e558a
Adding documentation and trying to simplify things for users.
Feb 8, 2022
b45faeb
Created task version of pdm_rx that can be used instead of ISR-based …
Feb 11, 2022
c9a6971
Renamed a few things to be more consistent
Feb 11, 2022
6de44f4
Simplified some more things. Added 'simple' API.
Feb 14, 2022
fc4ad12
Changed demo app to be a bunch of demo apps which accomplish differen…
Feb 17, 2022
586c0e5
Got things working. Updated to latest SDK version as well.
Feb 18, 2022
1a5ece5
Finished refactoring and initial API documentation.
Feb 24, 2022
b2d4089
Fix return before ending chan transaction
xmos-jmccarthy Feb 28, 2022
da6d7de
Initial commit of CPP API
Feb 28, 2022
ddd128e
Got apps working using new C++ API
Mar 2, 2022
cd12559
Added more API documentation for the C++
Mar 2, 2022
ca0e25c
Adds documentation for mic_array::prefab::BasicMicArray
Mar 3, 2022
2355331
More refinements and simplifications.
Mar 4, 2022
b6ac1f4
Merge branch 'xs3_cpp' into xs3_update
Mar 4, 2022
0d78640
More documentation.
Mar 9, 2022
e9664e8
Adds ma_frame_rx_transpose(). Documentation updates.
Mar 11, 2022
a1de468
Started creating tests
Mar 15, 2022
1648a16
Fixed build bug involving unity, which isn't used yet.
Mar 15, 2022
822cf03
Makes unity lib available to tests
Mar 17, 2022
ddfc8e2
Initial commit for frame_transfer unit tests.
Mar 17, 2022
7065dba
Adds support 4- and 8-bit ports.
Mar 22, 2022
b1b56da
Merge branch 'xs3_update' into add_tests
Mar 22, 2022
1c66ef9
Adds many unit and functional tests
Apr 7, 2022
fd59e8b
Updates CHANGELOG.rst, README.rst and tests/README
Apr 7, 2022
271b031
Updates tests/README.rst
Apr 7, 2022
aff191b
Updates tests/README.rst
Apr 7, 2022
94ddc81
Updates tests/README.rst
Apr 7, 2022
3fe480b
Updated READMEs for tests.
Apr 7, 2022
8cf90ba
Converts documentation to RST format required by SDK
Apr 11, 2022
8f5ac7d
Big documentation update
Apr 13, 2022
bd6992d
Adds *.local.* patterns to .gitignore
Apr 14, 2022
633da72
Moves XN files into individual applications.
Apr 14, 2022
1cc5a78
Updates CMakeLists.txt
Apr 14, 2022
7f9cbe9
Updates CMakeListss to match other libraries in SDK
Apr 14, 2022
3f19afd
Fixes inconsistency with how SDK uses this library.
Apr 14, 2022
ea99551
Changes mic_array_vanilla_add() from a macro to a function.
Apr 14, 2022
5f2a468
Adds guard for XS3A platform
Apr 14, 2022
fc8bada
XS3 Platform only
Apr 14, 2022
0f56f47
XS3 Platform only
Apr 14, 2022
a12c5bd
Updates CMakeLists.txt
Apr 15, 2022
2a45455
Fixes issue causing mic array object to appear on all tiles.
Apr 15, 2022
e361148
Marks develop branch of xmos/mic_array as merged to overrule conflicts.
Apr 15, 2022
0170548
Adds license notice to source files that didn't have it.
Apr 22, 2022
1dedc55
Moves documentation folder to repo root.
Apr 22, 2022
f26a1e7
Fixes copyright/license notice in source files.
Apr 22, 2022
6e6c034
Merge pull request #165 from astewart-xmos/xs3_update
keithm-xmos Apr 25, 2022
3df1dc7
Removed info about module_build_info
keithm-xmos Apr 25, 2022
aa1e44a
Fixes warnings/errors in library documentation build.
Apr 25, 2022
a779569
fixed broken link checks
Apr 26, 2022
7cadcf1
Update Prefab.hpp
Apr 26, 2022
6d0c554
Update filters_default.h
Apr 26, 2022
c2aee3c
Merge pull request #167 from astewart-xmos/develop
keithm-xmos Apr 26, 2022
52b0027
Removed "XMOS" from heading
keithm-xmos Apr 26, 2022
876ffc6
Adds automated documentation build (#168)
keithm-xmos Apr 28, 2022
f29ebe2
[issue #171] Implements configuring allowing PdmRx to quietly drop PD…
Sep 15, 2022
50f9e51
Changes lib_mic_array to use CPM for dependencies.
Sep 16, 2022
977cc0c
Updates lib_mic_array to use v2.0.2 of lib_xcore_math.
Oct 10, 2022
d520a28
Merge branch 'issue171' into xcore_math
Oct 10, 2022
f12688f
[issue #173] Adds legacy_build app to ensure module_build_info works..
Oct 24, 2022
5d99858
[issue #173] Adds legacy_build_vanilla app and support for 'vanilla' …
Oct 24, 2022
67540e3
Merge remote-tracking branch 'xmos/develop' into xcore_math
Oct 28, 2022
08a8495
Added CI workflow for github actions to build test apps.
Oct 28, 2022
6504f62
Fixes copy/paste error
Oct 28, 2022
6bbbd5a
Adds legacy build tests to CI
Oct 28, 2022
4fe455b
Removes legacy build test apps from CI build.
Oct 28, 2022
ba33041
Merge pull request #172 from astewart-xmos/xcore_math
keithm-xmos Nov 11, 2022
f8f75cc
moved CPMAddPackage to top-level CMakeLists
keithm-xmos Nov 11, 2022
efa0a82
trying an alternative location for CPMAddPackage of lib_xcore_math
keithm-xmos Nov 11, 2022
2d485ef
now using xcore_builder
keithm-xmos Feb 2, 2023
0d8f825
Merge pull request #175 from xmos/fix/CPMAddPackage
Feb 10, 2023
2e5894d
Merge pull request #177 from xmos/fix/xcore_builder
Feb 10, 2023
ea9b7cf
[#174] Big documentation update. Enables PDF generation.
Feb 15, 2023
6207a28
[#174] Updates GitHub Actions
Feb 15, 2023
226b5f7
[#174] More documentation changes.
Feb 16, 2023
6d6c762
[#174] Turns link checking on in documentation build.
Feb 17, 2023
3077ea9
[#174] Removes some unnecessary todos from docs.
Feb 17, 2023
3137147
Merge pull request #178 from astewart-xmos/pdf_docs
Feb 17, 2023
e4cbdb9
Update diagrams
xmos-jmccarthy Feb 22, 2023
e621cb9
Update font
xmos-jmccarthy Feb 22, 2023
e7d69e5
pinned doc builder to v2
keithm-xmos Mar 7, 2023
c0fb8b4
Merge pull request #180 from xmos/fix/pin_doc_builder
keithm-xmos Mar 7, 2023
a21daa2
Merge pull request #179 from xmos/feature/doc_diagrams
Mar 9, 2023
7581cda
Updates version numbers to 5.0.2
Mar 9, 2023
ccfd6d7
Merge pull request #181 from astewart-xmos/develop
Mar 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .github/scripts/build_test_apps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

pwd

wget https://raw.githubusercontent.com/xmos/xmos_cmake_toolchain/main/xs3a.cmake
wget https://raw.githubusercontent.com/xmos/xmos_cmake_toolchain/main/xc_override.cmake
cmake -B build.xcore -DDEV_LIB_MIC_ARRAY=1 -DCMAKE_TOOLCHAIN_FILE=./xs3a.cmake
pushd build.xcore
make all
# I can't get the following two (custom) targets to build with 'all'.
# Currently an issue with java prevents these from working in CI.
# make tests-legacy_build
# make tests-legacy_build_vanilla
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# YAML schema for GitHub Actions:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
#
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/
#
# This workflow uses actions that are not certified by GitHub. They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support documentation.
#
# This file contains the workflows that are run prior to merging a pull request.

name: CI

on:
push:
branches:
- 'develop'
- 'master'
pull_request:
branches:
- 'develop'
- 'master'

# Allow manually triggering of the workflow.
workflow_dispatch: {}

jobs:
build_tests_xcore:
name: Build Test Apps
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- name: Pull builder container
run: |
docker pull ghcr.io/xmos/xcore_builder:latest

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy

- name: Build
run: |
docker run --rm -w /lib_mic_array -v ${{ github.workspace }}:/lib_mic_array ghcr.io/xmos/xcore_builder:latest bash -l .github/scripts/build_test_apps.sh

57 changes: 57 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# YAML schema for GitHub Actions:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
#
# Helpful YAML parser to clarify YAML syntax:
# https://yaml-online-parser.appspot.com/
#
# This workflow uses actions that are not certified by GitHub. They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support documentation.
#
# This file contains the workflows that are run prior to merging a pull request.

name: Docs

on:
push:
branches:
- 'develop'
- 'master'
pull_request:
branches:
- 'develop'
- 'master'

# Allow manually triggering of the workflow.
workflow_dispatch: {}

jobs:
build_documentation:
name: Build and package documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Pull doc_builder container
run: |
docker pull ghcr.io/xmos/doc_builder:v2.0.0

- name: Build documentation
run: |
docker run --rm -t -u "$(id -u):$(id -g)" -v ${{ github.workspace }}:/build -e REPO:/build -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e EXCLUDE_PATTERNS=/build/doc/doc_excludes.txt -e DOXYGEN=1 -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e PDF=1 ghcr.io/xmos/doc_builder:v2.0.0

- name: Save HTML documentation artifact
uses: actions/upload-artifact@v2
with:
name: lib_mic_array_docs
path: ./doc/_build/html
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
retention-days: 5

- name: Save PDF documentation artifact
uses: actions/upload-artifact@v2
with:
name: lib_xcore_math_docs_pdf
path: ./doc/_build/pdf/programming_guide.pdf
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
retention-days: 5
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
**/.build*/*
bin/
_build/
xcore_sdk/
.vscode/
*.o
*.xe
*.vcd
Expand Down Expand Up @@ -31,6 +33,12 @@ tests/test_results.csv
examples/AN00221_freq_domain_example/doc/pdf/AN00218.pdf
examples/AN00218_app_hires_DAS_fixed/doc/pdf/AN00218.pdf
**/.venv/**
**/__pycache__/
**/.ipynb_checkpoints/

# Any files user wants to keep in their local clone
**/*.local.*
**/*.local.*/


# Unit test runners
Expand Down
32 changes: 27 additions & 5 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
lib_mic_array change log
========================

4.5.0
5.0.2
-----

* REMOVED: Use of Brew for CI
* CHANGED: XMOS Jenkins Shared Library version used in CI
* Documentation improvements.

4.4.0
5.0.1
-----
* Updates lib_mic_array to use lib_xcore_math (formerly lib_xs3_math) version 2.0.2
* Updates CMake project to use CPM to obtain dependencies (when top level project)
* [issue #171] Changes behavior when mic array consumer gets backed up from a quiet deadlock to an ECALL exception
* Also adds a way to allow blocks of PDM to be quietly dropped instead (see AssertOnDroppedBlock())

5.0.0
-----

* Mic Array library redesigned from scratch to make efficient use of XMOS XS3 architecture
* Many unused features from previous versions have been dropped
* Initial v5.0 features:

* Supports 1-, 4-, and 8-bit ports
* Supports both SDR and DDR microphone configurations
* Use 1-16 PDM microphones
* Configurable PDM clock frequency
* Configurable two-stage decimating FIR

* Reference filter with total decimation factor of 192 provided

* Optional DC offset elimination filter
* Configurable frame size (down to single sample)
* Extensible C++ design


* CHANGED: XN files to support 15.x.x tools

4.3.0
-----
Expand Down
58 changes: 58 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
cmake_minimum_required(VERSION 3.14)


# Disable in-source build.
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source build is not allowed! Please specify a build folder.\n\tex:cmake -B build")
endif()

include(cmake/CPM.cmake)

# if( PROJECT_IS_TOP_LEVEL )
# message(STATUS "Configuring as top-level project")
# set( DEV_LIB_MIC_ARRAY 1 )
# endif()

# If DEV_LIB_MIC_ARRAY is not defined, set it to true iff the root
# build dir (CMAKE_BINARY_DIR) is a child of the current source dir.
# This will tell us whether to include the demos and tests.
if(NOT DEFINED DEV_LIB_MIC_ARRAY)
set(DEV_LIB_MIC_ARRAY 0)
get_filename_component(BIN_PARENT ${CMAKE_BINARY_DIR} DIRECTORY)
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${BIN_PARENT}")
set(DEV_LIB_MIC_ARRAY 1)
endif()
endif()

project(lib_mic_array
VERSION 5.0.1
LANGUAGES CXX C ASM)

if( PROJECT_IS_TOP_LEVEL OR ${DEV_LIB_MIC_ARRAY} )
# Fixes issue where .xc files always recompile on Windows
string(REPLACE "-MD" "-MMD" CMAKE_DEPFILE_FLAGS_C ${CMAKE_DEPFILE_FLAGS_C})
endif()

# Add lib_mic_array
add_subdirectory(lib_mic_array)

if( PROJECT_IS_TOP_LEVEL )
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
endif()

# Make vanilla API macro available
include( etc/vanilla/vanilla.cmake )

#**********************
# Demos/Tests
#**********************

if(${DEV_LIB_MIC_ARRAY})
CPMAddPackage(
NAME lib_xcore_math
GIT_REPOSITORY https://github.com/xmos/lib_xcore_math
GIT_TAG v2.1.0
)
add_subdirectory( demos )
add_subdirectory( tests )
endif()
68 changes: 0 additions & 68 deletions Jenkinsfile

This file was deleted.

38 changes: 11 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,47 +1,31 @@
Microphone array library
Microphone Array Library
========================

Summary
-------

The XMOS microphone array library is designed to allow interfacing to PDM
microphones coupled with efficient decimation to user selectable output
sample rates. Additionally, a high resolution delay can be introduced to
each of the individual PDM microphones allowing for individual time shifts.
This library is only available for XS2 devices.
microphones coupled with efficient decimation to user configurable output
sample rates. This library is only available for XS3 devices.

Features
........

The microphone array library has the following features:

- 48kHz, 24kHz, 16kHz, 12kHz and 8kHz output sample rate by default (3.072MHz PDM clock),
- 44.1kHz, 22.05kHz, 14.7kHz, 11.025kHz and 7.35kHz output sample rate by default (2.8224MHz PDM clock),
- 4, 8, 12 or 16 PDM interfaces per tile,
- No less than 70dB of stop band attenuation for all output sample frequencies,
- Configurable latency, ripple and bandwidth,
- Framing, configurable frame size from 1 sample to 8192 samples plus 50% overlapping frames option,
- Windowing and sample index bit reversal within a frame,
- Individual microphone gain compensation,
- DC offset removal,
- Up to 3.072MHz input sample rate,
- High resolution (2.63 microsecond) microphone specific delay lines,
- Every task requires only a 62.5 MIPS core to run,
- Group delay of a maximum of 18 output clock cycles,
- No less than 140dB of dynamic range.

Components
...........

* PDM interface,
* Four channel decimators,
* High resolution delay block.
- 48kHz, 24kHz, 16kHz, 12kHz and 8kHz output sample rate by default (3.072MHz PDM clock)
- Configurable PDM clock divider
- Use the provided reference decimation filter or supply your own
- 1 to 16 PDM microphones
- Supports both SDR and DDR microphone configurations
- Framing with configurable frame size
- DC offset removal
- Extensible C++ design

Software version and dependencies
.................................

The CHANGELOG contains information about the current and previous versions.
For a list of direct dependencies, look for DEPENDENT_MODULES in lib_mic_array/module_build_info.

Related application notes
.........................
Expand Down
Loading