56 4. ANALOG-TO-DIGITAL SIGNAL CONVERSION
To avoid saturation or out-of-range distortion, the input voltage must be between V
ref
and V
ref C
. e full-scale (FS) signal V
ref
is defined as
V
FS
D V
ref
D V
ref C
V
ref
(4.4)
and one least significant bit (LSB) is given by
1 LSB D D
V
ref
2
N
; (4.5)
where N is the number of bits of the A/D converter. Usually, it is assumed that quantization
noise is signal independent and is uniformly distributed over 0:5 LSB and 0:5 LSB. Figure 4.8
shows the quantization noise of an analog signal quantized by a 3-bit A/D converter. It is seen
that, although the histogram of the quantization noise is not exactly uniform, it is reasonable to
consider the uniformity assumption.
4.3 REFERENCES
[1] A. Sehgal and N. Kehtarnavaz, Utilization of two microphones for real-time low-latency
audio smartphone apps, Proc. of IEEE International Conference on Consumer Electronics
(ICCE), Las Vegas, NV, January 2018. DOI: 10.1109/icce.2018.8326213. 71
L3 LAB 3:
ANDROID AUDIO SIGNAL SAMPLING
is lab provides an understanding of the tools provided by the Android API for capturing audio
signals and outputting processed audio signals. Android API documentation is available online
at http://developer.android.com/reference/packages.html. e two relevant packages
for this lab are android.media.AudioRecord for audio input and android.media.AudioTrack
for audio output. As noted in the previous labs, the Android emulator does not support audio
input. Additionally, the computation time on the emulator is not accurate or stable so an actual
smartphone target is required in order to obtain proper computation times in the exercises.
is lab involves an example app demonstrating how to use the Android APIs supplied
in Java and how to wrap C code segments so that they can be executed using the Java Native
Interface ( JNI). e example app records an audio signal from the smartphone microphone and
applies a lowpass filter to the audio signal. An overview of the dataflow is shown in Figure L3.1.
Input samples can come from either a file or from the microphone input. ese samples
are stored in a Java WaveFrame object (a data wrapper class used for transferring of data). e
BlockingQueue interface is used to transfer data from the input source to the processing code,
and finally to the output destination (either file or speaker). Using the BlockingQueue interface
is advantageous because it allows a small buffer for accumulating data, while at the same time
L3. LAB 3: ANDROID AUDIO SIGNAL SAMPLING 57
(a)
(b)
(c)
Time (ms)
Time (ms)
A/D Input/Output
Input/OutputOccurrence
Data
q(t) (LSB)
8
6
4
2
0
60
50
40
30
20
10
0
b3
b2
b1
Vr+
Vm
Vr-
0.5
0
-0.5
0 0.5 1 1.5 2 2.5 3
0
0
0.5
-0.5
100 200 300 400 5000
0.5
1 1.5 2 2.5 3
q (LSB)
Logic Analyzer
Sample Number
Figure 4.8: Quantization of an analog signal by a 3-bit A/D converter: (a) output signal and
quantization error, (b) histogram of quantization error, and (c) bit stream.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.79.70