background image

In a mono-directional audio streaming asymmetric system, the device with voice data is the one with a
microphone and is therefore considered the server. The client device sends requests to the server and accepts
server-initiated updates containing audio data.
Audio data transmission is based on periodic server-to-client notifications which do not require a request or
response from the receiving device. Server-initiated updates are sent as asynchronous notification packets which
include the handle of a characteristic along with its current value.
According to the Bluetooth specification, the peripheral enters advertising mode at start-up and sends
advertisement packets at relatively long intervals. The central unit enters discovery mode and sends a connection
request on reception of an advertisement packet from a slave device. After connection, notifications carrying
audio data are periodically sent from the server to the client.

1.2.5.2 

BlueMic1 service

The Attribute Protocol (ATT) is used by GATT as a transport protocol for exchanging data between devices. The
smallest entities defined by ATT (named attributes) are addressable pieces of information that may contain user
data or meta-information on the attribute architecture, stored in the server and exchanged between client and
server.
GATT server attributes are organized as a sequence of services, each one starting with a service declaration
attribute marking its beginning. Each service groups one or more characteristics and each characteristic can
include zero or more descriptors.
Since audio streaming is not part of the predefined set of profiles, the 

STSW-BLUEMIC-1

 application defines a

vendor-specific service named 

BlueMic1 Service

 based on an 

Audio

 characteristic to expose actual compressed

audio data and a 

Sync

 characteristic to expose collateral information to implement a synchronization mechanism

and an inertial characteristic to expose 3-axis accelerometer and gyroscope raw data.

Table 2. 

BlueMic1 UUID summary table

UUID name

UUID

bluemic1_service_uuid

00000000-0001-11e1-9ab4-0002a5d5c51b

audio_adpcm_char_uuid

08000000-0001-11e1-ac36-0002a5d5c51b

audio_adpcm_sync_char_uuid

40000000-0001-11e1-ac36-0002a5d5c51b

acc_gyr_char_uuid

00E00000-0001-11e1-ac36-0002a5d5c51b

Given the service hierarchical architecture, further characteristics may be added to the BlueMic1 service, such as
configuration of parameters like volume, enabling/disabling of processing algorithms, etc.

1.2.6 

Audio processing

The audio processing component of the 

STSW-BLUEMIC-1

 application is designed to achieve an audio sampling

frequency of 8 or 16 kHz at the receiver side, with a trade-off between audio quality and bandwidth occupation for
voice signals. The audio signal transmitted is compressed via ADPCM (adaptive differential pulse code
modulation) to fit in the available data rate while minimizing radio transmission time and power consumption.
The figure below shows the speech processing chain in a complete communication system with Tx and Rx.
On the Tx side, the library receives an audio signal which is typically acquired by a digital MEMS microphone as a
1-bit PDM signal and converted by a PDM to PCM conversion filter, integrated in the ADC peripheral of the
BlueNRG-1 SoC, into 16-bit PCM samples at 8 or 16 kHz.
The library can be provided with 1, 2, 5 or 10 ms of audio data. When the compressed output buffer is ready, a
flag is set and audio data is streamed via Bluetooth Low Energy together with collateral ADPCM information. The
resulting communication bandwidth is 32 kbps (with 8 kHz audio sampling frequency) or 64 kbps (with 16 kHz
audio sampling frequency) of audio data plus 300 bps of collateral information.

UM2257

Software description 

UM2257

 - 

Rev 2

page 9/35

Содержание STEVAL-BLUEMIC-1

Страница 1: ...tion also embeds digital MEMS microphone MP34DT05 A or MP34DT04 C1 in the first generation board and 3D accelerometer 3D gyroscope which render this evaluation board suitable for a wide range of advan...

Страница 2: ...5 500 1000 2000 dps Voltage supply 1V8 or 3V3 Battery or USB powered On board STBC08 linear Li Ion battery charger SWD connector Included in the development kit package STEVAL BLUEMIC 1 Plastic box fo...

Страница 3: ...connected to the battery Figure 5 Plastic case an ST LINK SWD programming cable to program the evaluation board connected to ST LINK Figure 6 SWD cable 1 1 3 Evaluation board The STEVAL BLUEMIC 1 eva...

Страница 4: ...p B LSM6DSL iNEMO inertial module low power 3D accelerometer and 3D gyroscope C MP34DT05 A MEMS audio sensor digital microphone MP34DT04 C1 in the first generation board D Button User button E LED A b...

Страница 5: ...47K R16 0R R15 NC GND GND 1 USB USB MICRO 1 2 3 4 SH1 SH2 5 C7 4 7 F R14 2K SW1 PWR R5 4K7 R11 140K CHRG 2 1 SWD 1 2 3 4 5 U2 LDK120M R EN 3 GND 2 IN 1 ADJ 4 OUT 5 R12 105K U1 STBC08PMR PROG 5 CHRG 3...

Страница 6: ...K R3 4K7 M1 MP34DT05 A DOUT 4 LR 2 GND 5A VDD 1 CLK 3 GND 5B GND 5D GND 5C R10 100 R9 1K R4 1K C6 10nF C4 100nF R6 4K7 C3 100nF Button1 1 2 3 4 5 6 U4 LSM6DSL GND1 6 VDDIO 5 INT1 4 SCx 3 SDx 2 SDO SA0...

Страница 7: ...SW BLUEMIC 1 allows an STEVAL BLUEMIC 1 evaluation board to act as a peripheral in a point to point connection with a mobile device running the ST BlueMS app available for Android and iOS In this conf...

Страница 8: ...or GAP The STEVAL BLUEMIC 1 evaluation board acts as a peripheral device supporting a single connection and low complexity This device only requires a controller that supports the slave role The cent...

Страница 9: ...udio data and a Sync characteristic to expose collateral information to implement a synchronization mechanism and an inertial characteristic to expose 3 axis accelerometer and gyroscope raw data Table...

Страница 10: ...ze 16 bits Channels 1 mono Audio sample rate 8 16 kHz Figure 14 ADPCM encode decode schema BlueVoiceADPCM implements a modified version of the compression algorithm with improved communication robustn...

Страница 11: ...s performed between two ST modules the selected connection interval is the minimum value 10 ms The target 64 kbps constant data rate is achieved by sending 80 bytes of ADPCM data 640 bits at each conn...

Страница 12: ...l a central node requests a connection When the connection is estabilished the app status is set to APP_STATUS_CONNECTED and two different demos can be activated from the ST BlueMS app running on the...

Страница 13: ...tatus when the module is no longer streaming or receiving the profile status switches to BV_ADPCM_BNRG1_STATUS_READY as soon as the timer expires The timeout duration in ms is defined by BV_ADPCM_BNRG...

Страница 14: ...nels channel_tot according to the previous library configuration and the number of PCM samples for each channel given as input An amount of data equal to 1 2 5 or 10 ms is accepted otherwise an BV_ADP...

Страница 15: ...BLUEMIC 1 evaluation board on or off The battery can be recharged via USB connected to a PC or any micro USB battery charger A red LED indicates the charging status steady ON the board is charging ste...

Страница 16: ...your STM32 Nucleo board to the STEVAL BLUEMIC 1 evaluation board via the cable provided paying attention to the polarity of the connectors Pin 1 is identified by a small dot on the PCB silkscreen on t...

Страница 17: ...oard as explained in the previous sections and program it with the relevant binary file STSW BLUEMIC1_8kHz bin included in the software package In this configuration a point to point connection is cre...

Страница 18: ...ow how the app works but the procedure is the same for the iOS app 3 Start the scanning procedure when the app is ready 4 Wait until BVBNRG1 appears in the device list If it does not appear clear the...

Страница 19: ...ing by pressing the button on the evaluation board The volume can be adjusted via the slider on the BlueVoice page or muted by clicking on the speaker icon Figure 23 BlueMS Android version BlueVoice d...

Страница 20: ...elected the ASR service provided by iFlyTek is enabled Pushing the button on the bottom right hand of the screen it becomes green and the speech to text service starts The recognition is continuous an...

Страница 21: ...e Section 2 4 1 2 4 Google speech ASR Key generation to enable the ASR feature a popup window prompts the insertion of a valid API key followed by the ASR service activation key Figure 26 BlueMS Andro...

Страница 22: ...button to record your voice for subsequent recognition While the button is pressed a bar progressively indicates the elapsed recording time When you release the button a Sending request message appear...

Страница 23: ...Figure 28 BlueMS Android version voice recording The speech recognized by the ASR service appears below the volume bar UM2257 STEVAL BLUEMIC 1 evaluation board demos UM2257 Rev 2 page 23 35...

Страница 24: ...to access the web based service You need a Google account to complete the procedure and access the service To generate a key Procedure Step 1 Login with your own Google account Step 2 Subscribe to Ch...

Страница 25: ...s group button to join the Chromium dev group Figure 32 Google Chromium dev join the group Step 6 Go to https console developers google com project Step 7 Click on Create a project Figure 33 Google Ch...

Страница 26: ...API in the search box and select correct result Figure 36 Google Developers Console select API Step 12 Enable the Speech API clicking on the blue button Figure 37 Google API Manager enable API Step 13...

Страница 27: ...data acquired from the on board 3 axis accelerometer and gyroscope Swipe from the right to open a new page that allows a real time plot of inertial raw data received from the evaluation board Gyrosco...

Страница 28: ...streaming from the evaluation board to an STM32Nucleo stack running the FP AUD BVLINK1 central application The audio can be acquired at 8 or 16 kHz of sampling frequency the transmitter and the receiv...

Страница 29: ...l to central device starts Note In a different version of the evaluation board the color of the LED can be inverted 3 As soon as the central unit is recognized as a standard USB microphone select the...

Страница 30: ...ity recording voice streamed by the peripheral 6 Stop or restart the streaming by pressing the user button on the evaluation board UM2257 Streaming to an STM32 Nucleo board used as a receiver UM2257 R...

Страница 31: ...Revision history Table 3 Document revision history Date Version Changes 17 Jul 2017 1 Initial release 08 Feb 2018 2 Added new product MP34TD05 A UM2257 UM2257 Rev 2 page 31 35...

Страница 32: ...description 12 1 3 BlueVoiceADPCM_BNRG1 library software description 13 1 3 1 Initialization and configuration 13 1 3 2 Working mode setup 13 1 3 3 Audio signal injection 14 1 3 4 Compressed audio st...

Страница 33: ...ist of tables Table 1 STEVAL BLUEMIC 1 evaluation board main component details 4 Table 2 BlueMic1 UUID summary table 9 Table 3 Document revision history 31 UM2257 List of tables UM2257 Rev 2 page 33 3...

Страница 34: ...ice 18 Figure 22 BlueMS Android version app device list 18 Figure 23 BlueMS Android version BlueVoice demo 19 Figure 24 BlueMS Android version ASR language selection 20 Figure 25 BlueMS Android versio...

Страница 35: ...the choice selection and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products No license express or implied to any intellectual property righ...

Отзывы: