1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests/driver_dac_dds
chrysn 4596f79c95 tests/dac_dds: Fix sine wave to fit in PCM range
The previous sine wave cast signed integers into the PCM range, causing
jumps at zero transitions. This shifts everything up by the respective
maximum signed integer, so that the signed idle zero becomes the
unsigned PCM signal's idle half-point and can continuously cover the
whole unsigned range.
2021-03-24 00:35:19 +01:00
..
hello.raw tests/driver_dac_dds: use clearer hello recording 2020-12-13 02:05:54 +01:00
main.c tests/dac_dds: Fix sine wave to fit in PCM range 2021-03-24 00:35:19 +01:00
Makefile tests: add samd10-xmini to Makefile.ci 2020-12-11 18:33:31 +01:00
README.md tests/driver_dac_dds: use clearer hello recording 2020-12-13 02:05:54 +01:00

About

This is a manual test, and demo application for DAC DDS.

Usage

This application will initialize the single default DAC DDS channel, and play sine, square, sawtooth waves or a greeting audio on it as requested on the command line.

Typical usage:

> hello
> sine 440 2

Audio source and license

hello.raw is an audio rendition of GeoTrinity saying "Ahoy!". It was obtained from https://en.wikipedia.org/wiki/File:GT_Ahoi_Deutsch_GT.ogg where it is annotated to be licensed under CC-BY-SA 3.0 international.

It was converted and trimmed using:

$ ffmpeg -i GT_Ahoi_Deutsch_GT.ogg -ac 1 -ar 8000 -f u8 -c:a pcm_u8 hello.raw
$ python3 -c "s = open('hello.raw', 'rb').read(); s = s.strip(b'\x80') + b'\x80'; open('hello.raw', 'wb').write(s)"