config.h may contain defines like _FILE_OFFSET_BITS which influence
the system wide include files (off_t types, open -> open64 function
usage etc.).
Related: https://github.com/alsa-project/alsa-utils/pull/223
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add function generate_sine_wave_raw_mono(). It serves as a single
channel sine wave generator, to provide data for calculation (e.g.
for noise analysis).
The function is similar to generate_sine_wave(), but a lite revision.
It has no dependency on bat channels and target frequency, no malloc
inside, no data conversion from float to integer samples, and supports
one channel only.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The function adjust_waveform() is a component of generate_sine_wave(),
and depended on bat->channels parameter. Add parameter "channels" to
remove the dependency, and then adjust_waveform() can be applied on
other use cases, e.g. a single channel sine wave generator.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Aligning the data type of fftw analyzer, sample converter and other
components on float, because:
1. avoid unnecessary data type conversion;
2. using float is more efficient than using double;
3. the extra double accuracy is not required.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix a possible memory leak in generate_sine_wave(). Memory free was
ignored when the function return an error.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move all alsa callings to a single block (alsa.c), so other blocks
such as the main structure, the signal process and the data analysis
modules will be independent to alsa, and new modules such as a
tinyalsa interface can be easily embedded into alsabat.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add function that generates sine waveform through math lib.
The waveform can be used as source for playback or analysis.
Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Bernard Gautier <bernard.gautier@intel.com>
Signed-off-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>