Smartphone based real time digital signal processing Third Edition Abhishek Sehgal pdf download
Smartphone based real time digital signal processing Third Edition Abhishek Sehgal pdf download
https://textbookfull.com/product/smartphone-based-real-time-
digital-signal-processing-third-edition-abhishek-sehgal/
https://textbookfull.com/product/real-time-digital-signal-
processing-from-matlab-to-c-with-the-tms320c6x-dsps-third-
edition-morrow/
https://textbookfull.com/product/radiation-hardened-cmos-
integrated-circuits-for-time-based-signal-processing-jeffrey-
prinzie/
https://textbookfull.com/product/conceptual-digital-signal-
processing-with-matlab-keonwook-kim/
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/
https://textbookfull.com/product/smartphone-based-medical-
diagnostics-jeong-yeol-yoon/
https://textbookfull.com/product/think-dsp-digital-signal-
processing-in-python-1st-edition-allen-b-downey/
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/
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.
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.
DOI 10.2200/S01039ED3V01Y202008SPR019
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
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
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
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.
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.
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.
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.
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.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.
Figure 2.1: (a) Standard edition of Java platform and (b) Java downloads.
2.1. INSTALLATION STEPS 13
* * * * * *
"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!"
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
* * * * * *
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....
* * * * * *
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.
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.
textbookfull.com