100% found this document useful (4 votes)
37 views

PDF Audio Toolbox User s Guide MATLAB Simulink 1st Edition Mathworks download

s

Uploaded by

udorwatad
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 (4 votes)
37 views

PDF Audio Toolbox User s Guide MATLAB Simulink 1st Edition Mathworks download

s

Uploaded by

udorwatad
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/ 37

Get ebook downloads in full at ebookmeta.

com

Audio Toolbox User s Guide MATLAB Simulink 1st


Edition Mathworks

https://ebookmeta.com/product/audio-toolbox-user-s-guide-
matlab-simulink-1st-edition-mathworks/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Audio Toolbox™
User’s Guide

R2023a
How to Contact MathWorks

Latest news: www.mathworks.com

Sales and services: www.mathworks.com/sales_and_services

User community: www.mathworks.com/matlabcentral

Technical support: www.mathworks.com/support/contact_us

Phone: 508-647-7000

The MathWorks, Inc.


1 Apple Hill Drive
Natick, MA 01760-2098
Audio Toolbox™ User’s Guide
© COPYRIGHT 2016–2023 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied
only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form
without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through
the federal government of the United States. By accepting delivery of the Program or Documentation, the government
hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer
software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014.
Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain
to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and
Documentation by the federal government (or other entity acquiring for or through the federal government) and shall
supersede any conflicting contractual terms or conditions. If this License fails to meet the government's needs or is
inconsistent in any respect with federal procurement law, the government agrees to return the Program and
Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be
trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for
more information.
Revision History
March 2016 Online only New for Version 1.0 (Release 2016a)
September 2016 Online only Revised for Version 1.1 (Release 2016b)
March 2017 Online only Revised for Version 1.2 (Release 2017a)
September 2017 Online only Revised for Version 1.3 (Release 2017b)
March 2018 Online only Revised for Version 1.4 (Release 2018a)
September 2018 Online only Revised for Version 1.5 (Release 2018b)
March 2019 Online only Revised for Version 2.0 (Release 2019a)
September 2019 Online only Revised for Version 2.1 (Release 2019b)
March 2020 Online only Revised for Version 2.2 (Release 2020a)
September 2020 Online only Revised for Version 2.3 (Release 2020b)
March 2021 Online only Revised for Version 3.0 (Release 2021a)
September 2021 Online only Revised for Version 3.1 (Release 2021b)
March 2022 Online only Revised for Version 3.2 (Release 2022a)
September 2022 Online only Revised for Version 3.3 (Release 2022b)
March 2023 Online only Revised for Version 3.4 (Release 2023a)
Contents

Audio Toolbox Examples


1
Transfer Learning with Pretrained Audio Networks . . . . . . . . . . . . . . . . . . 1-2

Effect of Soundproofing on Perceived Noise Levels . . . . . . . . . . . . . . . . . . 1-5

Speech Command Recognition Code Generation on Raspberry Pi . . . . . 1-22

Speech Command Recognition Code Generation with Intel MKL-DNN . 1-32

Speech Command Recognition in Simulink . . . . . . . . . . . . . . . . . . . . . . . 1-40

Time-Frequency Masking for Harmonic-Percussive Source Separation


......................................................... 1-43

Binaural Audio Rendering Using Head Tracking . . . . . . . . . . . . . . . . . . . 1-65

Speech Emotion Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-70

End-to-End Deep Speech Separation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-83

Delay-Based Pitch Shifter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-99

Psychoacoustic Bass Enhancement for Band-Limited Signals . . . . . . . 1-103

Tunable Filtering and Visualization Using Audio Plugins . . . . . . . . . . . 1-106

Communicate Between a DAW and MATLAB Using UDP . . . . . . . . . . . . 1-114

Acoustic Echo Cancellation (AEC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-118

Active Noise Control Using a Filtered-X LMS FIR Adaptive Filter . . . . 1-130

Acoustic Noise Cancellation Using LMS . . . . . . . . . . . . . . . . . . . . . . . . . 1-137

Delay-Based Audio Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-139

Add Reverberation Using Freeverb Algorithm . . . . . . . . . . . . . . . . . . . . 1-145

Multiband Dynamic Range Compression . . . . . . . . . . . . . . . . . . . . . . . . 1-148

Pitch Shifting and Time Dilation Using a Phase Vocoder in MATLAB . 1-157

Pitch Shifting and Time Dilation Using a Phase Vocoder in Simulink . 1-161

iii
Remove Interfering Tone From Audio Stream . . . . . . . . . . . . . . . . . . . . 1-163

Vorbis Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-166

Dynamic Range Compression Using Overlap-Add Reconstruction . . . . 1-169

LPC Analysis and Synthesis of Speech . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-171

Simulation of a Plucked String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-173

Audio Phaser Using Multiband Parametric Equalizer . . . . . . . . . . . . . . 1-174

Loudness Normalization in Accordance with EBU R 128 Standard . . . 1-178

Multistage Sample-Rate Conversion of Audio Signals . . . . . . . . . . . . . . 1-182

Graphic Equalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-189

Audio Weighting Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-199

Sound Pressure Measurement of Octave Frequency Bands . . . . . . . . . . 1-202

Cochlear Implant Speech Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-205

Acoustic Beamforming Using a Microphone Array . . . . . . . . . . . . . . . . 1-210

Identification and Separation of Panned Audio Sources in a Stereo Mix


........................................................ 1-219

Live Direction of Arrival Estimation with a Linear Microphone Array . 1-223

Positional Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-227

Surround Sound Matrix Encoding and Decoding . . . . . . . . . . . . . . . . . . 1-230

Speaker Identification Using Pitch and MFCC . . . . . . . . . . . . . . . . . . . . 1-237

Measure Audio Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-251

Measure Performance of Streaming Real-Time Audio Algorithms . . . . 1-256

THD+N Measurement with Tone-Tracking . . . . . . . . . . . . . . . . . . . . . . . 1-259

Measure Impulse Response of an Audio System . . . . . . . . . . . . . . . . . . . 1-262

Measure Frequency Response of an Audio Device . . . . . . . . . . . . . . . . . 1-267

Generate Standalone Executable for Parametric Audio Equalizer . . . . 1-272

Deploy Audio Applications with MATLAB Compiler . . . . . . . . . . . . . . . . 1-275

Parametric Audio Equalizer for Android Devices . . . . . . . . . . . . . . . . . . 1-279

Parametric Audio Equalizer for iOS Devices . . . . . . . . . . . . . . . . . . . . . . 1-285

iv Contents
Audio Effects for iOS Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-292

Multiband Dynamic Range Compression for iOS Devices . . . . . . . . . . . 1-301

Denoise Speech Using Deep Learning Networks . . . . . . . . . . . . . . . . . . 1-312

Train Speech Command Recognition Model Using Deep Learning . . . . 1-332

Ambisonic Plugin Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-344

Ambisonic Binaural Decoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-350

Multicore Simulation of Acoustic Beamforming Using a Microphone


Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-353

Convert MIDI Files into MIDI Messages . . . . . . . . . . . . . . . . . . . . . . . . . 1-358

Cocktail Party Source Separation Using Deep Learning Networks . . . . 1-368

Parametric Equalizer Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-391

Octave-Band and Fractional Octave-Band Filters . . . . . . . . . . . . . . . . . . 1-399

Pitch Tracking Using Multiple Pitch Estimations and HMM . . . . . . . . . 1-406

Train Voice Activity Detection in Noise Model Using Deep Learning . . 1-430

Voice Activity Detection in Noise Using Deep Learning . . . . . . . . . . . . . 1-449

Using a MIDI Control Surface to Interact with a Simulink Model . . . . 1-458

Spoken Digit Recognition with Wavelet Scattering and Deep Learning


........................................................ 1-461

Active Noise Control with Simulink Real-Time . . . . . . . . . . . . . . . . . . . . 1-477

Acoustic Scene Recognition Using Late Fusion . . . . . . . . . . . . . . . . . . . 1-486

Keyword Spotting in Noise Using MFCC and LSTM Networks . . . . . . . 1-501

Speaker Verification Using Gaussian Mixture Model . . . . . . . . . . . . . . . 1-527

Sequential Feature Selection for Audio Features . . . . . . . . . . . . . . . . . . 1-545

Train Generative Adversarial Network (GAN) for Sound Synthesis . . . 1-558

Speaker Verification Using i-Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-582

i-vector Score Normalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-607

i-vector Score Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-626

Speaker Recognition Using x-vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-642

v
Speaker Diarization Using x-vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-657

Train Spoken Digit Recognition Network Using Out-of-Memory Features


........................................................ 1-671

Train Spoken Digit Recognition Network Using Out-of-Memory Audio


Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-678

Keyword Spotting in Noise Code Generation with Intel MKL-DNN . . . 1-685

Keyword Spotting in Noise Code Generation on Raspberry Pi . . . . . . . 1-691

Dereverberate Speech Using Deep Learning Networks . . . . . . . . . . . . . 1-699

Speaker Identification Using Custom SincNet Layer and Deep Learning


........................................................ 1-723

Acoustics-Based Machine Fault Recognition . . . . . . . . . . . . . . . . . . . . . 1-737

Acoustics-Based Machine Fault Recognition Code Generation with Intel


MKL-DNN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-757

Acoustics-Based Machine Fault Recognition Code Generation on


Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-764

audioDatastore Object Pointing to Audio Files . . . . . . . . . . . . . . . . . . . . 1-775

Accelerate Audio Deep Learning Using GPU-Based Feature Extraction


........................................................ 1-777

Train 3-D Sound Event Localization and Detection (SELD) Using Deep
Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-788

3-D Sound Event Localization and Detection Using Trained Recurrent


Convolutional Neural Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-815

Import Audacity Labels to Signal Labeler . . . . . . . . . . . . . . . . . . . . . . . . 1-829

Room Impulse Response Simulation with the Image-Source Method and


HRTF Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-833

Room Impulse Response Simulation with Stochastic Ray Tracing . . . . 1-848

Feature Selection for Audio Classification . . . . . . . . . . . . . . . . . . . . . . . 1-860

Transfer Learning with Pretrained Audio Networks in Deep Network


Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-872

Speech Command Recognition Code Generation with Intel MKL-DNN


Using Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-881

Loudspeaker Modeling with Simscape™ . . . . . . . . . . . . . . . . . . . . . . . . . 1-891

vi Contents
Investigate Audio Classifications Using Deep Learning Interpretability
Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-908

Speech Command Recognition on Raspberry Pi Using Simulink . . . . . 1-922

Speech Command Recognition Using Deep Learning . . . . . . . . . . . . . . 1-929

Keyword Spotting in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-940

Audio Transfer Learning Using Experiment Manager . . . . . . . . . . . . . . 1-942

Model Smart Speaker in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-948

Train 3-D Speech Enhancement Network Using Deep Learning . . . . . . 1-951

3-D Speech Enhancement Using Trained Filter and Sum Network . . . . 1-973

Automated Design of Audio Filters for Room Equalization . . . . . . . . . . 1-983

Audio-Based Anomaly Detection for Machine Health Monitoring . . . . 1-997

Use Datastores to Manage Audio Data Sets . . . . . . . . . . . . . . . . . . . . . 1-1010

Read, Analyze and Process SOFA Files . . . . . . . . . . . . . . . . . . . . . . . . . 1-1014

Impulse Response Measurement Using a NI USB-4431 Device . . . . . 1-1034

Plot Large Audio Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1040

Audio Event Classification Using TensorFlow Lite on Raspberry Pi . . 1-1045

Deploy Smart Speaker System on Raspberry Pi Using Simulink . . . . . 1-1053

Plugin GUI Design


2
Design User Interface for Audio Plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

Use the Audio Labeler


3
Label Audio Using Audio Labeler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Load Unlabeled Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Define and Assign Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Export Label Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
Export Labeled Audio Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Prepare Audio Datastore for Deep Learning Workflow . . . . . . . . . . . . . . 3-11

vii
Choose an App to Label Ground Truth Data . . . . . . . . . . . . . . . . . . . . . . . 3-13

Speech2Text and Text2Speech Chapter


4
Speech-to-Text Transcription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2

Text-to-Speech Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3

Measure Impulse Response of an Audio System


5
Measure and Manage Impulse Responses . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Configure Audio I/O System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Configure IR Acquisition Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
Acquire IR Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Analyze and Manage IR Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Export IR Measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
Generate MATLAB Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8

Design and Play a MIDI Synthesizer


6
Design and Play a MIDI Synthesizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
Convert MIDI Note Messages to Sound Waves . . . . . . . . . . . . . . . . . . . . . 6-2
Synthesize MIDI Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3
Synthesize Real-Time Note Messages from MIDI Device . . . . . . . . . . . . . . 6-3

MIDI Device Interface


7
MIDI Device Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
MIDI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
MIDI Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
MIDI Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3

viii Contents
Dynamic Range Control
8
Dynamic Range Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Linear to dB Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Gain Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
Gain Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
Make-Up Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
dB to Linear Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Apply Calculated Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Example: Dynamic Range Limiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7

MIDI Control for Audio Plugins


9
MIDI Control for Audio Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
MIDI and Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
Use MIDI with MATLAB Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2

MIDI Control Surface Interface


10
MIDI Control Surface Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
About MIDI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
MIDI Control Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Use MIDI Control Surfaces with MATLAB and Simulink . . . . . . . . . . . . . 10-3

Use the Audio Test Bench


11
Develop, Analyze, and Debug Plugins In Audio Test Bench . . . . . . . . . . . 11-2
Choose Objects Under Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Run Audio Test Bench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4
Debug Source Code of Audio Plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Open Scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Configure Input to Audio Test Bench . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6
Configure Output from Audio Test Bench . . . . . . . . . . . . . . . . . . . . . . . . 11-6
Call Custom Visualization of Audio Plugin . . . . . . . . . . . . . . . . . . . . . . . . 11-7
Synchronize Plugin Property with MIDI Control . . . . . . . . . . . . . . . . . . . 11-8
Play the Audio and Save the Output File . . . . . . . . . . . . . . . . . . . . . . . . . 11-8
Validate and Generate Audio Plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9
Generate MATLAB Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9

ix
Audio Plugin Example Gallery
12
Audio Plugin Example Gallery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Audio Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Gain Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Spatial Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Communicate Between MATLAB and DAW . . . . . . . . . . . . . . . . . . . . . . . 12-2
Music Information Retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Speech Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Deep Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Audio Plugin Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2

Equalization
13
Equalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Equalization Design Using Audio Toolbox . . . . . . . . . . . . . . . . . . . . . . . . 13-2
EQ Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Lowpass and Highpass Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5
Shelving Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-6

Deployment
14
Desktop Real-Time Audio Acceleration with MATLAB Coder . . . . . . . . . . 14-2

What is C Code Generation from MATLAB? . . . . . . . . . . . . . . . . . . . . . . . 14-5


Using MATLAB Coder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-5
C/C++ Compiler Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-5
Functions and System Objects That Support Code Generation . . . . . . . . 14-6

Audio I/O User Guide


15
Run Audio I/O Features Outside MATLAB and Simulink . . . . . . . . . . . . . 15-2

Block Example Repository


16
Decrease Underrun . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-2

x Contents
Block Example Repository
17
Extract Cepstral Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-3

Tune Center Frequency Using Input Port . . . . . . . . . . . . . . . . . . . . . . . . . 17-4

Gate Audio Signal Using VAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-6

Frequency-Domain Voice Activity Detection . . . . . . . . . . . . . . . . . . . . . . . 17-8

Visualize Noise Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-9

Detect Presence of Speech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-12

Perform Graphic Equalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-14

Split-Band De-Essing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-16

Diminish Plosives from Speech . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-17

Suppress Loud Sounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-18

Attenuate Low-Level Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-20

Suppress Volume of Loud Sounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-22

Gate Background Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-24

Output Values from MIDI Control Surface . . . . . . . . . . . . . . . . . . . . . . . 17-26

Apply Frequency Weighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-28

Compare Loudness Before and After Audio Processing . . . . . . . . . . . . . 17-30

Two-Band Crossover Filtering for a Stereo Speaker System . . . . . . . . . 17-32

Mimic Acoustic Environments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-34

Perform Parametric Equalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-35

Perform Octave Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-37

Read from Microphone and Write to Speaker . . . . . . . . . . . . . . . . . . . . . 17-39

Channel Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-41

Trigger Gain Control Based on Loudness Measurement . . . . . . . . . . . . 17-42

Generate Variable-Frequency Tones in Simulink . . . . . . . . . . . . . . . . . . 17-44

Trigger Reverberation Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-47

xi
Model Engine Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-48

Use Octave Filter Bank to Create Flanging Chorus Effect for Guitar
Layers (Overdubs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-50

Decompose Signal using Gammatone Filter Bank Block . . . . . . . . . . . . 17-52

Visualize Filter Response of Multiband Parametric Equalizer Block . . 17-54

Detect Music in Simulink Using YAMNet . . . . . . . . . . . . . . . . . . . . . . . . 17-57

Compare Sound Classifier block with Equivalent YAMNet blocks . . . . . 17-60

Detect Air Compressor Sounds in Simulink Using YAMNet . . . . . . . . . . 17-62

Design Auditory Filter Bank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-66

Design Mel Filter Bank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-67

Extract Auditory Spectrogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-68

Extract Mel Spectrogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-69

Filter Audio Using Shelving Filter Block . . . . . . . . . . . . . . . . . . . . . . . . . 17-71

Compare VGGish Embeddings Block with Equivalent VGGish Blocks . 17-72

Extract GTCC from Audio in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-74

Include an Audio Plugin in Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-75


Generate Block from Plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-75
Use Generated Audio Plugin Block in Model . . . . . . . . . . . . . . . . . . . . . 17-76

Use VGGish Embeddings for Deep Learning in Simulink . . . . . . . . . . . 17-78

Real-Time Parameter Tuning


18
Real-Time Parameter Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-2
Programmatic Parameter Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-2

Tips and Tricks for Plugin Authoring


19
Tips and Tricks for Plugin Authoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-2
Avoid Disrupting the Event Queue in MATLAB . . . . . . . . . . . . . . . . . . . . 19-2
Separate Code for Features Not Supported for Plugin Generation . . . . . . 19-4
Implement Reset Correctly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-6

xii Contents
Implement Plugin Composition Correctly . . . . . . . . . . . . . . . . . . . . . . . . 19-6
Address "A set method for a non-Dependent property should not access
another property" Warning in Plugin . . . . . . . . . . . . . . . . . . . . . . . . . . 19-8
Use System Object That Does Not Support Variable-Size Signals . . . . . 19-10
Using Enumeration Parameter Mapping . . . . . . . . . . . . . . . . . . . . . . . . 19-12

Spectral Descriptors Chapter


20
Spectral Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20-2

xiii
1

Audio Toolbox Examples


Other documents randomly have
different content
And yet in me, the observer, the inquirer into things,
began to take shape almost in infancy. Why should I
not describe my first discoveries? They are
ingenuous in the extreme, but will serve
notwithstanding to tell us something of the way in
which tendencies first show themselves.

I was five or six years old. That the poor household


might have one mouth less to feed, I had been
placed in grandmother’s care. Here, in solitude, my
first gleams of intelligence were awakened amidst
the geese, the calves, and the sheep. Everything
before that is impenetrable darkness. My real birth
was at the moment when the dawn of personality
rises, dispersing the mists of unconsciousness and
leaving a lasting memory. I can see myself plainly,
clad in a soiled frieze frock flapping against my bare
heels; I remember the handkerchief hanging from my
waist by a bit of [20]string, a handkerchief often lost
and replaced by the back of my sleeve.

There I stand one day, a pensive urchin, with my


hands behind my back and my face turned to the
sun. The dazzling splendour fascinates me. I am the
Moth attracted by the light of the lamp. With what am
I enjoying the glorious radiance: with my mouth or my
eyes? That is the question put by my budding
scientific curiosity. Reader, do not smile! the future
observer is already practising and experimenting. I
open my mouth wide and close my eyes: the glory
disappears. I open my eyes and shut my mouth: the
glory reappears. I repeat the performance, with the
same result. The question’s solved: I have learnt by
deduction that I see the sun with my eyes. What a
discovery! That evening I told the whole house all
about it. Grandmother smiled fondly at my simplicity:
the others laughed at it. ’Tis the way of the world.

Another find. At nightfall, amidst the neighbouring


bushes, a sort of jingle attracted my attention,
sounding very faintly and softly through the evening
silence. Who is making that noise? Is it a little bird
chirping in his nest? We must look into the matter,
and that quickly. True, there is the wolf, who comes
out of the woods at this time, so they tell me. Let’s go
all the same, but not too far: just there, behind that
clump of broom. I stand on the look-out for long, but
all in vain. At the faintest sound of movement in the
brushwood, the jingle ceases. I try [21]again next day
and the day after. This time my stubborn watch
succeeds. Whoosh! A grab of my hand and I hold the
singer. It is not a bird; it is a kind of Grasshopper
whose hind-legs my playfellows have taught me to
relish: a poor recompense for my prolonged ambush.
The best part of the business is not the two
haunches with the shrimpy flavour, but what I have
just learnt. I now know, from personal observation,
that the Grasshopper sings. I did not publish my
discovery for fear of the same laughter that greeted
my story about the sun.

Oh, what pretty flowers, in a field close to the house!


They seem to smile to me with their great violet eyes.
Later on I see, in their place, bunches of big red
cherries. I taste them. They are not nice, and they
have no stones. What can those cherries be? At the
end of the summer, grandfather walks up with a
spade and turns my field of observation topsy-turvy.
From under ground there comes, by the basketful
and sackful, a sort of round root. I know that root; it
abounds in the house; time after time I have cooked
it in the peat-stove. It is the potato. Its violet flower
and its red fruit are pigeon-holed in my memory for
good and all.

With an ever-watchful eye for animals and plants, the


future observer, the little six-year-old monkey,
practised by himself, all unawares. He went to the
flower, he went to the insect, even as the Large
White Butterfly goes to the cabbage, and the Red
Admiral to the thistle. [22]

It would be impossible to describe more delightfully


the gradual development of tastes and aptitudes in
the dawn of life.

The same freshness of impression and the same


affinity for natural objects will be found in another
recollection of the same period: the recollection of “a
certain harmonica,” whose music to the “ear of a
child of six” sounded as sweet and strange as that of
the frog whom he heard emitting his limpid note in
the neighbourhood of the solitary farm as the last
light of evening faded from the heights. “A series of
glass slips, of unequal length, fixed upon two tightly-
stretched tapes, and a cork on the end of a wire,
which served as a striker”: such was the instrument
which some one brought the child from the latest fair.
“Imagine an untutored hand striking at random upon
this key-board, with the most riotous unexpectedness
of octaves, discords, and inverted harmonies”: such
was the chiming of the bell-ringer frogs on the
sunken lanes of Malaval. “As a song it had neither
head nor tail; but the purity of the sound was
delightful.” How much more delightful, in the first
radiance of his spontaneous childhood, this little
scrap of a fellow who was beginning to play his part
in the great concert of the world, [23]in which he was
one day to fill so notable a place and to sing a new
song to the glory of the Master of Nature! 4 [24]
1 Those journals which claim him as a native of Sérignan are therefore mistaken.
“At Sérignan (Vaucluse), his native countryside, the peasants familiarly call him
Moussu Fabré” (Univers, March 3, 1910). ↑
2 In the reminiscences of his childhood, which are intermingled with his
entomological memoirs, Fabre does not mention a single proper name, whether
of person or place; only the vague expression, “the table-land of the Rouergue,”
which he once incidentally employs, might give an attentive reader a hint as to the
place of his origin. Souvenirs, VI., p. 38; The Life of the Fly, chap. v., “Heredity.” ↑
3 These paternal grandparents, of whom our hero has retained so vivid a
recollection, bore the names of Jean-Pierre Fabre and Elisabeth Poujade.
Patient searching of the archives, assisted, fortunately, by the goodwill of M.
Toscan, registrar to the Justice of the Peace for Vezins, has enabled us to
reproduce their marriage contract, which is full of information hitherto unpublished,
and curious details of domestic life which will not fail to interest the reader:
“In the year 1791 and on the 15th day of the month of February, in the locality of
Ségur, province of Aveiron, in the presence of me, Raymond Rous, man of law
and notary royal … have been devised and concluded the following articles of
marriage between Pierre-Jean Fabre, legitimate son of Pierre Fabre, landowner
and farmer, and Anne Fages, husband and wife of the village of Malaval, on the
one part, and Elisabeth Poujade, legitimate daughter of Antoine Poujade,
landowner, and Françoise Azémar, husband and wife of the village of Mont, parish
of Notre-Dame d’Arques, on the other part—the said parties acting, namely, the
said future husband with the knowledge and consent of his father and mother here
present, and the said future wife, she being absent, but the said Poujade for her,
being here present stipulating and accepting—have in the first place promised that
the said marriage shall be solemnised before the Church at the first demand of
one of the parties, under penalty of all expenses, damages, and interests—in the
second place, the said Fabre and Fages, husband and wife, favouring and
contemplating the present marriage have given and are giving by donation,
declared between living persons, to the aforesaid their son, the future husband, all
and each of their possessions, movable and immovable, present and future, under
the clauses, conditions, and reserves hereafter following: firstly, to be fed at the
same table of the same victuals as the said donor; secondly, and in case of
incompatibility, [14]they reserve to themselves the same income as Jean Fabre
and Françoise Fabre, father and mother of the donor, reserved to themselves in
the marriage contract of the said Fabre received by M. Dufieu, notary …; thirdly, to
settle upon their other children a portion such as by law shall pertain to them out of
their possessions in money when they accept a settlement; and in case Françoise
and Anne Fabre should not desire so to do, they shall enjoy the annual pension …
of three setiers each of rye, two quarters each of oats, five pounds each of butter,
and five pounds each of cheese; the use of their usual bed, and of their spinning-
wheel; the use of their clothes-press and the small articles of furniture necessary
according to their condition; … the said Fages, the mother, reserves to herself the
sum of thirty francs to be paid once at her will to employ and dispose as she shall
see fit. In the third place, the said Poujade, the father, favouring and contemplating
the present marriage, has given and constituted as the dowry of his daughter, the
future wife, to take the place of any right to a portion which she might claim against
his goods and those of the mother aforesaid, a clothes-press with apparel valued
at a hundred livres, a heifer and a cow valued the two at eighty francs, two sheep,
and the sum of fifteen hundred livres, the said sum being made up of one hundred
and fifty livres of the maternal parent’s and the rest of the paternal parent’s
money.…
“Devised and rehearsed in the presence of the sieur Joseph Déjean, burgher of
Moulin-Savi, and the sieur André Bourles, practitioner of Ségur, signed by the
aforesaid Fabre, father and son, and the aforesaid Poujade, father, and not the
aforesaid Fages, who, being requested to sign, has stated that she is not able to
do so.…
“Forwarded by us, the notary undersigned, holder of the draft at Ségur, the 12th
April 1807.
“Rous, notary.” ↑
4 This account of the naturalist’s childhood is drawn principally from The
Souvenirs, vi., 32–45; see The Life of the Fly, chap, v., “Heredity.” ↑
[Contents]
CHAPTER III
THE SCHOOLBOY: SAINT-LÉONS
With his seventh year the time came for him to go to
school. The schoolmaster of Saint-Léons was the
child’s godfather. Everything pointed to him as the
child’s first teacher. So Jean-Henri left the ancestral
home at Malaval to return to his father’s house at
Saint-Léons and attend the local school, which was
kept by his godfather, Pierre Ricard. He could not
have done better as a start in life. Let us leave him to
paint one picture of this second phase of his life. He
begins with a description of the school:

What shall I call the room in which I was to become


acquainted with the alphabet? It would be difficult to find the
exact word, because the room served for every purpose. It
was at once a school, a kitchen, a bedroom, a dining-room,
and, at times, a chicken-house and a piggery. Palatial schools
were not dreamt of in those days; any wretched hovel was
thought good enough.

A broad fixed ladder led to the floor above. [25]Under the


ladder stood a big bed in a boarded recess. What was there
upstairs? I never quite knew. I would see the master
sometimes bring down an armful of hay for the ass,
sometimes a basket of potatoes which the housewife emptied
into the pot in which the little porker’s food was cooked. It
must have been a loft of sorts, a store-house of provisions for
man and beast. Those two apartments composed the whole
building.

To return to the lower one, the schoolroom: a window faces


south, the only window in the house, a long, narrow window
whose frame you can touch at the same time with your head
and both your shoulders. This sunny aperture is the only lively
spot in the dwelling; it overlooks the greater part of the village,
which straggles along the slopes of a tapering valley. In the
window-recess is the master’s little table.

The opposite wall contains a niche in which stands a


gleaming copper pail full of water. Here the parched children
can relieve their thirst when they please, with a cup left within
their reach. At the top of the niche are a few shelves bright
with pewter plates, dishes, and drinking-vessels, which are
taken down from their sanctuary on great occasions only.

More or less everywhere, at any spot which the light touches,


are crudely-coloured pictures, pasted on the walls. Here is
Our Lady of the Seven Dolours, the disconsolate Mother of
God, opening her blue cloak to show her heart pierced with
seven daggers. Between the sun and moon, which stare [26]at
you with their great, round eyes, is the Eternal Father, Whose
robe swells as though puffed out with the storm. To the right
of the window, in the embrasure, is the Wandering Jew. He
wears a three-cornered hat, a large, white, leather apron,
hobnailed shoes, and carries a stout stick. “Never was such a
bearded man seen before or after,” says the legend that
surrounds the picture. The draughtsman has not forgotten this
detail; the old man’s beard spreads in a snowy avalanche
over the apron and comes down to his knees. On the left is
Geneviève of Brabant, accompanied by the roe; with cruel
Golo hiding in the bushes, sword in hand. Above hangs The
Death of Mr. Credit, slain by defaulters at the door of his inn;
and so on and so on, in every variety of subject, at all the
unoccupied spots of the four walls.

I was filled with admiration of this picture-gallery, which held


one’s eyes with its great patches of red, blue, green, and
yellow. The master, however, had not set up his collection
with a view to training our minds and hearts. That was the last
and least of the worthy man’s ambitions. An artist in his
fashion, he had adorned his house according to his taste; and
we benefited by the scheme of decoration.

While the gallery of halfpenny pictures made me happy all the


year round, there was another entertainment which I found
particularly attractive in winter, in frosty weather, when the
snow lay long on the ground. Against the far wall stands the
fire-place, as monumental in size as at [27]my grandmother’s.
Its arched cornice occupies the whole width of the room, for
the enormous redoubt fulfils more than one purpose. In the
middle is the hearth, but on the right and the left are two
breast-high recesses, half wood and half stone. Each of them
is a bed, with a mattress stuffed with husks of winnowed corn.
Two sliding boards serve as shutters and close the chest if
the sleeper would be alone. This dormitory, sheltered under
the chimney breast, supplies couches for the favoured ones
of the house, the boarders. They must lie snug in them at
night, when the north wind howls at the mouth of the dark
valley and sends the snow awhirl. The rest is occupied by the
hearth and its accessories: the three-legged stools; the salt-
box, hanging against the wall to keep its contents dry; the
heavy shovel which it takes two hands to wield; lastly, the
bellows, similar to those with which I used to blow out my
cheeks in grandfather’s house. They consist of a big branch
of pine, hollowed throughout its length with a red-hot iron. By
means of this channel one’s breath is applied, from a
convenient distance, to the spot which is to be revived. With a
couple of stones for supports, the master’s bundle of sticks
and our own logs blaze and flicker, for each of us has to bring
a log of wood in the morning, if he would share in the treat.

Nevertheless, the fire was not exactly lit for us, but, most of
all, to warm a row of three pots in which simmered the pigs’
food, a mixture of potatoes and bran. That, despite the tribute
of [28]a log, was the real object of the brushwood fire. The two
boarders, on their stools, in the best places, and we others,
sitting on our heels, formed a semicircle around those big
cauldrons full to the brim and giving off little jets of steam, with
puff-puff-puffing sounds. The bolder among us, when the
master’s eyes were engaged elsewhere, would dig a knife
into a well-cooked potato and add it to their bit of bread; for I
must say that, if we did little work at my school, at least we did
a deal of eating. It was the regular custom to crack a few nuts
and nibble at a crust while writing our page or setting out our
rows of figures.

We, the smaller ones, in addition to the comfort of studying


with our mouths full, had every now and then two other
delights, which were quite as good as cracking nuts. The
back-door communicated with the yard where the hen,
surrounded by her brood of chicks, scratched at the dung-hill,
while the little porkers, of whom there were a dozen, wallowed
in their stone trough. This door would open sometimes to let
one of us out, a privilege which we abused, for the sly ones
among us were careful not to close it on returning. Forthwith
the porkers would come running in, one after the other,
attracted by the smell of the boiled potatoes. My bench, the
one where the youngsters sat, stood against the wall, under
the copper pail to which we used to go for water when the
nuts had made us thirsty, and was right in the way of the pigs.
Up they came trotting and grunting, curling their little tails;
they rubbed against our [29]legs; they poked their cold, pink
snouts into our hands in search of a scrap of crust; they
questioned us with their sharp little eyes to learn if we
happened to have a dry chestnut for them in our pockets.
When they had gone the round, some this way and some
that, they went back to the farmyard, driven away by a friendly
flick of the master’s handkerchief. Next came the visit of the
hen, bringing her velvet-coated chicks to see us. All of us
eagerly crumbled a little bread for our pretty visitors. We vied
with one another in calling them to us and tickling with our
fingers their soft and downy backs. No, there was certainly no
lack of distraction. 1

Now we know the school, with all its amenities, and


our curiosity, aroused to the highest pitch, inquires,
not without some alarm, what was taught in such a
place and in such company. After the description of
the class-room, we have the programme of studies:

Let us first speak of the young ones, of whom I was one.


Each of us had, or rather was supposed to have, in his hands
a little penny book, the alphabet, printed on grey paper. It
began, on the cover, with a pigeon or something like it. Next
came a cross, followed by the letters in their [30]order. When
we turned over, our eyes encountered the terrible ba, be, bi,
bo, bu, the stumbling-block of most of us. When we had
mastered that formidable page we were considered to know
how to read and were admitted among the big ones. But if the
little book was to be of any use, the least that was required
was that the master should interest himself in us to some
extent and show us how to set about things. For this the
worthy man, too much taken up with the big boys, had not the
time. The famous alphabet with the pigeon was thrust upon
us only to give us the air of scholars. We were to contemplate
it on our bench, to decipher it with the help of our next
neighbours, in case he might know one or two of the letters.
Our contemplation came to nothing, being every moment
disturbed by a visit to the potatoes in the stewpots, a quarrel
among playmates about a marble, the grunting invasion of the
porkers, or the arrival of the chicks. With the aid of these
diversions we would wait patiently until it was time for us to go
home. That was our most serious work.

The big ones used to write. They had the benefit of the small
amount of light in the room, by the narrow window where the
Wandering Jew and ruthless Golo faced each other, and of
the large and only table with its circle of seats. The school
supplied nothing, not even a drop of ink; every one had to
come with a full set of utensils. The ink-horn of those days, a
relic of the ancient pen-case of which Rabelais speaks, was a
long cardboard [31]box divided into two stages. The upper
compartment held the pens, made of goose-quill trimmed with
a penknife; the lower contained, in a tiny well, ink made of
soot mixed with vinegar.

The master’s great business was to mend the pens—a


delicate task, not without danger for inexperienced fingers—
and then to trace at the head of the white page a line of
strokes, single letters, or words according to the scholar’s
capabilities. When that is over, keep an eye on the work of art
which is coming to adorn the copy! With what undulating
movements of the wrist does the hand, resting on the little
finger, prepare and plan its flight! All at once the hand starts
off, flies, whirls; and lo and behold, under the line of writing is
unfurled a garland of circles, spirals, and flourishes, framing a
bird with outspread wings; the whole, if you please, in red ink,
the only kind worthy of such a pen. Large and small, we stood
awestruck in the presence of such marvels. The family, in the
evening, after supper, would pass from hand to hand the
masterpiece brought back from school:—
“What a man!” was the comment. “What a man, to draw you a
Holy Ghost with one stroke of the pen!”

What was read at my school? At most, in French, a few


selections from sacred history. Latin recurred oftener, to teach
us to sing vespers properly. The more advanced pupils tried
to decipher manuscript, a deed of sale, the hieroglyphics of
some scrivener. [32]

And history, geography? No one ever heard of them. What


difference did it make to us whether the earth was round or
square! In either case, it was just as hard to make it bring
forth anything.

And grammar? The master troubled his head very little about
that, and we still less. We should have been greatly surprised
by the novelty and the forbidding look of such words in the
grammatical jargon as substantive, indicative, and
subjunctive. Accuracy of language, whether of speech or
writing, must be learnt by practice. And none of us was
troubled by scruples in this respect. What was the use of all
these subtleties, when, on coming out of school, a lad went
back to his flock of sheep!

And arithmetic? Yes, we did a little of this, but not under that
learned name. We called it sums. To put down rows of figures,
not too long, add them and subtract them one from the other
was more or less familiar work. On Saturday evenings, to
finish up the week, there was a general orgy of sums. The top
boy stood up and, in a loud voice, recited the multiplication
table up to twelve times. I say twelve times, for, in those days,
because of our old duodecimal measures, it was the custom
to count as far as the twelve-times table, instead of the ten-
times of the metric system. When this recital was over, the
whole class, the little ones included, shouted it in chorus,
creating such an uproar that chicks and porkers took to flight
if they happened to be there. [33]And this went on to twelve
times twelve, the first in the row starting the next table and the
whole class repeating it as loud as it could yell. Of all that we
were taught in school, the multiplication table was what we
knew best, for this noisy method ended by dinning the
different numbers into our ears. This does not mean that we
became skilful reckoners. The cleverest of us easily got
muddled with the figures to be carried in a multiplication sum.
As for division, rare indeed were they who reached such
heights. In short, the moment a problem, however
insignificant, had to be solved, we had recourse to mental
gymnastics much rather than to the learned aid of arithmetic.

This account cannot be suspected of any malicious


exaggeration: the narrator is too full of sympathy for
his old master to do him anything less than justice. In
any case he bears him no grudge in respect of the
deficiencies of his teaching:

When all is said, our master was an excellent man who could
have kept school very well but for his lack of one thing: and
that was time. He devoted to us all the little leisure which his
numerous functions left him. And first of all, he managed the
property of an absentee landowner, who only occasionally set
foot in the village. He had under his care an old castle with
four towers, which had [34]become so many pigeon-houses;
he directed the getting-in of the hay, the walnuts, the apples,
and the oats. We used to help him during the summer, when
the school, which was well attended in winter, was almost
deserted. The few who remained, because they were not yet
big enough to work in the fields, were small children, including
him who was one day to set down these memorable facts.
Lessons were less dull at that time of year. They were often
given on the hay or the straw; oftener still, lesson-time was
spent in cleaning out the dovecot or stamping on the snails
that had sallied in rainy weather from their ramparts, the tall
box borders of the garden belonging to the castle.

Our master was a barber. With his light hand, which was so
clever at beautifying our copies with curlicue birds, he shaved
the notabilities of the place: the mayor, the parish priest, the
notary. Our master was a bell-ringer. A wedding or a
christening interrupted the lessons; he had to ring a peal. A
gathering storm gave us a holiday: the great bell must be
tolled to ward off the lightning and the hail. Our master was a
choir-singer. With his mighty voice he filled the church where
he led the Magnificat at vespers. Our master wound up the
village clock. This was his proudest function. Giving a glance
at the sun, to ascertain the time more or less nearly, he would
climb to the top of the steeple, open a huge cage of rafters,
and find himself in a maze of wheels and springs whereof the
secret was known to him alone.

[35]

In this picture of the schoolmaster and the school we


have lost sight for a time of our little Jean-Henri.
What becomes of him? What does he do in such a
school, under such a master? To begin with, no one
takes a greater interest in the visits of hens and
piglings, no one appreciates more keenly the delights
of school in the open air. In the meanwhile, his love
of plants and animals finds expression in all
directions, even on the cover of his penny spelling-
book:
Embellished with a crude picture of a pigeon which I study
and contemplate much more zealously than the A, B, C. Its
round eye, with its circlet of dots, seems to smile upon me. Its
wing, of which I count the feathers one by one, tells me of
flights on high, among the beautiful clouds; it carries me to the
beeches, raising their smooth trunks above a mossy carpet
studded with white mushrooms that look like eggs dropped by
some vagrant hen; it takes me to the snow-clad peaks where
the birds leave the starry print of their red feet. He is a fine
fellow, my pigeon-friend: he consoles me for the woes hidden
behind the cover of my book. Thanks to him, I sit quietly on
my bench and wait more or less till school is over.

School out of doors has other charms. When the master takes
us to kill the snails in the box borders, I do not always
scrupulously fulfil my [36]office as exterminator. My heel
sometimes hesitates before coming down upon the handful
which I have gathered. They are so pretty! Just think, there
are yellow ones and pink, white ones and brown, all with dark
spiral streaks. I fill my pockets with the handsomest so as to
feast my eyes upon them at my leisure.

On haymaking days in the master’s field, I strike up an


acquaintance with the Frog. Flayed and stuck at the end of a
split stick, he serves as live bait to tempt the Crayfish from his
retreat by the edge of the brook. On the alder-tree I catch the
Hoplia, the splendid Beetle who pales the azure of the
heavens. I pick the narcissus and learn to gather, with the tip
of my tongue, the tiny drops of honey that lie right at the
bottom of the cleft corolla. I also learn that too-long
indulgence in this quest always brings a headache; but this
discomfort in no way impairs my admiration for the glorious
white flower, which wears a narrow red collar at the throat of
its funnel. When we go to beat the walnut-trees, the barren
grass-plots provide me with Locusts, spreading their wings,
some into a blue fan, others into a red.
And thus the rustic school, even in the heart of winter,
furnished continuous food for my interest in things.

But while the love of plants and animals developed


automatically, without guide or example, in the child
predestined to entomology, [37]there was one respect
in which he did not make progress: the knowledge of
the alphabet, which was indeed neglected for the
pigeon. Consequently neither the schoolmaster nor
the spelling-book had much to do with the earliest
stage of his education. He tells us how he learned to
read, not at Master Ricard’s, but, thanks to his father,
in the school of the animals and nature:

I was still at the same stage, hopelessly behind-hand with the


intractable alphabet, when my father, by a chance inspiration,
brought me home from the town what was destined to give
me a start along the road of reading. Despite the not
insignificant part which it played in my intellectual awakening,
the purchase was by no means a ruinous one. It was a large
print, price six farthings, coloured and divided into
compartments in which animals of all sorts taught the A, B, C
by means of the first letters of their names.

I made such rapid progress that, in a few days, I was able to


turn in good earnest to the pages of my little pigeon-book,
hitherto so undecipherable. I was initiated; I knew how to
spell. My parents marvelled. I can explain this unexpected
progress to-day. Those speaking pictures, which brought me
among my friends the beasts, were in harmony with my
instincts. If the animal has not fulfilled all that it promised in so
far as I am concerned, I have at least to thank it for teaching
[38]meto read. I should have succeeded by other means, I do
not doubt, but not so quickly or pleasantly. Animals for ever!

Luck favoured me a second time. As a reward for my prowess


I was given La Fontaine’s Fables, in a popular, cheap edition,
crammed with pictures, small, I admit, and very inaccurate,
but still delightful. Here were the crow, the fox, the wolf, the
magpie, the frog, the rabbit, the ass, the dog, the cat; all
persons of my acquaintance. The glorious book was
immensely to my taste, with its skimpy illustrations in which
the animal walked and talked. As to understanding what it
said, that was another story. Never mind, my lad! Put together
syllables that say nothing to you yet; they will speak to you
later and La Fontaine will always remain your friend. 2

[39]

1 Souvenirs, VI., pp. 46–68; The Life of the Fly, chap. vi., “My Schooling.” ↑
2 Souvenirs, IV., pp. 50–60; The Life of the Fly, chap. vi., “My Schooling.” ↑

You might also like