Hack Audio
eBook - ePub

Hack Audio

An Introduction to Computer Programming and Digital Signal Processing in MATLAB

Eric Tarr

Share book
  1. 458 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hack Audio

An Introduction to Computer Programming and Digital Signal Processing in MATLAB

Eric Tarr

Book details
Book preview
Table of contents
Citations

About This Book

Computers are at the center of almost everything related to audio. Whether for synthesis in music production, recording in the studio, or mixing in live sound, the computer plays an essential part. Audio effects plug-ins and virtual instruments are implemented as software computer code. Music apps are computer programs run on a mobile device. All these tools are created by programming a computer.

Hack Audio: An Introduction to Computer Programming and Digital Signal Processing in MATLAB provides an introduction for musicians and audio engineers interested in computer programming. It is intended for a range of readers including those with years of programming experience and those ready to write their first line of code. In the book, computer programming is used to create audio effects using digital signal processing. By the end of the book, readers implement the following effects: signal gain change, digital summing, tremolo, auto-pan, mid/side processing, stereo widening, distortion, echo, filtering, equalization, multi-band processing, vibrato, chorus, flanger, phaser, pitch shifter, auto-wah, convolution and algorithmic reverb, vocoder, transient designer, compressor, expander, and de-esser.

Throughout the book, several types of test signals are synthesized, including: sine wave, square wave, sawtooth wave, triangle wave, impulse train, white noise, and pink noise. Common visualizations for signals and audio effects are created including: waveform, characteristic curve, goniometer, impulse response, step response, frequency spectrum, and spectrogram. In total, over 200 examples are provided with completed code demonstrations.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Hack Audio an online PDF/ePUB?
Yes, you can access Hack Audio by Eric Tarr in PDF and/or ePUB format, as well as other popular books in Technology & Engineering & Acoustical Engineering. We have over one million books available in our catalogue for you to explore.

Information

Chapter 1

Introduction

1.1 Introduction: Computer Programming and Digital Signal Processing

Computers are powerful tools for recording, analyzing, visualizing, and processing digital audio. Programming a computer allows for the robust control of audio signals and the creation of software for specialized tasks. Digital signal processing (DSP) is an extensive field of mathematical methods with many applications to process digital audio signals. Together, computer programming and DSP provide a framework for accomplishing many audio-related tasks.

1.2 The Purpose of This Book

The purpose of this book is to provide an introduction for audio engineers to computer programming and digital signal processing. These topics are presented generally, and also demonstrated using the MATLABĀ® programming language. Furthermore, many pertinent features of the MATLAB Signal Processing ToolboxTM are covered.
The content of the book is intended to supplement a more general introduction to programming by an undergraduate computer science course and introduction to DSP by an undergraduate electrical engineering course. However, topics are presented for readers with little or no experience with computer programming or DSP. Therefore, this book can be used as a precursor for more general study. Additionally, the material in this book is intended to provide a foundation for advanced study specifically in audio engineering.

1.3 Intended Readers

This book is intended for students who would like to learn about computer programming through the use of examples and applications in audio. A mathematical foundation at the level of college algebra and trigonometry is expected. Consequently, audio signal processing can be an intuitive context to practically apply mathematical theory. It is not necessary to have previous knowledge of calculus because all processing is performed with digital signals. Additionally, it is helpful to have a foundation in the physics of sound. Necessary topics include a foundational understanding of signals, vibration, amplitude, frequency, and sampling.
Additionally, this text is intended for practicing engineers needing a handbook to reference with a wide range of implemented examples and detailed background explanations.

1.4 Topics Covered

The following is a list of topics covered in the book. An introduction to programming using the MATLAB language is presented in Chapter 2. The basics of working with audio signals are discussed in Chapter 3, along with common methods to visualize audio. An overview of the MATLAB programming environment is provided in Chapter 4. The programming constructs of several control structures are presented in Chapter 5. In Chapter 6, the basics of amplitude processing are discussed, including gain scaling and DC offset. The synthesis of common audio test signals is covered in Chapter 7. From there, the topics pivot to applying computer programming to perform DSP algorithms. Chapter 8 presents digital summing, signal fades, and amplitude modulation. Chapters 9 and 10 cover stereo audio and nonlinear distortion effects, respectively. Chapters 11, 12, and 13 introduce systems with delay processing to create echo effects and spectral effects. Circular buffers and fractional delay are covered in Chapter 14. Modulated delay effects are demonstrated in Chapter 15, and these modulation effects are used as the building blocks to create algorithmic reverberation in Chapter 16. Finally, effects based on a signalā€™s amplitude envelope are covered in Chapter 17 and become the foundation of dynamic range effects in Chapter 18.
The topics are organized sequentially based on requisite computer programming knowledge and by increasing complexity for signal processing. However, the presentation of material is intended to allow for topical study for readers with prior computer programming and signal processing experience.

1.5 Additional Content

To supplement the material in the book, there is Additional Content available at the Hack Audio website (www.hackaudio.com). Readers can access MATLAB scripts, functions, and sound files that accompany various examples. It is highly recommended that students use the Additional Content to follow along with the content of the book.

Chapter 2

Basics of Programming in MATLABĀ®

2.1 Introduction: Computer Programming in MATLAB

Computers can be used for calculations, analysis, visualization, and processing. These are all important tasks when working with audio. In order to program a computer to complete all these tasks with audio information, it is important to understand how a computer performs these tasks with more general types of information. This chapter introduces necessary programming concepts in preparation for working with audio in Chapter 3.

2.2 Programming Languages

A programming language is a vocabulary or a set of instructions a computer can interpret. Computers can interpret many different programming languages. Despite their differences, many languages have similar constructs. As an analogy, there are many spoken languages that use the same conceptual constructs (nouns, verbs, punctuation, etc.), yet might incorporate the constructs differently. The rules for what is allowed in a language is called syntax.
Different programming languages have various advantages and disadvantages. Some languages allow for advanced control of the computer, but are complex. Other languages are simpler, but have less control. MATLAB is a programming language specialized for scientific computing that makes many mathematical and engineering tasks intuitive while maintaining advanced control of the computer. It is used in a diverse range of fields including statistics, finance, biomedical engineering, computer vision, wireless communication, robotics, and economics. More specifically for audio, MATLAB is a common language for DSP.
Examples of other general-purpose programming languages are C/C++, Java, HTML, Python, Fortran, Visual Basic, Swift, Objective-C, assembly, and machine code. Comp...

Table of contents