100% found this document useful (2 votes)
9 views

Smartphone based real time digital signal processing Third Edition Abhishek Sehgal pdf download

Ebook access

Uploaded by

uzairezikegz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
9 views

Smartphone based real time digital signal processing Third Edition Abhishek Sehgal pdf download

Ebook access

Uploaded by

uzairezikegz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

Smartphone based real time digital signal

processing Third Edition Abhishek Sehgal


download

https://textbookfull.com/product/smartphone-based-real-time-
digital-signal-processing-third-edition-abhishek-sehgal/

Download more ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Real Time Digital Signal Processing from MATLAB to C


with the TMS320C6x DSPs Third Edition Morrow

https://textbookfull.com/product/real-time-digital-signal-
processing-from-matlab-to-c-with-the-tms320c6x-dsps-third-
edition-morrow/

Radiation Hardened CMOS Integrated Circuits for Time


Based Signal Processing Jeffrey Prinzie

https://textbookfull.com/product/radiation-hardened-cmos-
integrated-circuits-for-time-based-signal-processing-jeffrey-
prinzie/

Conceptual Digital Signal Processing with MATLAB


Keonwook Kim

https://textbookfull.com/product/conceptual-digital-signal-
processing-with-matlab-keonwook-kim/

Digital Image Processing A Signal Processing and


Algorithmic Approach 1st Edition D. Sundararajan
(Auth.)

https://textbookfull.com/product/digital-image-processing-a-
signal-processing-and-algorithmic-approach-1st-edition-d-
sundararajan-auth/
From Algebraic Structures to Tensors Digital Signal and
Image Processing Matrices and Tensors in Signal
Processing Set 1st Edition Gérard Favier (Editor)

https://textbookfull.com/product/from-algebraic-structures-to-
tensors-digital-signal-and-image-processing-matrices-and-tensors-
in-signal-processing-set-1st-edition-gerard-favier-editor/

Smartphone Based Medical Diagnostics Jeong-Yeol Yoon

https://textbookfull.com/product/smartphone-based-medical-
diagnostics-jeong-yeol-yoon/

Think DSP Digital Signal Processing in Python 1st


Edition Allen B. Downey

https://textbookfull.com/product/think-dsp-digital-signal-
processing-in-python-1st-edition-allen-b-downey/

Digital Signal Processing with Matlab Examples Volume 3


Model Based Actions and Sparse Representation 1st
Edition Jose Maria Giron-Sierra (Auth.)

https://textbookfull.com/product/digital-signal-processing-with-
matlab-examples-volume-3-model-based-actions-and-sparse-
representation-1st-edition-jose-maria-giron-sierra-auth/

Fundamentals of acoustic field theory and space-time


signal processing Lawrence J. Ziomek

https://textbookfull.com/product/fundamentals-of-acoustic-field-
theory-and-space-time-signal-processing-lawrence-j-ziomek/
Smartphone-Based Real-Time
Digital Signal Processing
Third Edition
Synthesis Lectures on Signal
Processing
Editor
José Moura, Carnegie Mellon University
Synthesis Lectures in Signal Processing publishes 80- to 150-page books on topics of interest to
signal processing engineers and researchers. The Lectures exploit in detail a focused topic. They can
be at different levels of exposition-from a basic introductory tutorial to an advanced
monograph-depending on the subject and the goals of the author. Over time, the Lectures will
provide a comprehensive treatment of signal processing. Because of its format, the Lectures will
also provide current coverage of signal processing, and existing Lectures will be updated by authors
when justified.
Lectures in Signal Processing are open to all relevant areas in signal processing. They will cover
theory and theoretical methods, algorithms, performance analysis, and applications. Some Lectures
will provide a new look at a well established area or problem, while others will venture into a brand
new topic in signal processing. By careful reviewing the manuscripts we will strive for quality both
in the Lectures’ contents and exposition.

Smartphone-Based Real-Time Digital Signal Processing, Third Edition


Nasser Kehtarnavaz, Abhishek Sehgal, Shane Parris, and Arian Azarang
2020

Anywhere-Anytime Signals and Systems Laboratory: from MATLAB to Smartphones,


Third Edition
Nasser Kehtarnavaz, Fatemeh Saki, Adrian Duran, and Arian Azarang
2020

Reconstructive-Free Compressive Vision for Surveillance Applications


Henry Braun, Pavan Turaga, Andreas Spanias, Sameeksha Katoch, Suren Jayasuriya, and Cihan
Tepedelenlioglu
2019

Smartphone-Based Real-Time Digital Signal Processing, Second Edition


Nasser Kehtarnavaz, Abhishek Sehgal, Shane Parris
2018
iv
Anywhere-Anytime Signals and Systems Laboratory: from MATLAB to Smartphones,
Second Edition
Nasser Kehtarnavaz, Fatemeh Saki, and Adrian Duran
2018

Anywhere-Anytime Signals and Systems Laboratory: from MATLAB to Smartphones


Nasser Kehtarnavaz and Fatemeh Saki
2017

Smartphone-Based Real-Time Digital Signal Processing


Nasser Kehtarnavaz, Shane Parris, and Abhishek Sehgal
2015

An Introduction to Kalman Filtering with MATLAB Examples


Narayan Kovvali, Mahesh Banavar, and Andreas Spanias
2013

Sequential Monte Carlo Methods for Nonlinear Discrete-Time Filtering


Marcelo G.S. Bruno
2013

Processing of Seismic Reflection Data Using MATLAB™


Wail A. Mousa and Abdullatif A. Al-Shuhail
2011

Fixed-Point Signal Processing


Wayne T. Padgett and David V. Anderson
2009

Advanced Radar Detection Schemes Under Mismatched Signal Models


Francesco Bandiera, Danilo Orlando, and Giuseppe Ricci
2009

DSP for MATLAB™ and LabVIEW™ IV: LMS Adaptive Filtering


Forester W. Isen
2009

DSP for MATLAB™ and LabVIEW™ III: Digital Filter Design


Forester W. Isen
2008

DSP for MATLAB™ and LabVIEW™ II: Discrete Frequency Transforms


Forester W. Isen
2008
v
DSP for MATLAB™ and LabVIEW™ I: Fundamentals of Discrete Signal Processing
Forester W. Isen
2008

The Theory of Linear Prediction


P. P. Vaidyanathan
2007

Nonlinear Source Separation


Luis B. Almeida
2006

Spectral Analysis of Signals: The Missing Data Case


Yanwei Wang, Jian Li, and Petre Stoica
2006
Copyright © 2020 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, Third Edition


Nasser Kehtarnavaz, Abhishek Sehgal, Shane Parris, and Arian Azarang
www.morganclaypool.com

ISBN: 9781681739458 paperback


ISBN: 9781681739465 ebook
ISBN: 9781681739472 hardcover

DOI 10.2200/S01039ED3V01Y202008SPR019

A Publication in the Morgan & Claypool Publishers series


SYNTHESIS LECTURES ON SIGNAL PROCESSING

Lecture #19
Series Editor: José Moura, Carnegie Mellon University
Series ISSN
Print 1932-1236 Electronic 1932-1694
Smartphone-Based Real-Time
Digital Signal Processing
Third Edition

Nasser Kehtarnavaz
University of Texas at Dallas

Abhishek Sehgal
University of Texas at Dallas

Shane Parris
University of Texas at Dallas

Arian Azarang
University of Texas at Dallas

SYNTHESIS LECTURES ON SIGNAL PROCESSING #19

M
&C Morgan & cLaypool 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 pur-
pose of teaching students the technical know-how for putting signal processing algorithms or
theory into practical use. These 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 imple-
mentation on these hardware boards. This book discusses how to use smartphones as hardware
boards for real-time implementation of signal processing algorithms, thus providing an alterna-
tive to the hardware boards that are used in signal processing laboratory courses. The fact that
mobile devices, in particular smartphones, have become powerful processing platforms led to
the development of this book to enable students to use their own smartphones to run signal
processing algorithms in real-time considering that these days nearly all students possess smart-
phones. Changing the hardware platforms that are currently used in applied or real-time signal
processing courses to smartphones creates a truly flexible laboratory experience or environment
for students. In addition, it relieves the cost burden associated with using dedicated signal pro-
cessing boards noting that the software development tools for smartphones are free of charge
and are well-maintained by smartphone manufacturers. This 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 cov-
ered in the book. It 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. This 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 iOS smartphones/tablets. A zipped file of the codes discussed in the book can be
acquired from this third-party website.

KEYWORDS
smartphone-based signal processing, real-time signal processing using smart-
phones, smartphones as signal processing boards
ix

Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Smartphone Implementation Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Smartphone Implementation Shells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Android Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 iOS Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Overview of ARM Processor Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.1 Data Flow and Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Organization of Chapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
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 . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.1.4 Android Studio Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.1.5 Android Emulator Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.1.6 Android Studio Setup for Mac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
L1 LAB 1:
Getting Familiar with Android Software Tools . . . . . . . . . . . . . . . . . . . . . . . . 28
L1.1 Lab Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

3 iOS Software Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43


3.1 App Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2 Setting-Up App Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3 Creating Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.4 Implementing C Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.5 Executing C Codes via Objective-C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
x
3.6 Swift Programming Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
L2 LAB 2:
iPhone App Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
L2.1 Lab Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

4 Analog-to-Digital Signal Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55


4.1 Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.2 Quantization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
L3 LAB 3:
Android Audio Signal Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
L3.1 Demo Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
L3.2 Application Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
L3.3 Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
L3.4 Processing.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
L3.5 JNI Native C Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
L3.6 Superpowered SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
L3.7 Multi-Threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
L3.8 Multi-Rate Signal Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
L3.9 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
L4 LAB 4:
iPhone Audio Signal Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
L4.1 App Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
L4.2 App Code Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
L4.3 Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
L4.4 Native C Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
L4.5 Multi-Threading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
L4.6 Multi-Rate Signal Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
L4.7 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

5 Fixed-Point vs. Floating-Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85


5.1 Q-Format Number Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.2 Floating-Point Number Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
5.3 Overflow and Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.4 Some Useful Arithmetic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.4.1 Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.4.2 Sine and Cosine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
xi
5.4.3 Square Root . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
L5 LAB 5:
Fixed-Point and Floating-Point Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
L5.1 App Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
L5.2 NEON SIMD Coprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
L5.3 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

6 Real-Time Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.1 FIR Filter Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.2 Circular Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
6.3 Frame Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.4 Finite Word Length Effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
L6 LAB 6:
Real-Time FIR Filtering, Quantization Effect, and Overflow . . . . . . . . . . . . 104
L6.1 Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
L6.2 ARM Overflow Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
L6.3 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

7 Adaptive Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113


7.1 Infinite Impulse Response Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
7.2 Adaptive Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
L7 LAB 7:
IIR Filtering and Adaptive FIR Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
L7.1 IIR Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
L7.2 Adaptive FIR Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
L7.3 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
7.4 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

8 Domain Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121


8.1 Fourier Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
8.1.1 Discrete Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
8.1.2 Fast Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
8.2 Leakage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8.3 Windowing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8.4 Overlap Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
xii
8.5 Reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
8.5.1 Inverse Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
8.5.2 Overlap-Add Reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
L8 LAB 8:
Frequency Domain Transforms – DFT and FFT . . . . . . . . . . . . . . . . . . . . . . 130
L8.1 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
8.7 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

9 Code Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137


9.1 Code Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
9.2 Linear Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
9.3 Compiler Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
9.4 Efficient C Code Writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
9.5 Architecture-Specific Optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
9.5.1 Target Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
9.5.2 ARM Hardware Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
9.5.3 NEON Intrinsics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
L9 LAB 9:
Code Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
L9.1 Compiler Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
L9.2 Target Architecture (Android Only) . . . . . . . . . . . . . . . . . . . . . . . . . 147
L9.3 Code Modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
9.7 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

10 Implementation via MATLAB Coder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149


10.1 MATLAB Function Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
10.2 Test Bench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
10.3 Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
10.4 Source Code Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
10.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
L10 LAB 10:
Matlab Coder Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
L10.1 Lab Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
10.7 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

Authors’ Biographies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
xiii

Preface
Real-time or applied digital signal processing courses are offered as follow-up courses to con-
ventional or theory-oriented digital signal processing courses in many electrical engineering cur-
ricula. The purpose of offering real-time or applied digital signal processing courses is to enable
students to bridge the gap between signal processing theory and implementation aspects.
A typical real-time or applied digital signal processing course is normally held within the
confines of a teaching laboratory room that is equipped with hardware platforms and the accom-
panying software for those platforms. The fact that mobile devices, in particular smartphones,
have become powerful processing platforms led to the development of this book toward enabling
students to use their own smartphones as implementation platforms for running signal pro-
cessing algorithms as apps considering that these days nearly all students possess smartphones.
Changing the hardware platforms that are normally used in real-time applied signal processing
courses to smartphones creates a truly flexible (anywhere-anytime) laboratory experience or en-
vironment for students. In addition, it relieves the cost burden associated with using dedicated
signal processing hardware boards noting that the software development tools for smartphones
are free of charge and are well-maintained by smartphone manufacturers.
This book is written in such a way that it can be used as a textbook for real-time or ap-
plied digital signal processing courses offered at many universities. Ten lab experiments that are
commonly encountered in such courses are covered in the book. It 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 as-
sumed. This 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 iOS smartphones/tablets. In this
third edition, various updates are made to reflect the newer versions of the software tools used
in the first and second editions.
The smartphone-based approach covered in this book eases the constraint of a ded-
icated signal processing laboratory for the purpose of offering applied or real-time sig-
nal processing courses as it provides an anywhere-anytime platform for implementation
of signal processing algorithms. A zipped file of the codes discussed in the book can
be acquired from this third-party website http://sites.fastspring.com/bookcodes/product/
SignalProcessingBookcodesThirdEdition.
xiv PREFACE
As a final note, I would like to thank my co-authors and former/current students Abhishek
Sehgal, Shane Parris, and Arian Azarang, for their contributions in the first, second, and third
editions.

Nasser Kehtarnavaz
Summer 2020
1

CHAPTER 1

Introduction
Applied or real-time digital signal processing courses offered at many universities have greatly
enhanced students’ learning of signal processing concepts by covering practical aspects of imple-
menting signal processing algorithms. DSP processor boards are often deployed in these courses.
To a lesser extent, ARM-based boards such as Raspberry Pi [1] are utilized. A number of text-
books are available discussing how to implement signal processing algorithms on DSP boards,
e.g., [1–6]. This book is written to provide an alternative hardware platform which students can
use in an anywhere-anytime manner and at no cost as it is already in their possession, that being
their own smartphones.
Not only do there exist hardware and software costs associated with equipping a teaching
laboratory with DSP or other types of signal processing boards, in many cases these boards are
confined to a specific teaching laboratory location. Taking advantage of the ubiquitous utilization
of ARM processors in mobile devices, in particular smartphones, this book covers an alternative
approach to teaching applied or real-time DSP courses by enabling students to use their own
smartphones to implement signal processing algorithms. Changing the hardware platforms that
are currently used in applied or real-time signal processing courses to smartphones creates a truly
flexible laboratory experience or environment for students. In addition, it relieves the cost burden
associated with using a dedicated signal processing board noting that the software development
tools for smartphones are free of charge and are well-maintained.
This book addresses the process of developing signal processing apps on smartphones in
a step-by-step manner. It shows how to acquire sensor data, implement typical signal process-
ing algorithms encountered in a real-time or applied digital signal processing course, and how
to generate output or display information. It should be noted that these steps are carried out
for both the Android and iOS operating systems and besides smartphones, the apps developed
can be run on any ARM-based mobile targets such as tablets. The laboratory experiments that
are included cover the following topics: signal sampling and i/o buffering, quantization effects,
fixed-point vs. floating-point implementation, finite impulse response (FIR) filtering, infinite
impulse response (IIR) filtering, adaptive filtering, discrete Fourier transform/fast Fourier trans-
form (DFT/FFT) frequency transformation, and optimization techniques to gain computa-
tional efficiency.
2 1. INTRODUCTION
1.1 SMARTPHONE IMPLEMENTATION TOOLS
The main challenge in this alternative approach to real-time or applied digital signal process-
ing courses lies in the difference between the programming environments on smartphones and
C programming normally used in such real-time courses. Since a typical applied or real-time
signal processing course requires familiarity with C programming, the same C programming
familiarity is retained for this alternative approach, i.e., by not requiring students to know other
programming languages. This challenge is met here by developing Java (for Android smart-
phones) and Objective-C (for iPhone smartphones) software shells to run C codes seamlessly
so that the prerequisite programming knowledge students need to have would be no different
than what is currently required.
To allow C codes to be written and compiled on Android smartphone targets, the follow-
ing cost-free downloadable development tools are utilized: Android Studio [7], Android Soft-
ware Development Kit (SDK) [7], and Android Native Development Kit (NDK) [8]. These
tools provide a comprehensive development environment incorporating an Integrated Develop-
ment Environment (IDE), Android SDK plug-ins, and an emulator. The NDK provides the
support for incorporating C/CCC codes within Android Studio.
To allow C codes to be written and compiled on iOS smartphone targets (iPhones),
the Xcode IDE [9] and a Mac computer running OS are utilized. It is worth stating that for
iPhone implementation, it is required to register as an iOS developer to be able to run iPhone
apps [10]. The Xcode IDE incorporates an editor, the iOS SDK, a built-in debugger for C, and
an iPhone/iPad simulator.

1.2 SMARTPHONE IMPLEMENTATION SHELLS


The developed implementation shells for the Android and iOS platforms provide the program-
ming environment needed to perform signal processing laboratory experiments. As shown in
Figure 1.1, the shells comprise parts or components which match in functionality for the two
platforms. The major difference between the two platforms lies in the programming language.
For Android smartphones, the programming language of the shell is Java, and for iOS smart-
phones, it is Objective-C. Both platforms support implementing codes written in C and this
feature is used to provide a uniform programming approach regardless of the type of smart-
phones students possess.

1.2.1 ANDROID IMPLEMENTATION


The developed Android shell consists of the following three major parts or components.

User Interface The user interface (UI) comprises the so-called main activity in Java which al-
lows controlling the shell operation and displaying outputs. The component PreferencesUI com-
plements the main activity by controlling operational parameters.
1.2. SMARTPHONE IMPLEMENTATION SHELLS 3

Figure 1.1: Components of the developed shell programs to run C codes on iOS and Android
smartphones/tablets.

I/O Handler The audio input/output (I/O) is split into three modules depending on their
functionality. Microphone recording is handled by the module WaveRecorder, audio file reading
is handled by the module WaveReader, and speaker and debug outputs are handled by the module
WaveSaver. The user is given the option to select one of the two modules WaveRecorder and
WaveReader. In both cases, the module WaveRecorder is used for outputs.
Processing This module allows running C codes within the Android shell. Additional code
segments are written to interface with the Java modules using the Java Native Interface ( JNI)
programming framework.

1.2.2 iOS IMPLEMENTATION


The developed iOS shell also consists of three major parts that match the Android shell:
User Interface (UI) The UI module handles displaying program outputs and all interactions
with the user. It provides an interface for the user to change the parameters required by the
processing algorithm. The component Main.Storyboard contains the UI elements and the com-
ponent ViewController handles all UI events such as user interaction or parameter changes.
I/O Handler This module gathers data to be processed by the processing algorithm depending
on the source specified by the user. The component IosAudioController described in [11] is used
to gather data from the microphone and provide data to a C code for processing. This component
4 1. INTRODUCTION
is also responsible for outputting processed audio signals to the speaker. When using an audio
file, the component audioReader handles reading stored audio files and passing them to C codes
for processing.

Processing This module allows running signal processing algorithms for the lab experiments
that are written in C. This module processes and returns data provided by the I/O Handler.

1.3 OVERVIEW OF ARM PROCESSOR ARCHITECTURE


ARM is the processing engine that is used in modern smartphones. The ARM (Advanced RISC
Machine) architecture has been extensively used in embedded systems. Its designs are licensed
and incorporated into a wide range of embedded systems and low power mobile devices. The
ARM architecture refers to a family of reduced instruction set computing (RISC) architectures
produced by the company ARM. The most common architectures currently in use for mobile de-
vices are the ARMv7 architecture which supports 32-bit addressing/arithmetic and the ARMv8
architecture which supports 64-bit addressing/arithmetic. An overview of the ARMv7 archi-
tecture is provided next.

1.3.1 DATA FLOW AND REGISTERS


The RISC nature of the ARM architecture means that arithmetic operations take place in a
load/store manner. Figure 1.2 shows a diagram of the dataflow in an ARM core. ARM registers,
that are all of uniform 32-bit width, consist of 13 general purpose registers (r0 to r12) and these
three additional special use registers: stack pointer (SP or r13) which contains a pointer to the
active stack, link register (LR or r14) which stores a return value when a branch instruction is
called, and program counter (PC or r15) which contains a pointer to the current instruction
being executed. In addition, there is one special register called Current Program Status Register
(CPSR) which holds Application Program Status Register (APSR) and additional processor
state flags. APSR refers to the ALU status flag bits set by the previous instruction in bits 31
to 27 of CPSR. Starting with bit 31, these values indicate negative, zero, carry, overflow, and
saturation.
The execution pipeline varies between different versions of the ARM architecture. In-
structions can be either from the ARM instruction set, which consists of 32-bit instructions, or
from the Thumb instruction set, which consists of 16-bit instructions providing a compact data
processing capability.
Some other features of the ARM architecture include barrel shifter, shown as part of the
ALU in Figure 1.3, which is capable of performing logical left and right shifts, arithmetic right
shifts, rotate right, and rotate right extended operations on operand B. Another feature is the
ability to perform conditional execution. For instance, when decrementing an index as part of a
loop, the test for zero can be performed with no overhead as part of the subtraction operation;
the condition result is then used to break out of the loop. Other features such as the Advanced
1.4. ORGANIZATION OF CHAPTERS 5

Figure 1.2: ARM processor data flow.

Single Instruction Multiple Data (SIMD) (NEON) coprocessor [12] will be discussed in later
chapters. Interested readers can refer to [13] for additional and more detailed materials regarding
the ARM architecture.

1.4 ORGANIZATION OF CHAPTERS


The chapters that follow are organized as follows. In Chapters 2 and 3, the smartphone software
tools are presented, and the steps one needs to take in order to create a basic smartphone app are
discussed. Chapter 2 covers the setup of the Android Studio programming environment, and
Lab L1 shows the development of a “Hello World” app for Android smartphones.
6 1. INTRODUCTION

Figure 1.3: ARM cortex-A15 instruction pipeline.

Chapter 3 and Lab L2 are the counterparts of Chapter 2 and Lab L1 focusing instead on
the iOS operating system. Chapter 3 details the setup of the Xcode programming environment
and duplicates the “Hello World” app from Lab L1. It also includes the debugging tool for iOS
smartphones.
Chapter 4 introduces the topics of signal sampling and frame-based processing, and the
steps that are required to interface with the A/D and D/A (analog-to-digital and digital-to-
analog) converters for audio signal input and output on a smartphone target. As part of this
process, the smartphone app shells for the Android and iOS smartphone platforms are covered
in detail. The Java and Objective-C shells are discussed, and the steps to incorporate C codes
are explained.
Labs L3 and L4 in Chapter 4 show how to sample an analog signal, process it, and pro-
duce an output in real-time on an Android and iOS smartphone target, respectively. Lab L3
covers the Android development environment, and Lab L4 the iOS development environment.
These lab experiments involve processing a frame of signal samples captured by the smartphone
microphone. The frame length can be altered by the user through a graphical-user-interface
(GUI) settings menu. The sampling rate can also be altered depending on the sampling rates
permitted by the A/D converter of the smartphone target used. It is normally possible to al-
ter the sampling rate on a smartphone from 8–48 kHz. A lowpass FIR filter together with a
user-specified delay are considered in this lab experiment. The delay is meant to simulate an
additional signal processing algorithm running on the ARM processor of the smartphone. The
delay can be changed by the user through the settings menu, adding additional processing time
to the lowpass filtering time. By increasing the sampling frequency or lowering the sampling
time interval, data frames will get skipped and hence a real-time throughput cannot be met.
Besides skipped frames noted on the GUI, one can hear both the original signal and the filtered
signal through the speaker of the smartphone and notice the distortion caused by skipped frames
1.4. ORGANIZATION OF CHAPTERS 7
due to the real-time demand. Distortion can also be experienced by increasing the processing
time delay, thus demonstrating that a real-time throughput is a balance between computational
complexity and computation rate. Processing of one frame of data needs to be done in less than
N  dt sec in order to achieve a real-time throughput, where N denotes the frame length and
dt the sampling time interval. For example, for a sampling rate of 8 kHz and a frame length
of 256, the processing needs to be completed within 32 ms in order for all the frames to get
processed without any frames getting skipped.
In Chapter 5, fixed-point and floating-point number representations are discussed and
their differences are pointed out. Lab L5 in Chapter 5 gives suggestions on how one may cope
with the overflow problem. This lab experiment involves running an FIR filter on a smartphone
using fixed-point arithmetic. 16 bits are used to quantize the double-precision floating-point fil-
ter coefficients generated by a filter design package. Due to quantization, the frequency response
of the filter is affected. The quantization word length can be adjusted in the settings menu and
the deviation of the frequency response magnitude can be observed in a graph displayed auto-
matically in the user interface. The settings menu allows the user to alter the quantization bits
to examine the deviation of the frequency response from the frequency response of the floating-
point implementation. In addition, due to quantization, overflows may occur depending on the
number of coefficients. This experiment shows how scaling can be used to overcome overflows
by scaling down input samples and scaling back up output samples generated by the filter.
Chapters 6 and 7 discuss common filters used in digital signal processing applications.
Lab L6 in Chapter 6 covers FIR filtering and Lab L7 in Chapter 7 shows how adaptive filtering
can be used to perform system identification. The experiment in Lab L7 exhibits adaptive fil-
tering where an adaptive FIR filter based on the least mean squares (LMS) coefficient update is
implemented to match the output of an IIR filter. The error between the output of the adaptive
FIR filter and the IIR filter for an input signal is measured and displayed on the smartphone
screen in real-time as the app runs. Over time the error between the two outputs converges to-
ward zero. The user can experiment with the rate of convergence by altering the adaptive filter
order through the settings menu without needing to recompile the code. As the filter order is
increased, it can be observed that the convergence rate also increases. The drawback of increasing
the filter order, that is an increase in the processing time, can also be observed. This experiment
allows one to see how a tradeoff between convergence rate and real-time throughput can be
established.
Chapter 8 covers frequency domain transforms and their implementation using frame-
based processing. Lab L8 explores the computational complexity of Fourier transform algo-
rithms and shows the utilization of Fourier transform for solving linear systems. The first part
of this lab experiment compares the computational complexity of DFT and FFT by first com-
puting the DFT directly, having the computational complexity of O.N 2 /, and then via FFT,
having the computational complexity of O.N log N /. In the second part of this lab, a filter is im-
plemented in the frequency domain by using Fourier transform three times. Frequency domain
8 1. INTRODUCTION
filtering is done by complex multiplication between two transformed signals. This approach is
observed to be more computationally efficient than convolution when the length of the filter is
made long.
Code efficiency issues are addressed in Chapter 9, in which optimization techniques, as
well as the use of intrinsics to access hardware features of the ARM processor, are discussed.
Lab L9 in this chapter provides a walkthrough of optimization techniques and their impact
on a signal processing app. In this lab experiment, the steps one can take to speed up code
execution on a smartphone target are covered. These steps include changing compiler settings,
writing efficient C code, and using architecture-specific functions for the ARM processor. The
FIR filtering (linear convolution) code is used here to show the effects of these steps on the real-
time throughput. Compiler options constitute the simplest but an effective optimization step.
By changing these options, the compiler produces executable binaries that are either optimized
for higher processing speed or for lower memory footprint. After carrying out various compiler
optimization options and observing the computational efficiency gains, one can take advantage
of the NEON SIMD coprocessor that modern smartphones possess to perform vector data
processing. One method of using the NEON coprocessor is the use of NEON intrinsics within
C codes. These intrinsics allow access to architecture specific operations such as fused multiply-
accumulate, the Newton–Raphson method for division and square root, data format conversions,
and saturating arithmetic operations. In other words, many of the architecture specific features
of the ARM processor can be accessed by utilizing intrinsic functions within C codes. The initial
processing algorithms can be used as a basis for deciding where to utilize intrinsics. In this lab, it
is demonstrated that the convolution of two signal sequences can be performed more efficiently
by utilizing a vectorized loop via NEON intrinsics.
Chapter 10 presents an optional alternative approach using the MATLAB Coder [14]
from the company MathWorks that can be used to rapidly take a signal processing algorithm
implemented in MATLAB and transfer it to a smartphone target. The lab experiment cov-
ered in the chapter exhibits the setup process for the MATLAB Coder tool provided by Math-
Works which allows converting MATLAB functions into C functions. This requires the use of
MATLAB version 2016a with the MATLAB Coder included. The experiment discussed in this
chapter shows how to convert a MATLAB function into a C function and implement it into an
Android or an iOS app.

1.5 SOFTWARE PACKAGE OF LAB CODES


For performing the laboratory experiments, similar to existing real-time or applied digital sig-
nal processing courses, familiarity with C programming and MATLAB are assumed. The lab
codes can be obtained from the third-party link http://sites.fastspring.com/bookcodes/product/
SignalProcessingBookcodesThirdEdition. The lab subfolders found under Android and iOS in
the package include all the codes necessary to implement the labs. For the iOS platform, the
necessary software is the Xcode IDE which may be installed from the Mac App Store free of
1.6. REFERENCES 9
charge. In order to deploy and test apps on an iOS device, note that it is first required to enroll
in the iOS Developer Program. The shell for the iOS operating system is included as part of the
above package so that all the codes can be acquired together in one place.
In the absence of a smartphone target, the simulator can be used to verify code function-
ality by using data already stored in a data file or from sensors present on the host machine
running the simulator. However, when using the simulator, sensor support is often limited and
performance is not comparable to that of an actual smartphone target. To be able to process
signals in real-time, an actual smartphone target is needed. All the hardware necessary to run
the laboratory experiments covered in this book is available on a modern smartphone.

1.6 REFERENCES
[1] https://www.raspberrypi.org/ 1
[2] N. Kehtarnavaz, Real-Time Digital Signal Processing Based on the TMS320C6000, Else-
vier, 2004. 1
[3] N. Kehtarnavaz, Digital Signal Processing System Design, 2nd ed., LabVIEW-Based Hy-
brid Programming, Academic Press, 2008. 1
[4] T. Welch, C. Wright, and M. Murrow, Real-Time Digital Signal Processing from MAT-
LAB to C with the TMS320C6x DSPs, CRC Press, 2011. DOI: 10.1201/9781420057829.
1
[5] S. Kuo and B. Lee, Real-Time Digital Signal Processors: Implementations, Applications and
Experiments with the TMS320C55x, Wiley, 2001. DOI: 10.1002/0470035528. 1
[6] N. Kehtarnavaz and S. Mahotra, Digital Signal Processing Laboratory: LabVIEW-Based
FPGA Implementation, Universal Publishers, 2010. 1
[7] http://developer.android.com/sdk/index.html 2
[8] http://developer.android.com/tools/sdk/ndk/index.html 2
[9] https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/
index.html 2
[10] https://developer.apple.com/programs/ios/ 2
[11] https://code.google.com/p/ios-coreaudio-example/ 3
[12] http://www.arm.com/products/processors/technologies/neon.php 5
[13] ARM Ltd., ARM Architecture Reference Manual ARMv7-A and ARMv7-R Edition, 2011.
http://www.arm.com 5
[14] https://www.mathworks.com/products/matlab-coder.html 8
11

CHAPTER 2

Android Software
Development Tools
This chapter covers the required steps to install the software tools for the development of C codes
on Android smartphones. In Chapter 3, the iOS version for iPhone smartphones is covered.
The Android development environment used here is the IntelliJ IDEA-based Android
Studio Bundle (Android Studio). C codes are made available to the Android Java environment
through the use of the Java Native Interface ( JNI) wrapper. Thus, it is also necessary to in-
stall the Android Native Development Kit (NDK). This development kit allows one to write
C codes, compile, and debug them on an emulated Android platform or on an actual Android
smartphone/tablet.
Screenshots are used to show the steps and configuration options involved in the installa-
tion when using the Windows operating system. The same software tools are also available for
other operating systems.

2.1 INSTALLATION STEPS


Start by creating a directory where the tools are to be installed. A generic directory of C:\Android
is used here and the setup is done such that all Android development related files are placed
within the C:\Android directory.

2.1.1 JAVA JDK


If the Java Development Kit ( JDK) is not already installed on your computer or you do not have
the latest version, download it from Oracle’s website and follow the installation steps indicated
by the installer. The latest JDK package at the time of this writing can be found on Oracle’s
website at:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Click on the JDK Download button in the Java Platform, Standard Edition section shown
in Figure 2.1a, and you will be taken to the page shown in Figure 2.1b. From the list of supported
platforms, select the correct version for your operating system. For example, if you are running
a 64-bit operating system, select the appropriate package.
12 2. ANDROID SOFTWARE DEVELOPMENT TOOLS

Figure 2.1: (a) Standard edition of Java platform and (b) Java downloads.
2.1. INSTALLATION STEPS 13

Figure 2.2: SDK packages.

2.1.2 ANDROID STUDIO BUNDLE AND NATIVE DEVELOPMENT KIT


The most recent versions of Android Studio and the NDK at the time of this writing are used
to run the lab experiments in the book. For the Windows installation, the Android Studio is
available as an executable installer which incorporates the development environment. The SDK
tools need to be installed separately from the development environment. In both cases, the
installation binaries appear at this website as depicted in Figure 2.2:
http://developer.android.com/sdk/index.html
The Android NDK is available in the form of a self-extracting archive at this website under
the Download section:
http://developer.android.com/tools/sdk/ndk/index.html
Download the Android Studio, SDK, and NDK installation binaries into the Android
directory created earlier and run the Android Studio installer.
During the installation of Android Studio, there are two important settings that are critical
to do correctly; see Figures 2.3 and 2.4. For the setting shown in Figure 2.3, make sure that all
the components are selected for installation, and for the setting shown in Figure 2.4, make sure
that Android Studio is installed in the directory C:\Android. The same procedure needs to be
done for the Android SDK installation. To do so, manually create the directories by using the
Browse option and create a Studio folder and a sdk folder. When the installer is finished, do not
allow it to start Android Studio as additional configuration is still needed.
The last step is to extract the Android NDK to the folder C:\Android by placing the
archive executable in the folder and running it. When this action is completed, rename the
folder android-ndk-<version> to ndk.

2.1.3 ENVIRONMENT VARIABLE CONFIGURATION


Before running Android Studio for the first time, the system environment needs to be set up
by adding the SDK platform-tools folder to the system path variable and setting the variables
to define the Android Virtual Device (AVD) storage location as well as the locations for the
14 2. ANDROID SOFTWARE DEVELOPMENT TOOLS

Figure 2.3: Android studio setup.


2.1. INSTALLATION STEPS 15

Figure 2.4: Configuration settings.


Another Random Scribd Document
with Unrelated Content
Monday, July 17th.—Brussels.—The sky had been overshadowed
by clouds during most of our journey, and now a storm threatened
us, which helped our own melancholy thoughts to cast a gloom over
the open country, where few trees were to be seen except forests on
the distant heights. The ruins of the severely contested chateau of
Hougomont had been ridded away since the battle, and the injuries
done to the farm-house repaired. Even these circumstances, natural
and trivial as they were, suggested melancholy thoughts, by
furnishing grounds for a charge of ingratitude against the course of
things, that was thus hastily removing from the spot all vestiges of
so momentous an event. Feeble barriers against this tendency are
the few frail memorials erected in different parts of the field of
battle! and we could not but anticipate the time, when through the
flux and reflux of war, to which this part of the Continent has always
been subject, or through some turn of popular passion, these also
should fall; and "Nature's universal robe of green, humanity's
appointed shroud," enwrap them:—and the very names of those
whose valour they record be cast into shade, if not obliterated even
in their own country, by the exploits of recent favourites in future
ages.

Tuesday, July 18th.—Namur.—Before breakfast we went to the


church of the Jesuits; beautiful pillars of marble, roof of pumice-
stone curiously wrought, the colour chaste and sombre. The
churches of Ghent and Bruges are injured by being whitewashed:
that of Brussels is of a pale grey, or stone-colour, which has a much
better effect, though nothing equal to the roof of the Jesuits' church
at Namur; yet in one point (i.e. the painted windows) the Cathedral
of Brussels surpasses all the churches we have yet seen.... Several
women passed us who had come thither to attend upon the
labourers employed in repairing and enlarging the fortifications.
Their dresses were neat and gay; and, in that place of which we had
so often read in histories of battles and sieges, their appearance,
while they struggled cheerfully with the blustering wind, was wild
and romantic. The fondness for flowers appears in this country
wherever you go. Nothing is more common than to see a man,
driving a cart, with a rose in his mouth. At the very top of our
ascent, I saw one at work with his spade, a full-blown rose covering
his lips, which he must have brought up the hill,—or had some
favourite lass there presented it to him?...

Wednesday, July 19th.—Liége.—My first entrance into the market-


place brought a shock of cheerful sensation. It was like the bursting
into life of a Flemish picture. Such profusion of fruit! such
outspreading of flowers! and heaps of vegetables! and such variety
in the attire of the women! A curious and abundant fountain,
surrounded with large stone basins, served to wash and refresh the
vegetables. Torrents of voices assailed us while we threaded our way
among the fruit and fragrant flowers; bouquets were held out to us
by half a score of sunburnt arms at once. The women laughed—we
laughed, took one bouquet, and gave two sous, our all.... Left Liége
about 9 o'clock—were recognised and greeted by many of the
women at their stalls as we passed again through the market-
place.... Ascended a very steep hill, on the top of which stands the
ruined convent of the Chartreuse, and there we left our carriages to
look back upon the fine view of the city, spreading from the ridge of
the crescent hill opposite to us (which is, however, somewhat
unpleasingly scarified by new fortifications), and over the central
plain of the vale, to the magnificent river which, split into many
channels, flows at the foot of the eminence where we stood.... Still,
as we proceed, we are reminded of England—the fields, even the
cottages, and large farm-houses, are English-like; country
undulating, and prospects extensive, yet continually some pretty
little spot detains the eye; groups of cottages, or single ones, green
to the very door.39

Thursday, July 20th.—Aix-la-Chapelle.—I went to the Cathedral, a


curious building, where are to be seen the chair of Charlemagne, on
which the Emperors were formerly crowned, some marble pillars
much older than his time, and many pictures; but I could not stay to
examine any of these curiosities, and gladly made my way alone
back to the inn to rest there. The market-place is a fine old square;
but at Aix-la-Chapelle there is always a mighty preponderance of
poverty and dulness, except in a few of the showiest of the streets,
and even there, a flashy meanness, a slight patchery of things falling
to pieces, is everywhere visible....

Road to Cologne.—At the distance of ten miles we saw before us,


over an expanse of open country, the Towers of Cologne. Even at
this distance they appeared very tall and bulky; and Mary pointed
out that one of them was a ruin, which no other eyes could discover.
To the left was a range of distant hills; and, to the right, in front of
us, another range—rather a cluster—which we looked at with
peculiar interest, as guardians and companions of the famous river
Rhine, whither we were tending, and (sick and weary though I was)
I felt as much of the glad eagerness of hope as when I first visited
the Wye, and all the world was fresh and new. Having travelled over
the intermediate not interesting country, the massy ramparts of
Cologne, guarded by grotesque turrets, the bridges, and heavy
arched gateways, the central towers and spires, rising above the
concealed mass of houses in the city, excited something of gloomy
yet romantic expectation.

Friday, July 21st.—Cologne.—I busied myself repairing garments


already tattered in the journey, at the same time observing the
traffic and business of the river, here very wide, and the banks low. I
was a prisoner; but really the heat this morning being oppressive, I
felt not even a wish to stir abroad, and could, I believe, have been
amused more days than one by the lading and unlading of a ferry-
boat, which came to and started from the shore close under my
window. Steadily it floats on the lively yet smooth water, a square
platform, not unlike a section cut out of a thronged market-place,
and the busy crowd removed with it to the plain of water. The
square is enclosed by a white railing. Two slender pillars rise from
the platform, to which the ropes are attached, forming between
them an inverted arch, elegant enough. When the boat draws up to
her mooring-place, a bell, hung aloft, is rung as a signal for a fresh
freight. All walk from the shore, without having an inch to rise or to
descend. Carts with their horses wheel away—rustic, yet not without
parade of stateliness—the foreheads of the meanest being adorned
with scarlet fringes. In the neighbourhood of Brussels (and indeed
all through the Low Countries), we remarked the large size and good
condition of the horses, and their studied decorations, but near
Brussels those decorations were the most splendid. A scarlet net
frequently half-covered each of the six in procession. The frock of
the driver, who paces beside the train, is often handsomely
embroidered, and its rich colour (Prussian blue) enlivens the scarlet
ornaments of his steeds. But I am straying from my ferry-boat. The
first debarkation which we saw early in the morning was the most
amusing. Peasants, male and female, sheep, and calves; the women
hurrying away, with their cargoes of fruit and vegetables, as if eager
to be beforehand with the market. But I will transcribe verbatim
from my journal, "written at mid-day," the glittering Rhine spread
out before me, in width that helped me to image forth an American
lake.

* * * * * *

"It has gone out with a fresh load, and returned every hour; the
comers have again disappeared as soon as landed; and now, the
goers are gathering together. Two young ladies trip forward, their
dark hair basketed round the crown of the head, green bags on their
arms, two gentlemen of their party; next a lady with smooth black
hair stretched upward from the forehead, and a skull-cap at the top,
like a small dish. The gentry passengers seem to arrange themselves
on one side, the peasants on the other;—how much more
picturesque the peasants! There is a woman in a sober dark-
coloured dress; she wears no cap. Next, one with red petticoat, blue
jacket, and cap as white as snow. Next, one with a red handkerchief
over her head, and a long brown cloak. There a smart female of the
bourgeoise—dark shawl, white cap, blue dress. Two women (now
seated side by side) make a pretty picture: their attire is scarlet, a
pure white handkerchief falling from the head of each over the
shoulders. They keep watch beside a curiously constructed basket,
large enough to contain the marketing of a whole village. A girl
crosses the platform with a handsome brazen ewer hanging on her
arm. Soldiers—a dozen at least—are coming in. They take the
centre. Again two women in scarlet garb, with a great fruit basket. A
white cap next; the same with a green shawl. There is a sunburnt
daughter of toil! her olive skin whitens her white head-dress, and
she is decked in lively colours. One beside her, who, I see, counts
herself of higher station, is distinguished by a smart French mob. I
am brought round to the gentry side, which is filled up, as you may
easily fancy, with much less variety than the other. A cart is in the
centre, its peasant driver, not to be unnoticed, with a polished
tobacco-pipe hung over his cleanly blue frock. Now they float away!"

Cologne, Friday, July 21st.—Before I left the interior of the


Cathedral, I ought to have mentioned that the side-chapels contain
some superb monuments. There is also a curious picture
(marvellously rich in enamel and colouring) of the Three Kings of
Cologne, and of a small number of the eleven thousand virgins, who
were said, after shipwreck, to have landed at this city in the train of
St. Ursula. The Huns, who had possession of the city, became
enamoured of their beauty; and the fair bevy, to save themselves
from persecution, took the veil; in commemoration of which event
the convent of St. Ursula was founded, and within the walls of that
church an immense number of their skulls (easily turned into eleven
thousand), are ranged side by side dressed in green satin caps. We
left these famous virgins (though our own countrywomen),
unvisited, and many other strange sights; and what wonder? we had
but one day; and I saw nothing within gate or door except the
Cathedral—not even Rubens's famous picture of the Crucifixion of St.
Peter, a grateful offering presented by him as an altar-piece for the
church in which he was baptized, and had served as a chorister.
Among the outrages committed at Cologne during the Revolution, be
it noted that the Cathedral, in 1800, was used as a granary, and that
Buonaparte seized on the picture bestowed on his parish church by
Rubens, and sent it to Paris. The Three Kings shared the same fate.
The houses of Cologne are very old, overhanging, and uncouth;
the streets narrow and gloomy in the cheerfulest of their corners or
openings; yet oftentimes pleasing. Windows and balconies make a
pretty show of flowers; and birds hang on the outside of houses in
cages. These sound like cheerful images of active leisure; but with
such feeling it is impossible to walk through these streets. Yet it is
pleasing to note how quietly a dull life may be varied, and how
innocently; though, in looking at the plants which yearly put out
their summer blossoms to adorn these decaying walls and windows,
I had something of the melancholy which I have felt on seeing a
human being gaily dressed—a female tricked out with ornaments,
while disease and death were on her countenance.

Cologne, Saturday, July 22nd.—Upon a bright sunny morning,


driven by a civil old postilion, we turned our backs upon the
cathedral tower of Cologne, an everlasting monument of riches and
grandeur, and I fear of devotion passed away; of sublime designs
unaccomplished—remaining, though not wholly developed, sufficient
to incite and guide the dullest imagination,—

Call up him who left half-told


The story of Cambuscan bold!40

Feelingly has Milton selected this story, not from a preference to the
subject of it (as has been suggested), but from its paramount
accordance with the musings of a melancholy man—in being left
half-told—
Foundations must be laid
In Heaven; for, 'mid the wreck of is and was,
Things incomplete and purposes betrayed
Make sadder transits o'er truth's mystic glass
Than noblest objects utterly decayed.41

Bonn.—The great area of the vale here is a plain, covered with


corn, vines, and fruit-trees: the impression is of richness, profusion,
amplitude of space. The hills are probably higher than some of our
own which we call mountains; but on the spot we named them hills.
Such they appeared to our eyes; but when objects are all upon a
large scale there is no means of comparing them accurately with
others of their kind, which do not bear the same proportions to the
objects with which they are surrounded. Those in the neighbourhood
of Bonn are of themselves sufficiently interesting in shape and
variety of surface: but what a dignity does the form of an ancient
castle or tower confer upon a precipitous woody or craggy
eminence! Well might this lordly river spare one or two of his castles,
—which are too numerous for the most romantic fancy to hang its
legends round each and all of them,—well might he spare, to our
purer and more humble streams and lakes, one solitary ruin for the
delight of our poets of the English mountains! To the right (but let
him keep this to himself, it is too grand to be coveted by us) is the
large ruined castle of Gottesberg, far-spreading on the summit of the
hill—very light and elegant, with one massy tower....
For some miles, the traveller goes through the magnificent plain
which from its great width, appears almost circular. Though unseen,
the River Rhine, we never can forget that it is there! When the vale
becomes narrower, one of the most interesting and beautiful of
prospects opens on the view from a gentle rising in the road. On an
island stands a large grey Convent—sadly pensive among its garden
walls and embowering wood. The musket and cannon have spared
that sanctuary; and we were told that, though the establishment is
dissolved, a few of the Nuns still remain there, attached to the spot;
—or probably having neither friends or other home to repair to. On
the right bank of the river, opposite to us, is a bold precipice,
bearing on its summit a ruined fortress which looks down upon the
Convent; and the warlike and religious edifices are connected
together by a chivalrous story of slighted, or luckless love, which
caused the withdrawing of a fair damsel to the island, where she
founded the monastery. Another bold ruin stands upon another
eminence adjoining; and all these monuments of former times
combine with villages and churches, and dells (between the steeps)
green or corn-clad, and with the majestic river (here spread out like
a lake) to compose a most affectingly beautiful scene, whether
viewed in prospect or in retrospect. Still we rolled along (ah! far too
swiftly! and often did I wish that I were a youthful traveller on foot)
—still we rolled along—meeting the flowing river, smooth as glass,
yet so rapid that the stream of motion is always perceptible, even
from a great distance. The riches of this region are not easily to be
fancied—the pretty paths—the gardens among plots of vineyard and
corn—cottages peeping from the shade—villages and spires—in
never-ending variety. The trees, however, in the whole of the
country through which we have hitherto passed, are not to be
compared with the trees of England, except on the banks of the
Meuse. On the Rhine they are generally small in size; much of the
wood appears to be cut when young, to spring again. In the little
town of Remagan where we changed horses, crowds of people of all
ages gathered round us; the beggars, who were indefatigable in
clamour, might have been the only inhabitants of the place who had
any work to do....

Andernach.—Departed at about five o'clock. Andernach is an


interesting place, both at its entrance from Cologne, and its outlet
towards Coblentz. There is a commanding desolation in the first
approach; the massy square tower of defence, though bearded by
green shrubs, stands, as it were, untameable in its strength,
overlooking the half-ruined gateway of the ramparts. Close to the
other gate, leading to Coblentz, are seen many picturesque
fragments and masses; and the ancient walls shelter and adorn
fruitful gardens, cradled in the otherwise now useless trenches. The
town itself appears so dull—the inhabitants so poor, that it was
almost surprising to observe walks for public use and pleasure, with
avenues and arbours on the level adjoining the ramparts. The
struggle between melancholy and cheerfulness, fanciful
improvements, and rapid decay, leisure and poverty, was very
interesting. We had a fine evening; and the ride, though, in
comparison with the last, of little interest—the vale of the Rhine
being here wide and level, the hills lowered by distance—was far
from being a dull one, as long as I kept myself awake. I was roused
from sleep in crossing the bridge of the Moselle near Coblentz.

Coblentz, Sunday, July 23rd.—Cathedral.—The music at our


entrance fixed us to our places. The swell was solemn, even aweful,
sinking into strains of delicious sweetness; and though the worship
was to us wholly unintelligible, it was not possible to listen to it
without visitings of devotional feeling. Mary's attention was entirely
absorbed till the service ceased, and I think she never stirred from
her seat. After a little while I left her, and drew towards the railing of
the gallery, to look round on the congregation, among whom there
appeared more of the old-fashioned gravity, and of antique gentility,
than I have seen anywhere else; and the varieties of costume were
infinite.... The area of the Cathedral, upon which we looked down
from the crowded gallery, was filled with old, middle-aged, and
young persons of both sexes; and at Coblentz, even the male dress,
especially that of boys and youths, has a pleasing cast of antiquity,
reminding one of old pictures—of assemblies in halls,—or of
banquets as represented by the Flemish masters. The figure of a
young girl tightly laced up in bodice and petticoat, with adornings of
gold clasps and neck-chain, beside a youth with open throat and
ornamented shirt-collar falling upon the shoulders of a coat of
antique cut, especially when there chanced to be near them some
matron in her costly robe of seventy years;—these, together, made
an exhibition that even had I been a good Catholic, yet fresh from
England, might have interfered with my devotions; but where all
except the music was an unmeaning ceremony, what wonder that I
should be amused in looking round as at a show!... All that we
witnessed of bustle or gaiety was near the river, facing the fortress
of Ehrenbreitstein; and upon the wide wooden bridge which we
crossed in our way to the fortress. Fruit-women were seated on the
bridge, and peasants, gentry, soldiers, continually passing to and fro.
All but the soldiers paid toll. The citadel stands upon a very lofty
bare hill, and the walk was fatiguing; but I beguiled my weariness
with the company of a peasant lass, who took pains to understand
my broken German, and contrived to make me acquainted with no
small part of her family history.... This bonny maiden's complexion
was as fresh as a rose, though no kerchief screened it from the
sunshine. Many a fierce breeze, and many a burning sun must she
have struggled with in her way from the citadel to the town; and, on
looking at her, I fancied there must be a stirring and invigorating
power in the wind to counteract the cankering effect of the sun,
which is so noticeable in the French peasantry on their hot dry
plains. No sooner do you set foot in the neighbourhood of Calais
than you are struck with it; and, at the same time, with the
insensibility of young and old to discomfort from glaring light and
heat. Whatever slender shade of willows may be at the door of a hut
on the flats between Calais and Gravelines, the female peasants, at
their sewing or other work, choose it not, but seat themselves full in
the sunshine. Thence comes a habit of wrinkling the cheeks and
forehead, so that their faces are mostly ploughed with wrinkles
before they are fifty years old. In this country, and all through the
Netherlands, the complexions of the people are much fresher and
fairer than in France, though they also are much out of doors. This
may perhaps be, in part, attributed to the greater quantity of wood
scattered over the country, and to the shade of garden and orchard
trees.... The view from the summit of the hill of Ehrenbreitstein is
magnificent. Beneath, on a large, flat angle, formed by the junction
of the Rhine and the Moselle, stands the city, its purple-slated roofs
surrounded by many tall buildings—towers and spires, and big
palaces among trees. The vale of the Moselle is deep and green,
formed by vine-clad steeps, among which the eye, from the heights
where we stood, espies many a pleasant village. That of the Rhine is
more varied and splendid—with towns that, from their size, the
irregularity of their buildings, and the numerous towers and spires,
give dignity to the proud river itself, and to the prodigally scattered
hills. Downwards we looked through the plain, along which we had
travelled the evening before from the town of Andernach, which
stands, as Coblentz does, upon a low bank of the Rhine: and there is
no eminence between the two towns to obstruct the view. The
course of the road, which is widely parted from that of the river, may
be seen in a straight line for many miles. We behold below us the
junction of the two great rivers; how steady and quiet is their
meeting! A little while each goes in his own distinct path, side by
side, yet one stream; and they slowly and by degrees unite, each
lost in the other—happy type of a tranquil meeting, and joining
together in the journey of life!

* * * * * *

Coblentz, as every one knows, was for a long time the


headquarters of the French noblesse, and other emigrants, during
the Revolution; and it is surprising that in the exterior of manners
and habits there should be so little to remind the passing traveller of
the French. In Ghent and Brussels, it is impossible to forget that you
are in towns not making a part of France; yet, in both those places,
the French have sown seeds which will never die—their manners,
customs, and decorations are everywhere struggling with the native
stiffness of the Flemish: but in Coblentz it is merely incidentally that
the French courtier or gentleman is brought to mind; and shops,
houses, public buildings, are all of the soil where they have been
reared—so at least they appeared to us, in our transient view.

St. Goar, Monday, July 24th.— ... The town, seen from the
heights, is very beautiful, with purple roofs, two tall spires, and one
tower. On the opposite side of the river we peep into narrow valleys,
formed by the lofty hills, on which stand two ruins called, as we
were told by our lively attendant, the Katzen and Mausen Towers
(i.e. the Towers of the Cat and the Mouse). They stare upon each
other at safe distance, though near neighbours; and, across the
river, the greater fortress of Rheinfels defies them both. A lovely dell
runs behind one of the hills; at its opening where it pours out its
stream into the Rhine we espied a one-arched Borrowdale bridge,
and behind the bridge a village almost buried between the abruptly-
rising steeps.... I will transcribe the few words I wrote in my
memorandum-book, dated "Beside the Rhine, St. Goar":—"How shall
I describe this soothing, this elegant place! The river flows on. I see
it flow, yet it is like a lake—the bendings of the hills enclosing it at
each end. Here I sit, half-way from the centre of the curve. At the
turning of that semi-circular curve stands our Inn; near it is the Post-
House, both rather handsome buildings. The town, softened white
and purple, the green hills rising abruptly above it. Behind me (but I
cannot see it) is the Castle of Rheinfels. On the opposite banks of
the river, the vine-clad steeps appear as if covered with fern. It is a
sweep of hills that from this point appear even-topped. At the foot of
one of the dells which we noticed from the Castle eminence, there is
a purple roofed town with one spire, and one church or convent
tower; and I see the Borrowdale bridge beside the lowly hamlet in
the cleft of the other dell. A ferry-boat has been approaching its
landing-place with a crew of peasants. They come now slowly up
from the shore, a picturesque train in grey attire—no showy colours;
and at this moment I can fancy that even that circumstance gives a
sweeter effect to the scene, though I have never wished to expel the
crimson garments, or the blue, from any landscape." Here let me
observe that grey clothing—the pastoral garb of our mountains—
does, when it is found on the banks of the Rhine, only look well at a
certain distance. It seems not to be worn from choice, but poverty;
and in this day's journey we have met with crowds of people whose
dress was accordant with the appearance close at hand of their
crumbling houses and fortifications.
Bingen, Tuesday, July 25th.—Most delightful to the imagination
was our journey of yesterday, still tempting to hope and expectation!
Yet wherever we passed through a village or small town the veil of
romance was withdrawn, and we were compelled to think of human
distress and poverty—their causes how various in a country where
Nature has been so bountiful—and, even when removed from the
immediate presence of painful objects, there is one melancholy
thought which will attend the traveller along the ever-winding course
of the Rhine—the thought that of those buildings, so lavishly
scattered on the ridges of the heights or lurking in sheltering
corners, many have perished, all are perishing, and will entirely
perish! Buildings that link together the Past and the Present—times
of war and depredation, of piracy, of voyages by stealth and in fear,
of superstitious ceremonies, of monastic life, of quiet, and of retreat
from persecution! Yet some of the strongest of the fortresses may,
for aught I know, endure as long as the rocks on which they have
been reared, deserted as they are, and never more be tenanted by
pirate, lord, or vassal. The parish churches are in bad repair, and
many ruinous....

Mayence.—I thought of some thriving friar of old times; but last


night,42 in reading Chaucer's Prologue to the Canterbury Tales, mine
host of the Tabard recalled to my memory our merry master in the
dining-room at Mayence.

A seemly man our Hoste was with alle


To han bene a Marshal in an Halle;
A large man he was—bold of his speech.

Frankfort, Wednesday, July 26th.—The town is large, though you


do not feel as if you were walking in a large town. Standing on a
perfect level you see no further than the street in which you are, or
the one that leads to it; and there is little stirring of people. Two
huge palaces are going to ruin. One of these (the Episcopal Palace)
of red stone is very handsome in its style of heavy architecture, and
there are many public buildings by the river-side. The quay is a
cheerful and busy place. After driving a short way on the shore
below those lofty buildings, we crossed a bridge of boats; and now
(had we proceeded in the same direction as before) we should have
had the Rhine on our right hand; but we turned back again, i.e.
downwards, and still had it on our left for two miles (more or less),
not close to us; but always in view broad and majestic, scattered
over with vessels of various kinds. Large rafters piled with wood
were by the shore, or floating with the stream; and a long row of
mills (for grinding corn I suppose) made a curious appearance on
the water. We had a magnificent prospect downwards in the
Rheingaw (stretching towards Bingen), a district famed for producing
finer vines than any other country of the Rhine.43 The broad hills are
enlivened by hamlets, villas, villages, and churches. After about two
miles, the road to Wisbaden turns from the river (to the right), and
with regret did we part from our majestic companion to meet no
more till we should rejoin him for one short day among the rocks of
Schaffhausen.... We went to the Cathedral, a very large, but not
otherwise remarkable building, in the interior. The people assembled
at prayers, sate on benches as in our country churches, and
accompanied by the organ were chaunting, and making the
responses. We ascend the Tower. It is enormously high; and after an
ascent of above five hundred steps, we found a family living in as
neatly-furnished a set of apartments as need be seen in any street in
Frankfort. A baby in the cradle smiled upon us, and played with the
Kreutzers which we gave her. The mother was alert and cheerful—
nay, she seemed to glory in her contentment, and in the snugness of
her abode. I said to her, "but when the wind blows fiercely how
terrible!" and she replied, "Oh nein! es thut nichts." "Oh no! it does
no harm." The view from the Cathedral is very extensive. The
windings of the river Maine; vessels in their harbours, or smoothly
gliding, plains of corn, of forest, of fruit-trees, chateaus, villages,
towns, towers and spires; the expanse irregularly bounded by
distinct mountains....
In the winding staircase, while descending from the Tower, met
different people, who seemed to be going to make neighbourly visits
to the family above. Passed through the market-place, very
entertaining, and nowhere a greater variety of people and of head-
dresses than there. The women's caps were high. My eye was
caught by a tightly-clad, stiff-waisted lady who wore a gold cap
(almost as lofty as a grenadier's) with long lappets of riband behind.
I saw no reason why that cap (saving its silken ornaments) might
not have belonged to her great grandmother's grandmother. The
Maison de Ville stands on one side of a handsome square, in the
centre of which is a noble fountain, that used to flow with wine at
the crowning of the Emperors. Oxen were roasted in the square,
and, in memory of the same, two heads, with their horns, are
preserved under the outside of a window of an old church adjoining
the Maison de Ville.

Heidelberg, Thursday, July 27th.—After dinner, Mary, Miss H., and


I set off towards the castle.... The ascent is long and steep, the way
plain, and no guide needed, for the castle walks are free; and there
—among treasures of art, decaying and decayed, and the
magnificent bounties of nature—the stranger may wander the day
through. The building is of various dates: it is not good in
architecture as a whole, though very fine in parts. There is a noble
round tower, and the remains of the chapel, and long ranges of lofty
and massy wall, often adorned with ivy, the figure of a saint, a lady,
or a warrior looking safely from their niches under the ivy bower.
The moats, which must long ago have been drained, retain their
shape, yet have now the wild luxuriance of sequestered dells. Fruit
and forest trees, flowers and grass, are intermingled. I now speak of
the more ruinous and the most ancient part of the castle.... We
walked upon a platform before the windows, where a band of music
used to be stationed, as on the terrace at Windsor—a fine place for
festivals in time of peace, and to keep watch in time of war.... From
the platform where we stood, the eye (overlooking the city, bridge,
and the deep vale, to the point where the Neckar is concealed from
view by its winding to the left) is carried across the plain to the dim
stream of the Rhine, perceived under the distant hills. The pleasure-
grounds are the most delightful I ever beheld; the happiest mixture
of wildness, which no art could overcome, and formality, often
necessary to conduct you along the ledge of a precipice—whence
you may look down upon the river, enlivened by boats, and on the
rich vale, or to the more distant scenes before mentioned. One long
terrace is supported on the side of the precipice by arches
resembling those of a Roman aqueduct; and from that walk the view
of the Castle and the Town beneath it is particularly striking. I
cannot imagine a more delightful situation than Heidelberg for a
University—the pleasures, ceremonies, and distractions of a Court
being removed. Parties of students were to be seen in all quarters of
the groves and gardens. I am sorry, however, to say that their
appearance was not very scholarlike. They wear whatever wild and
coarse apparel pleases them—their hair long and disorderly, or rough
as a water-dog, throat bare or with a black collar, and often no
appearance of a shirt. Every one has his pipe, and they all talk loud
and boisterously....
Never surely was any stream more inviting! It flows in its deep
bed—stately, yet often turbulent; and what dells, cleaving the green
hills, even close to the city! Looking down upon the purple roofs of
Heidelberg variously tinted, the spectacle is curious—narrow streets,
small squares, and gardens many and flowery. The main street, long
and also narrow, is (though the houses are built after no good style)
very pretty as seen from the heights, with its two gateways and two
towers. The Cathedral (it has an irregular spire) overtops all other
edifices, which, indeed, have no grace of architecture, and the
University is even mean in its exterior; but, from a small distance,
any city looks well that is not modern, and where there is bulk and
irregularity, with harmony of colouring. But we did not enter the
cathedral, having so much to see out of doors.
Heidelberg, Friday, July 28th.— ... The first reach of the river for a
moment transported our imagination to the Vale of the Wye above
Tintern Abbey. A single cottage, with a poplar spire, was the central
object.... As we went further, villages appeared. But Mr. P. soon
conducted us from the river up a steep hill, and, after a long ascent,
he took us aside to a cone-shaped valley, a pleasure-dell—I call it so
—for it was terminated by a rural tavern and gardens, seats and
alcoves, placed close beside beautiful springs of pure water, spread
out into pools and distributed by fountains. A grey stone statue, in
its stillness, is a graceful object amid the rushing of water!... Our
road along the side of the hill, that still rose high above our heads,
led us through shady covert and open glade, over hillock or through
hollow; at almost every turning convenient seats inviting us to rest,
or to linger in admiration of the changeful prospects, where wild and
cultivated grounds seemed equally the darlings of the fostering sun.
Many of the hills are covered with forests, which are cut down after
little more than thirty years' growth; the ground is then ploughed,
and sown with buck-wheat, and afterwards with beech-nuts. The
forests of firs (numerous higher up, but not so here) are sown in like
manner. Immense quantities of timber are floated down the river.
Sometimes in our delightful walk we were led through tracts of
vines, all belonging to the Grand Duke. They are as free as the
forest thickets and flowery glades, and separated from them by no
distinguishable boundary. Whichever way the eye turned, it settled
upon some pleasant sight.... Passed through the walled town of
Durlach (about two miles from Carlesrhue), the palace deserted by
the Duke. Coffee-houses all full, windows open, billiards, wine and
smoking, finery, shabbiness and idleness. Large pleasure gardens
beyond the barrier-walls, and we enter an avenue of tall poplars,
continued all the way to Carlesrhue. After a little while nothing was
to be seen but the poplar stems in shape of columns on each side,
the leafy part of the trees forming a long black wall above them, so
lofty that it appeared to reach the sky, that pale blue roof of the
Gothic aisle still contracting in the distance, and seemingly of
interminable length. Such an avenue is truly a noble approach to the
favoured residence of a grand Duke.

Baden-Baden, July 29th (Saturday).— ... Met with old-fashioned


civility in all quarters. This little town is a curious compound of rural
life, German country-townishness, watering-place excitements, court
stateliness, ancient mouldering towers, old houses and new, and a
life and cheerfulness over all.... A bright reflection from the evening
sky powdered with golden dust that distant vapoury plain, bounded
by the chain of purple mountains. We quitted this spectacle with
regret when it faded in the late twilight, struggling with the light of
the moon.

Road to Homburg.—Sunday, July 30th.—We were continually


reminded of the vales of our own country in this lovely winding
valley, where seven times we crossed the clear stream over strong
wooden bridges; but whenever in our travels the streams and vales
of England have been most called to mind there has been something
that marks a difference. Here it is chiefly observable in the large
brown wood houses, and in the people—the shepherd and
shepherdess gaiety of their dress, with a sort of antiquated stiffness.
Groups of children in rustic flower-crowned hats were in several
places collected round the otherwise solitary swine-herd.... The
sound of the stream (if there be any sound) is a sweet, unwearied,
and unwearying under-song, to detain the pious passenger, which he
cannot but at times connect with the silent object of his worship.

Road to Schaffhausen.—A part of the way through the uncleared


forest was pleasingly wild; juniper bushes, broom, and other
woodland plants, among the moss and flowery turf. Before we had
finished our last ascent, the postilion told us what a glorious sight
we might have seen, in a few moments, had we been here early in
the morning or on a fine evening; but, as it was mid-day, nothing
was to be expected. That glorious sight which should have been was
no less than the glittering prospect of the mountains of Switzerland.
We did burst upon an extensive view; but the mountains were
hidden; and of the Lake of Constance we saw no more than a
vapoury substance where it lay among apparently low hills. This first
sight of that country, so dear to the imagination, though then of no
peculiar grandeur, affected me with various emotions. I remembered
the shapeless wishes of my youth—wishes without hope—my
brother's wanderings thirty years ago,44 and the tales brought to me
the following Christmas holidays at Forncett, and often repeated
while we paced together on the gravel walk in the parsonage
garden, by moon or star light.45 ... The towers of Schaffhausen
appear under the shelter of woody and vine-clad hills, but no
greetings from the river Rhine, which is not visible from this
approach, yet flowing close to the town.... But at the entrance of the
old city gates you cannot but be roused, and say to yourself, "Here is
something which I have not seen before, yet I hardly know what."
The houses are grey, irregular, dull, overhanging, and clumsy;
streets narrow and crooked—the walls of houses often half-covered
with rudely-painted representations of the famous deeds of the
defenders of this land of liberty.... In place of the splendour of faded
aristocracy, so often traceable in the German towns, there is a
character of ruggedness over all that we see.... Never shall I forget
the first view of the stream of the Rhine from the bank, and
between the side openings of the bridge—rapid in motion, bright,
and green as liquid emeralds! and wherever the water dashed
against tree, stone, or pillar of the bridge, the sparkling and the
whiteness of the foam, melting into and blended with the green, can
hardly be imagined by any one who has not seen the Rhine, or some
other of the great rivers of the Continent, before they are sullied in
their course.... The first visible indication of our approach to the
cataracts was the sublime tossing of vapour above them, at the
termination of a curved reach of the river. Upon the woody hill,
above that tossing vapour and foam, we saw the old chateau,
familiar to us in prints, though there represented in connection with
the falls themselves; and now seen by us at the end of the rapid, yet
majestic, sweep of the river; where the ever-springing tossing clouds
are all that the eye beholds of the wonderful commotion. But an
awful sound ascends from the concealed abyss; and it would almost
seem like irreverent intrusion if a stranger, at his first approach to
this spot, should not pause and listen before he pushes forward to
seek the revelation of the mystery.... We were gloriously wetted and
stunned and deafened by the waters of the Rhine. It is impossible
even to remember (therefore, how should I enable any one to
imagine?) the power of the dashing, and of the sounds, the breezes,
the dancing dizzy sensations, and the exquisite beauty of the
colours! The whole stream falls like liquid emeralds—a solid mass of
translucent green hue; or, in some parts, the green appears through
a thin covering of snow-like foam. Below, in the ferment and hurly-
burly, drifting snow and masses resembling collected snow mixed
with sparkling green billows. We walked upon the platform, as dizzy
as if we had been on the deck of a ship in a storm. Mary returned
with Mrs. Monkhouse to Schaffhausen, and William recrossed in a
boat with Mr. Monkhouse and me, near the extremity of the river's
first sweep, after its fall, where its bed (as is usual at the foot of all
cataracts) is exceedingly widened, and larger in proportion to the
weight of waters. The boat is trusted to the current, and the
passage, though long, is rapid. At first, when seated in that small
unresisting vessel, a sensation of helplessness and awe (it was not
fear) overcame me, but that was soon over. From the centre of the
stream the view of the cataract in its majesty of breadth is
wonderfully sublime. Being landed, we found commodious seats,
from which we could look round at leisure, and we remained till the
evening darkness revealed two intermitting columns of fire, which
ascended from a forge close to the cataract.

Monday, July 31st.—Hornberg.—After this, over the wide country


to Villengen, a walled town upon the treeless waste, the way
unvaried except by distant views of remnants of the forest, and
towns or villages, shelterless, and at long distances from each other.
They are very striking objects: they stand upon the waste in
disconnection with everything else, and one is at a loss to conceive
how any particular town came to be placed in this spot or that,
nature having framed no allurement of valley shelter among the
undulations of the wide expanse. Each town stands upon its site, as
if it might have been wheeled thither. There is no sympathy, no bond
of connection with surrounding fields, not a fence to be seen, no
woods for shelter, only the dreary black patches and lines of forest,
used probably for fuel, and often far fetched. In short, it is an
unnatural-looking region. In comparison with the social intermixture
of towns, villages, cottages, fruit-trees, corn and meadow land,
which we had so often travelled through, the feeling was something
like what one has in looking at a dead yet gaudy picture painted by
an untutored artist, who first makes his country, then claps upon it,
according to his fancy, such buildings as he thinks will adorn it.

Thursday, August 3rd.—Zurich.—At a little distance from Zurich


we remarked a very fine oak tree. Under its shade stood a little
building like an oratory, but as we were not among the Roman
Catholics it puzzled us. In front of the tree was an elevated platform,
resembling the Mount at Rydal, to be ascended by steps. The
postilion told us the building was a Chapel whither condemned
criminals retired to pray, and there had their hair cut off; and that
the platform was the place of execution.

August 4th.—Lenzburg.... At six o'clock we caught a glimpse of


the castle walls glittering in sunshine, a hopeful sign, and we set
forward through the fog. The ruin stands at the brink of a more than
perpendicular, an overhanging rock, on the top of a green hill, which
rises abruptly from the town. The steepest parts are ascended by
hundreds of stone steps, worn by age, often broken, and half-buried
in turf and flowers. These steps brought us to a terrace bordered by
neatly-trimmed vines; and we found ourselves suddenly in broad
sunshine under the castle walls, elevated above an ocean of vapour,
which was bounded on one side by the clear line of the Jura
Mountains, and out of which rose at a distance what seemed an
island, crested by another castle. We then ascended the loftiest of
the towers, and the spectacle all around was magnificent, visionary
—I was going to say endless, but on one side was the substantial
barrier of the Jura. By degrees (the vapours settling or shifting)
other castles were seen on island eminences; and the tops of bare
or woody hills taking the same island form; while trees, resembling
ships, appeared and disappeared, and rainbow lights (scarcely more
visionary than the mimic islands) passed over, or for a moment
rested on the breaking mists. On the other side the objects were
more slowly developed. We looked long before we could distinguish
the far-distant Alps, but by degrees discovered them, shining like
silver among masses of clouds. The intervening wide space was a
sea of vapour, but we stayed on the eminence till the sun had
mastery of all beneath us, after a silent process of change and
interchange—of concealing and revealing. I hope we were not
ungrateful to the memory of past times when (standing on the
summit of Helvellyn, Scaw Fell, Fairfield, or Skiddaw) we have felt as
if the world itself could not present a more sublime spectacle....

Herzogenboschee.—At length we dropped asleep, but were soon


roused by a fitful sound of gathering winds, heavy rain followed, and
vivid flashes of lightning, with tremendous thunder. It was very
awful. Mary and I were sitting together, alone, in the open street; a
strange situation! yet we had no personal fear. Before the storm
began, all the lights had been extinguished except one opposite to
us, and another at an inn behind, where were turbulent noises of
merriment, with singing and haranguing, in the style of our village
politicians. These ceased; and, after the storm, lights appeared in
different quarters; pell-mell rushed the fountain; then came a
watchman with his dismal recitative song, or lay; the church clock
telling the hours and the quarters, and house clocks with their
silvery tone; one scream we heard from a human voice; but no
person seemed to notice us, except a man who came out upon the
wooden gallery of his house right above our heads, looked down this
way and that, and especially towards the voitures.... The beating of
the rain, and the rushing of that fountain were continuous, and with
the periodical and the irregular sounds (among which the howling of
a dog was not the least dismal), completed the wildness of the awful
scene, and of our strange situation; sheltered from wet, yet in the
midst of it—and exposed to intermitting blasts, though struggling
with excessive heat—while flashes of lightning at intervals displayed
the distant mountains, and the wide space between; at other times
a blank gloom.

Berne.—The fountains of Berne are ornamented with statues of


William Tell and other heroes. There is a beautiful order, a solidity, a
gravity in this city which strikes at first sight, and never loses its
effect. The houses are of one grey hue, and built of stone. They are
large and sober, but not heavy or barbarously elbowing each other.
On each side is a covered passage under the upper stories, as at
Chester, only wider, much longer, and with more massy supporters....
In all quarters we noticed the orderly decency of the passengers, the
handsome public buildings, with appropriate decorations symbolical
of a love of liberty, of order, and good government, with an
aristocratic stateliness, yet free from show or parade.... The green-
tinted river flows below—wide, full, and impetuous. I saw the snows
of the Alps burnished by the sun about half an hour before his
setting. After that they were left to their wintry marble coldness,
without a farewell gleam; yet suddenly the city and the cathedral
tower and trees were singled out for favour by the sun among his
glittering clouds, and gilded with the richest light. A few minutes,
and that glory vanished. I stayed till evening gloom was gathering
over the city, and over hill and dale, while the snowy tops of the Alps
were still visible.

Sunday, August 6th.—Upon a spacious level adjoining the


cathedral are walks planted with trees, among which we sauntered,
and were much pleased with the great variety of persons amusing
themselves in the same way; and how we wished that one, at least,
of our party had the skill to sketch rapidly with the pencil, and
appropriate colours, some of the groups or single figures passing
before us, or seated in sun or shade. Old ladies appeared on this
summer parade dressed in flycaps, such as were worn in England
fifty years ago, and broad-flowered chintz or cotton gowns; the
bourgeoises, in grave attire of black, with tight white sleeves, yet
seldom without ornament of gold lacing, or chain and ear-rings, and
on the head a pair of stiff transparent butterfly wings, spread out
from behind a quarter of a yard on each side, which wings are to
appearance as thin as gauze, but being made of horse-hair, are very
durable, and the larger are even made of wire. Among these were
seen peasants in shepherdess hats of straw, decorated with flowers
and coloured ribands, pretty little girls in grandmother's attire, and
ladies à la française. We noticed several parties composed of
persons dressed after these various modes, that seemed to indicate
very different habits and stations in society—the peasant and the
lady, the petty shopkeeper and the wealthy tradesman's wife, side
by side in friendly discourse. But it is impossible by words to give a
notion of the enlivening effect of these little combinations, which are
also interesting as evidences of a state of society worn out in
England. Here you see formality and simplicity, antiquated
stateliness and decent finery brought together, with a pervading
spirit of comfortable equality in social pleasures.

* * * * * *

Monday, August 7th.—I sate under an elm tree, looking down the
woody steep to the lake, and across it, to a rugged mountain; no
villages to be seen, no houses; the higher Alps shut out. I could
have forgotten Switzerland, and fancied myself transported to one of
the lonesome lakes of Scotland. I returned to my open station to
watch the setting sun, and remained long after the glowing hues
had faded from those chosen summits that were touched by his
beams, while others were obscurely descried among clouds in their
own dark or snowy mantle.... Met with an inscription on a grey stone
in a little opening of the wood, and would have copied it, for it was
brief, but could not see to read the letters, and hurried on, still
choosing the track that seemed to lead most directly downwards,
and was indeed glad when I found myself again in the public road to
the town.... Late as it was, and although twilight had almost given
place to the darkness of a fine August night, I was tempted aside
into a broad flat meadow, where I walked under a row of tall poplars
by the river-side. The castle, church, and town appeared before us
in stately harmony, all hues of red roofs and painting having faded
away. Two groups of giant poplars rose up, like Grecian temples,
from the level between me and the mass of towers and houses. In
the smooth water the lingering brightness of evening was reflected
from the sky; and lights from the town were seen at different
heights on the hill.

Thun, Tuesday, August 8th.—The Lake of Thun is essentially a


lake of the Alps. Its immediate visible boundary, third or fourth-rate
mountains; but overtopping these are seen the snowy or dark
summits of the Jungfrau, the Eiger, the Stockhorn, the Blumlis Alp,
and many more which I cannot name; while the Kander, and other
raging streams, send their voices across the wide waters. The
remains of a ruined castle are sometimes seen upon a woody or
grassy steep—pleasing remembrances of distant times, but taking no
primary place in the extensive landscape, where the power of nature
is magisterial, and where the humble villages composed of
numerous houses clustering together near the lake, do not interfere
with the impressions of solitude and grandeur. Many of those villages
must be more than half-deserted when the herdsmen follow their
cattle to the mountains. Others of their numerous inhabitants find
subsistence by fishing in the lake. We floated cheerfully along, the
scene for ever changing. On the eastern side, to our left, the shores
are more populous than on the western; one pretty village
succeeded another, each with its spire, till we came to a hamlet, all
of brown wood houses, except one large white dwelling, and no
church. The villages are not, as one may say, in close
neighbourhood; but a substantial solitary house is sometimes seen
between them. The eminences on this side, as we advance, become
very precipitous, and along the ridge of one of them appears a wall
of rocks with turrets, resembling a mighty fortification. The boatmen
directed our ears to the sound of waterfalls in a cleft of the
mountain; but the sight of them we must leave to other voyagers....
The broad pyramidal mountain, Niesen, rising directly from the
lake on the western side towards the head, is always a commanding
object. Its form recalled to my remembrance some of the stony
pyramids of Glencoe, but only its form, the surface being covered
with green pasturage. Sometimes, in the course of the morning, we
had been reminded of our own country; but transiently, and never
without a sense of characteristic difference. Many of the distinctions
favourable to Switzerland I have noticed; and it seems as if I were
ungrateful to our own pellucid lakes, those darlings of the summer
breezes! But when floating on the Lake of Thun we did not forget
them. The greenish hue of its waters is much less pleasing than the
cerulean or purple of the lakes of Cumberland and Westmoreland;
the reflections are less vivid; shore and water do not so delicately
blend together; hence a coasting voyage cannot be accompanied
with an equal variety of minute objects. And I might add many other
little circumstances or incidents that enliven the banks of our lakes.
For instance, in a summer forenoon, the troops of cattle that are
seen solacing themselves in the cool waters within the belt of a
pebbly shore; or, if the season do not drive them thither, how they
beautify the pastures, and rocky unenclosed grounds! While on the
Lake of Thun we did not see a single group of cattle of any kind. I
have not spoken of that other sky, "received into the bosom" of our
lakes, on tranquil summer evenings; for the time of day prevented
our being reminded in the same degree of what we have so often
beheld at such times; but it is obvious that, though the reflections
from masses of brilliant clouds must often be very grand, the clouds
in their delicate hues and forms cannot be seen, in the same soft
distinctness, "bedded in another sky." ...
In this pleasing valley we whirled away, again (as to the first
sound of a Frenchman's whip in the streets of Calais) as blithe as
children; when all at once, looking through a narrow opening of
green and craggy mountains, the Jungfrau (the Virgin) burst upon
our view, dazzling in brightness, which seemed rather heightened
than diminished by a mantle of white clouds floating over the bosom
of the mountain. The effect was indescribable. We had before seen
the snows of the Alps at a distance, propped, as I may say, against
the sky, or blending with, and often indistinguishable from it; and
now, with the suddenness of a pantomimic change, we beheld a
great mountain of snow, very near to us as it appeared, and in
combination with hills covered with flourishing trees, in the pride of
summer foliage. Our mirth was checked; and, awe-struck yet
delighted, we stopped the car for some minutes.
Soon after we discovered the town of Unterseen, which stands
right under the hill, and close to the river Aar, a most romantic spot,
the large, ancient wooden houses of the market-place joining each
other, yet placed in wondrous disregard of order, and built with
uncouth and grotesque variety of gallery and pent-house. The roofs
are mostly secured from the wind by large rough stones laid upon
them. At the end of the town we came to a bridge which we were to
pass over; and here, almost as suddenly, was the river Aar
presented to our view as the maiden-mountain in her resplendent
garb had been before. Hitherto the river had been concealed by, or
only partially seen through, the trees; but at Unterseen it is
imperious, and will be heard, seen, and felt. In a fit of rage it
tumbles over a craggy channel, spreading out and dividing into
different streams, crossed by the long, ponderous wooden bridge,
that, steady and rugged, adds to the wild grandeur of the
spectacle.... I recollect one woody eminence far below us, about
which we doubted whether the object on its summit was rock or
castle, and the point remained undecided until, on our way to
Lauterbrunnen, we saw the same above our heads, on its
perpendicular steep, a craggy barrier fitted to war with the tempests
of ten thousand years. If summer days had been at our command
we should have remained till sunset upon our chosen eminence; but
another, on the opposite side of the vale, named the Hohlbuhl,
invited us, and we determined to go thither. Yet what could be
looked for more delightful than the sights which, by stirring but a
few yards from our elastic couch on the crags, we might see all
round us? On one side, the river Aar streaming through the verdant
vale; on the other, the pastoral, walnut-tree plain, with its one
chapel and innumerable huts, bounded by varied steeps, and leading
the eye, and still more the fancy, into its recesses and to the snowy
barrier of the Jungfrau. We descended on the side opposite to that
by which we climbed the hill, along an easy and delightful track, cut
in the forest among noble trees, chiefly beeches. Winding round the
hill, we saw the bridge above the inn, which we must cross to reach
the foot of the other eminence. We hurried along, through fields,
woody lanes, and beside cottages where children offered us
nosegays gathered from their shady gardens. Every image, every
object in the vale was soothing or cheerful: it seemed a paradise
cradled in rugged mountains. At many a cottage door we could have
loitered till daylight was gone. The way had appeared short at a
distance, but we soon found out our want of skill in measuring the
vales of Switzerland, and long before we had reached the foot of the
hill, perceived that the sun was sinking, and would be gone before
our labour was ended. The strong pushed forward; and by patience
I too, at last gained the desired point a little too late; for the
brilliance had deserted all but the highest mountains. They
presented a spectacle of heavenly glory; and long did we linger after
the rosy lights had passed away from their summits, and taken a
station in the calm sky above them.46 It was ten o'clock when we
reached the inn.

Brienz, Wednesday, August 9th.— ... There was something in the


exterior of the people belonging to the inn at Brienz that reminded
one of the ferry-houses in the Highlands—a sort of untamed
familiarity with strangers, and an expression of savage fearlessness
in danger. While we were waiting at the door, a company of females
came up, returning from harvest labours in the Vale of Berne to their
homes at the head of the lake. They gathered round, eyeing us
steadily, and presently a girl began to sing, another joined, a third, a
fourth, and then a fifth, their arms gracefully laid over each other's
shoulders. Large black or straw hats shaded their heads, undecked
with ribands, and their attire was grey; the air they sang was
plaintive and wild, without sweetness, yet not harsh. The group
collected round that lonely house on the river's edge would have
made a pretty picture.... The shore of Brienz, as far as we saw it, is
much richer in intricate graces than the shores of the Lake of Thun.
Its little retiring bays and shaggy rocks reminded me sometimes of
Loch Ketterine.
Our minstrel peasants passed us on the water, no longer singing
plaintive ditties, such as inspired the little poem which I shall
transcribe in the following page; but with bursts of merriment they
rowed lustily away. The poet has, however, transported the minstrels
in their gentle mood from the cottage door to the calm lake.

"What know we of the Blest above


But that they sing and that they love?"
Yet if they ever did inspire
A mortal hymn, or shaped the choir,
Now, where those harvest Damsels float
Homeward in their rugged Boat
(While all the ruffling winds are fled,
Each slumbering on some mountain's head)
Now, surely, hath that gracious aid
Been felt, that influence display'd.
Pupils of Heaven, in order stand
The rustic Maidens, every hand
Upon a Sister's shoulders laid,—
To chant, as Angels do above,
The melodies of Peace, in love!47

Interlachen, Thursday, August 10th.—Many a streamlet crossed


our way, after tumbling down the hills—sometimes as clear as the
springs of our Westmoreland mountains, but the instant they
touched the glacier river of the valley their pure spirit was lost—
annihilated by its angry waters. I have seen a muddy and a
transparent streamlet at a few yards' distance hurrying down the
same steep; in one instance the two joined at the bottom, travelled
side by side in the same track, remaining distinct though joined
together, as if each were jealous of its own character. Yielding to
mild necessity, they slowly blended, ere both, in turbulent disrespect,
were swallowed up by the master torrent.
The Jungfrau (till then hidden except a small portion of its
summit) burst upon our view, covered with snow from its apparent
base to its highest pike. We had been ascending nearly four hours;
and all at once the wintery mountain appeared before us; of
majestic bulk, though but a small part of that mass springing from
the same foundation, some of the pikes of which are seen far and
wide from every quarter of the compass; and we, after all this
climbing, seemed not nearer to the top than when we had viewed
what appeared to be the highest summits from below. We were all
on foot, and (at the moment when, about to turn to our left and
coast along the side of the hill which, sloping down to the base of
the snowy mountain, forms a hollow between) suddenly we heard a
tremendous noise—loud like thunder; and all stood still. It was the
most awful sound which had ever struck upon our ears. For some
minutes, we did not utter a single word:—and when the sound was
dying away exclaimed, "It is an avalanche!" eagerly asking "where?"
and whence it had come. The guide pointed to a very small and
almost perpendicular rivulet (as it appeared to us) perfectly white—
and dashing down the mountains—"That," said he, "is the
Avalanche!" We could not believe that such mighty tumult had
proceeded from a little rill (to our eyes it was nothing else, though
composed of falling masses of snow, and probably ice), and I
suspect we were loth to leave the mystery explained: however, we
were compelled to yield to our guide's experience, seeing a few
minutes after, the motion of the little white rill or torrent gradually
settle till all was gone, and perfect silence succeeded, silence more
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like