MathSource Reviews

Coclea dell'Orecchio Interno

Electronic Subscriptions

Included in the distribution for each electronic subscription is the file Review82.nb containing Mathematica code for the material described in this article.

Edited by Matthew M. Thomas

The words you are reading were written in early April 1999, just after the completion of the Season of the Fool. One of the better entries for April First of this year was published by Red Herring, a periodical whose focus is "the business of technology." In its April 1999 issue, the Herring spun a yarn about a device which, when worn on the ear, allowed the wearer to convey email via the new Telepathic Internet Data Exchange communications protocol [Andrew P. Madden, "Think or Swim," Red Herring, 65, pp. 62-66, April 1999]. The device was code-named Orecchio — Italian for "ear." Far-fetched though the concept might be, the prose and graphics in the article met the style standards of their host publication, and readers more inclined toward gullibility than skepticism raced to the Web to learn more. The relevant URL was www.thinkyourmail.com; this site offered background information on Orecchio, as well as a link to a page of technical specifications. Those following that link were reminded of the Season: "April Fools! (We were just kidding.)" Not to be outdone, the 25 March 1999 edition of Upside Today (www.upside.com) featured a tongue-in-cheek story by Upside Media CEO David Bunnell, telling of a five-year-old who had amassed millions of dollars through online stock trading. That story contains a link to the Red Herring home page; perhaps this link implies that the subject toddler bought low and sold high through Orecchio. 
The 1999 edition of the Season of the Fool has long since past. Yet, for the task at hand, your reviewer strives to retain the spirit of the Season — and to refrain from the playing of the Fool. The MathSource Review for this quarter is attuned to the ear — not to any whimsical device that would be donned above the ear, but to the ear itself. If we shrink ourselves Gulliver-like to a thousandth of our size, and undertake a journey that begins at the outer ear, we will inevitably (cerumen permitting) meander to the inner ear. Once there, we shall behold the snail shell — the cochlea — that is the focal point of the MathSource item we shall review. This item bears the title "Lyon's Cochlear Model," and is important because to model the cochlea is to understand better how humans perceive speech, and to gain insight into designing better speech recognition systems. This MathSource item, however, is also important because of its thorough and detailed nature, and because of the circumstances surrounding its preparation. More about said importance in due course. Less important, but in keeping with the spirit of the aforementioned Season, is that the phrase "cochlea of the inner ear," when translated into the language of Red Herring's Orecchio, gives us our title for this MathSource Review.

Background

"Lyon's Cochlear Model" is item pub/Applications/LifeSci- ence/0202-183 within MathSource. Copyrighted in 1988 (yes — it is as old as Mathematica itself), it was prepared by Malcolm Slaney, then of the Advanced Technology Group within Apple Computer, Inc. The "Lyon" in the item title refers to Richard F. Lyon, who had crossed paths with Slaney at Apple, and who ostensibly developed the model of note while at Apple. Neither Slaney nor Lyon remains at Apple: At least through 22 January 1999 (the latest date of update on his web site), Slaney has been affiliated with Interval Research, Inc. in Palo Alto, CA; after his March 1997 departure from Apple, Lyon has been affiliated with the Physics of Computation group at Caltech. Slaney's web site is www.interval.com/malcolm/pubs.html, and his email address is malcolm@interval.com. Lyon's web site is www.pcmp.caltech.edu/dick/, and his email address is dicklyon@acm.org. Richard F. Lyon asks that you not confuse him with Richard H. Lyon of MIT. Slaney's web site offers not only Lyon's Cochlear Model, but also a number of other Mathematica notebooks and MATLAB toolboxes. If this Review spurs you to learn more about cochlear modeling in particular or the neurological perception of sound in general, you would be well-advised to begin your investigation at the web sites of these two researchers, for their sites are extensive indeed. 
Richard F. Lyon's cochlear model was formally presented in "A Computational Model of Filtering, Detection, and Compression in the Cochlea," in May 1982, as part of the IEEE International Conference on Acoustics, Speech, and Signal Processing in Paris. Malcolm Slaney's "Lyon's Cochlear Model" is also known as Apple Technical Report #13, which once upon a time was available through the Apple Corporate Library. It is not known whether triskaidekaphobia or the lack thereof had any influence on Slaney's decision to release "Lyon's Cochlear Model" as an Apple Technical Report. Through Slaney's web site, you can get this MathSource item as a Mathematica notebook, as a PDF file (www.slaney.org/malcolm/apple/tr13/Ly- onsCochlea.pdf) readable through the Adobe Acrobat Reader, and as a PostScript file. Given the extensive bibliographies made available by Slaney and Lyon in their respective works, we will not feature a separate bibliography in this Review. As of early April 1999, however, there were other non-Apple cochlea-dedicated web pages that are worthy of mention: The Italian page poirot.sissa.it/ multidisc/cochlea/cochlea.html offers a worthwhile coclea tour to the centi-Lilliputian; page adam.com/3d/co- chlea.html provides a 3-D view of the snail shell; page www.ee.memphis.edu/lfsang/Cochlear.html presents a "Java Cochlear Auditory Model" that plots gain, phase, and wave number vs. frequency, given many user-adjustable parameters. Examination of these pages shall be left as an exercise for the reader. 
MathSource item pub/Applications/LifeScience/0202- 183 comprises a 3-kB README.txt file, and a 2-MB Co- chlea.nb notebook file; the latter generates a 22-kB Co- chlea.m package file. It is the notebook that has been cloned in PDF and PostScript formats, and we will discuss the notebook exclusively in the following section. Per the MathSource introductory paragraph for this item, the notebook describes how acoustic pressure waves in the cochlea are translated into nerve firings, which the brain uses for speech recognition. The README.txt file notes that Lyon's model treats the cochlea as a black box, with the model focus on input to and output from the cochlea. This README file also describes how [one at least had been able] to get a printed report copy and a Macintosh floppy from the Apple Corporate Library. In addition, the README file notes that five distinct audiences will be interested in "Lyon's Cochlear Model": speech researchers and brain modelers; signal processors; mathematicians; "Mac Fans (and NeXT too);" Mathematica users. 
Slaney's README.txt file takes care of the admini- strative business involving Cochlea.nb. That is what a README file should do. But there are other aspects of this decade-old file that merit special attention. Slaney knew that Cochlea.nb, as a publication, was ahead of its time, so he used his README.txt file to explain the interactive Mathematical features offered by Mathematica. He also took pains to make an "electronic announcement" of the debut of Cochlea.nb, since the electronic notebook was more important than its printed analogue. It is interesting to note how yesterday's exception has become today's rule. And while Wolfram Researchers are proud of the text-processing advances Mathematica has made in the past decade, Slaney circa 1988 writes in README.txt: "I often describe Mathematica as my favorite word processor (great for the shock effect)." Your reviewer appreciates how the Apple-employed Slaney touted Cochlea.nb as for "Mac Fans (and NeXT too) [reviewer's emphasis]" in README.txt: It reminds one of the significant impact that Mathematica-christener Steve Jobs has had on the WRI product. Finally, Slaney in README.txt praises WRI for letting Apple distribute a accompanying sample notebook reader with Cochlea.nb. In an era when almost all demo diskettes rendered would-be users passive and slackjawed, MathReader (and perhaps the VideoWorks player from Macromind) started a trend that thrives today, through "players" from Acrobat Reader by Adobe to RealPlayer Plus G2 by RealNetworks. Kudos to the early WRI for its prescience.

COCHLEA.NB

Slaney's Cochlea.nb notebook, at 2 MB, is a relatively large item as MathSource items go. Even today, it cannot fit on a standard (1.44 MB) diskette; it certainly could not fit on the smaller diskettes of its day. The printed version of the notebook required 63 pages, using the print settings your reviewer had in use. It is possible, though not proven, that the size of the notebook affected its download from MathSource: It appears that none of the non-Mathematica graphics in Cochlea.nb survived the download from MathSource. Clicking on the notebook voids from these AWOL graphics illuminated the borders for these graphics, but not the graphics themselves. A check of the companion LyonsCochlea.pdf file unveils these truant graphics: an illustration of the ear in general and the cochlea in particular; Richard F. Lyon's cochlear model in block-diagram form; a block-diagram illustration of high/low-frequency notch filters and resonators within said model; s-plane (Laplace-plane) plots of pole and zero locations for said notch filters and resonators; those identical s-plane plots, but with circles encircling certain sets of poles and zeros; a block-diagram illustration of automatic gain control (AGC); a similar illustration of each stage of an ear cascade model. Either your reviewer lost these graphics during Cochlea.nb download, or the graphics are simply not present in Cochlea.nb. Fortunately, LyonsCochlea.pdf complements Cochlea.nb by supplying the missing non-Mathematica graphics. 
The first section of Cochlea.nb is the Introduction, which introduces Mathematica notebooks to the then-typical neophyte audience of 1988, and which states the presumption that said audience has at least some knowledge of signal processing (given the forthcoming discussion of filters in Laplace- and z-domain). That introduction, which would be patronizing in 1999, was very timely in 1988. Section two deals with the ear model. Subsection 2.1 sketches the philosophy behind the ear model, noting that Cochlea.nb would "describe a number of the details that have not been previously published," and stating that the cochlea would be modeled as an input-output black box, with its inner workings left unexamined. Subsection 2.2 offers an overview of the Richard F. Lyon model, whose block diagram is alas left to the imagination of Cochlea.nb reviewers. This subsection does note that Lyon's model combines a series of filters (which model traveling pressure waves) with several Half Wave Rectifiers (HWR — for signal energy detection) and several stages of Automatic Gain Control (AGC — for compression). The subsection then elaborates upon cochlear behavior. Subsequent subsections describe the cascade-parallel version of the cochlear model (absent another block diagram and s-plane plots), the parameters for said model, cascade-parallel filter design, and — last but latest — a cascade-only model which combines notch filters and resonators into a single filter. Test code (remnants perhaps from a beta-test notebook?) concludes section two. 
Section three is entitled "The Cochlea Filter Bank," and describes the cascade of filters that define the ear model. Subsections examine a preemphasis stage (to model, roughly, outer- and middle-ear effects), individual stage filters, and the cascade response. In this section, and throughout the notebook, Slaney uses a series of individual Mathematica graphics commands to generate individual graphics. In subsection 3.3, for example, Slaney taps custom-Cochlea.m commands

FreqResponse[CascadeFilter[1,16000],16000]
FreqResponse[CascadeFilter[4,16000],16000]
FreqResponse[CascadeFilter[10,16000],16000]
FreqResponse[CascadeFilter[30,16000],16000]
FreqResponse[CascadeFilter[60,16000],16000]
FreqResponse[CascadeFilter[75,16000],16000]

to draw the cascade frequency response (at sampling interval 16 kHz) for cascade filter stage  =  1, 4, 10, 30, 60, and 75. Since Slaney does not offer much by way of comment on each of these six individual plots, and since stages 1, 4, 10, 30, 60, and 75 do not appear to be special, your reviewer wonders why Slaney did not use one Mathematica function to generate all of the frequency response plots. To wit:

Table[FreqResponse[
 CascadeFilter[stage,16000],16000],
  {stage,15,75,15}]

would have not only generated frequency response plots for a wide span of cascade stages, but also allowed Mathematica (and MathReader) users a less cumbersome animation of the plots. Slaney also forsakes the Table[] function in other sections, in favor of individual Mathematica commands that seemingly did not require individual use. To be sure, the onus is upon Slaney, not the user; still, Slaney's willingness to shoulder a needless burden has your reviewer bemused. On Slaney's behalf, though, your reviewer admires his definition of the Cascade- Filter[] function as

CascadeFilter[index_, fs_] :=
 CascadeFilter[index, fs] =
  Product[EarFilter[i,fs], {i, 0, index}]

to generate (via Product[]) novel responses for novel (index, fs) pairings, and to recall said responses for (index, fs) pairings already seen. This Mathematica construct is an elegant one, and Slaney's use of it is deft. 
Slaney brings section three to a close with two 3-D plots and a density plot. These plots illustrate the total z-plane response for the first five cascaded stages and all 85 such stages of the ear filter. The density plot makes the same representation as the second 3-D plot. Below, we replicate this density plot, as well as analogous plots for the first five, 25, 45, and 65 cascaded stages:

Table[DensityPlot[
 Abs[FilterEval[CascadeFilter[i,16000], x + I y]],
 {x,-1,1}, {y,-1,1},
 PlotPoints  ->  64], {i, 5, 85, 20}]

This table of plots shows a bifurcation of the active response region starting near (-1, 0), a symmetric "riding" of the unit circle perimeter by the two offspring active response regions (one clockwise, one counterclockwise), and a unification of those regions starting near (1, 0). 
Section four, labeled "The Automatic Gain Control (AGC)," continues the Table[] avoidance trend started in section two and buttressed in section three. In several instances is the PlotResponse[AGCResponse[h, 1, .2, 15]] command used, where h is the height of the step input evoking the response, 1 is a target value, .2 is a parameter related to system time constant, and 15 (20, in other cases) represents the first 15 (20) outputs of an automatic gain controller. With h as the variable, the Table[] command could again have been employed. In this section, however, Slaney offers pertinent commentary on almost every individual plot, and the instructive nature of that commentary, combined with the promixity of that commentary to its subject, justifies avoidance of the Table[] function. In subsection 4.1, despite the missing block-diagram illustration of AGC, Slaney makes the point that AGC initially overcorrects through excess gain reduction, and if inputs to AGC are large enough, oscillatory and unstable response will result. In subsection 4.2, Slaney presents three approaches to stabilize AGC performance. The first entails following a variable gain with half wave rectification — producing an oscillatory though stable response. The second entails capping the state variable in the AGC scheme at unity — producing another oscillatory though stable response. The last entails replacing "state" with "state/(1+state)" in the AGC scheme — producing output no longer below its target for large inputs, but avoiding both oscillatory and unstable behavior. Section four is the strongest section in Cochlea.nb; it is presented very well. 
Though entitled "Conclusions," section five is but a short summary of Cochlea.nb. Section six is a thorough listing of usage statements for Cochlea.nb and Cochlea.m, thus earning Slaney high marks for good documentation. Section seven is a list of references, which earn Slaney similar marks. An extensive appendix discusses continu-
ous and discrete time filter design; the appendix has its own listing of usage statements.

Assessment

Save for the first missing non-Mathematica illustration, which is put to shame by what adam.com/3d/cochlea.html offers, the graphics missing from Cochlea.nb are integral to the flow of Cochlea.nb, and their absence makes the notebook a tough read for the passive (MathReader) user. Use of the Block[] function shows the age of Cochlea.nb, written before the advent of both Module[] and Play[] within Mathematica. The test code at the end of section two is ambiguous: What makes for a successful outcome? Which results are good; which are bad? In addition, the Table[] function and any of its equivalents are underused, especially in sections two and three. 
Of course, recall that in 1988 it was quite the accomplishment just to import graphics generated outside Mathematica into a notebook, so the context of that era salves the feeling of loss. Also: Malcolm Slaney presented all of his Mathematica operations in evaluated form, so whatever the woes that plagued the non-Mathematica graphics, Slaney's presentation appeals to both the active (Mathematica) and passive (MathReader) user. While Cochlea.nb shows signs of age, those signs are of its aging well: It is still an excellent model for a Mathematica notebook, replete with knowledge generated by and foreign to Mathematica. And while the Table[] function may be underused in sections two and three, restraint upon its use in section four was certainly warranted; Slaney showed said restraint. 
In Cochlea.nb, one can detect the traces of Slaney's struggle to convey information through the new notebook medium. He certainly fought the good fight. Said information was both old and new, as Slaney used Cochlea.nb to present hitherto unpublished research, therein complementing previously published work by Richard F. Lyon and himself. His use of a function that "remembers" previous results is also to be judged adroit.

About the Author

Matthew M. Thomas, multilingual in programming languages, is woefully unilingual in languages written and spoken. He is as such most blissfully ignorant of whether the title constitutes a proper translation from English to Italian; indeed, he ascribes credit (or blame) for the translation to Systran Translation Software (www.systransoft.com). He can be reached via email, preferably in English, at 
thomas@wuche2.wustl.edu