Copyright © 2019 by Morgan & Claypool
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in
any form or by any means—electronic, mechanical, photocopy, recording, or any other except for brief quotations
in printed reviews, without the prior permission of the publisher.
Smartphone-Based Real-Time Digital Signal Processing, Second Edition
Nasser Kehtarnavaz, Abhishek Sehgal, and Shane Parris
www.morganclaypool.com
ISBN: 9781681734651 paperback
ISBN: 9781681734668 ebook
ISBN: 9781681734675 hardcover
DOI 10.2200/S00885ED2V01Y201811SPR016
A Publication in the Morgan & Claypool Publishers series
SYNTHESIS LECTURES ON SIGNAL PROCESSING
Lecture #16
Series Editor: Joseé Moura, Carnegie Mellon University
Series ISSN
Print 1932-1236 Electronic 1932-1694
Smartphone-Based Real-Time
Digital Signal Processing
Second Edition
Nasser Kehtarnavaz, Abhishek Sehgal, and Shane Parris
University of Texas at Dallas
SYNTHESIS LECTURES ON SIGNAL PROCESSING #16
C
M
&
cLaypoolMor
gan publishers
&
ABSTRACT
Real-time or applied digital signal processing courses are offered as follow-ups to conventional or
theory-oriented digital signal processing courses in many engineering programs for the purpose
of teaching students the technical know-how for putting signal processing algorithms or theory
into practical use. ese courses normally involve access to a teaching laboratory that is equipped
with hardware boards, in particular DSP boards, together with their supporting software. A
number of textbooks have been written discussing how to achieve real-time implementation
on these hardware boards. is book discusses how to use smartphones as hardware boards
for real-time implementation of signal processing algorithms as an alternative to the hardware
boards that are used in signal processing laboratory courses. e fact that mobile devices, in
particular smartphones, have become powerful processing platforms led to the development of
this book enabling students to use their own smartphones to run signal processing algorithms
in real-time considering that these days nearly all students possess smartphones. Changing the
hardware platforms that are currently used in applied or real-time signal processing courses
to smartphones creates a truly mobile laboratory experience or environment for students. In
addition, it relieves the cost burden associated with using dedicated signal processing boards
noting that the software development tools for smartphones are free of charge and are well-
maintained by smartphone manufacturers. is book is written in such a way that it can be
used as a textbook for real-time or applied digital signal processing courses offered at many
universities. Ten lab experiments that are commonly encountered in such courses are covered in
the book. is book is written primarily for those who are already familiar with signal processing
concepts and are interested in their real-time and practical aspects. Similar to existing real-time
courses, knowledge of C programming is assumed. is book can also be used as a self-study
guide for those who wish to become familiar with signal processing app development on either
Android or iPhone smartphones. A zipped file of the codes discussed in the book can be acquired
from this third-party website http://sites.fastspring.com/bookcodes/product/Signa
lProcessingBookcodesSecondEdition .
KEYWORDS
smartphone-based signal processing, real-time signal processing using smart-
phones, smartphones as signal processing boards
vii
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Smartphone Implementation Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Smartphone Implementation Shells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Android Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 Iphone Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Overview of ARM Processor Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.1 Data Flow and Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Organization of Chapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Software Package of Lab Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2
Android Software Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1 Installation Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.1 Java JDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.2 Android Studio Bundle and Native Development Kit . . . . . . . . . . . . . . 13
2.1.3 Environment Variable Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.4 Android Studio Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.5 Android Emulator Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.1.6 Android Studio Setup for Mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
L1 LAB 1:
Getting Familiar with Android Software Tools . . . . . . . . . . . . . . . . . . . . . . . . 25
L1.1 Lab Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3
iOS Software Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.1 App Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2 Setting-up App Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.3 Creating Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.4 Implementing C Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.5 Executing C Codes Via Objective-C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
viii
3.6 Swift Programming Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
L2 LAB 2:
iPhone App Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
L2.1 Lab Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4
Analog-to-Digital Signal Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.1 Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2 Quantization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.3 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
L3 LAB 3:
Android Audio Signal Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
L3.1 Demo Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
L3.2 Application Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
L3.3 Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
L3.4 Processing.Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
L3.5 JNI Native C Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
L3.6 Superpowered SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
L3.7 Multi-reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
L3.8 Multi-Rate Signal Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
L3.9 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
L4 LAB 4:
iPhone Audio Signal Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
L4.1 App Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
L4.2 App Code Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
L4.3 Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
L4.4 Native C Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
L4.5 Multi-reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
L4.6 Multi-Rate Signal Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
L4.7 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5
Fixed-Point vs. Floating-Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.1 Q-Format Number Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.2 Floating-Point Number Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.3 Overflow and Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.4 Some Useful Arithmetic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.4.1 Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.4.2 Sine and Cosine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
..................Content has been hidden....................

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