Practical Audio DSP Projects with the ESP32.pdf

(7699 KB) Pobierz
books
books
Practical
Audio DSP Projects
with the ESP32
Easy and Affordable Digital Signal Processing
ON STAGE
ESP32 DevKitC
/DAC
Pmod I2S2 ADC
Ts
FIR, IIR, & the FF
ion
in configurat
microphone p
// I 2S
//
pin_MIC()
void i2s_set
{
pin_config =
pin_config_t
const i2s_
{
2S_SCK_MIC,
k_io_num = I
.bc
I2S_WS_MIC,
.ws_io_num =
NO_CHANGE,
m = I2S_PIN_
.data_out_nu
= I2S_SD_MIC
.data_in_num
};
&pin_config);
n(
I2S_PORT0
,
i2s_set_pi
}
// No output
m
// Input fro
Dogan Ibrahim
Ahmet Ibrahim
Practical Audio DSP Projects
with the ESP32
Easy and Affordable Digital Signal Processing
Dogan Ibrahim
Ahmet Ibrahim
Elektor International Media B.V.
Phone: +31 46 4389444
This is an Elektor Publication. Elektor is the media brand of
All rights reserved. No part of this book may be reproduced in any material form, including photocopying, or
Ltd., 90 Tottenham Court Road, London, England W1P 9HE. Applications for the copyright holder's permission to
reproduce any part of the publication should be addressed to the publishers.
PO Box 11, NL-6114-ZG Susteren, The Netherlands
storing in any medium by electronic means and whether or not transiently or incidentally to some other use of this
publication, without the written permission of the copyright holder except in accordance with the provisions of the
Copyright Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licencing Agency
Declaration
The author, editor, and publisher have used their best efforts in ensuring the correctness of the information contained
in this book. They do not assume, and hereby disclaim, any liability to any party for any loss or damage caused by
errors or omissions in this book, whether such errors or omissions result from negligence, accident or any other cause.
All the programs given in the book are Copyright of the Author and Elektor International Media. These programs
may only be used for educational purposes. Written permission from the Author or Elektor must be obtained before
any of these programs can be used for commercial purposes.
British Library Cataloguing in Publication Data
ISBN 978-3-89576-567-4
Editor: Jan Buiting
Print
eBook
ISBN 978-3-89576-568-1
A catalogue record for this book is available from the British Library
© Copyright 2023: Elektor International Media B.V.
Prepress Production: D-Vision, Julian van den Berg
Elektor is the world's leading source of essential technical information and electronics products for pro engineers,
electronics designers, and the companies seeking to engage them. Each day, our international team develops and delivers
high-quality content - via a variety of media channels (including magazines, video, digital media, and social media) in
several languages - relating to electronics design and DIY electronics.
www.elektormagazine.com
4
Contents
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 1 • The ESP32 Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.2 The ESP32 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2.1 The CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.2.2 Internal memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.3 External memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.4 General purpose timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.5 Watchdog timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.6 The system clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.7 Real-time clock (RTC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.8 General purpose input-outputs (GPIOs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.9 Analog to digital converter (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.10 Digital to analog converter (DAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.11 Hall sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.12 Built-in temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.13 Touch sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.14 UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2 15 I
2
C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.16 I
2
S interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.17 Infrared controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.18 Pulse width modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.2.19 LED PWM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.2.20 Pulse counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.2.21 SPI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.2.22 Hardware accelerators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.2.23 Wi-Fi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.2.24 Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.2.25 Controller area network (CAN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.2.26 SD card support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5
Zgłoś jeśli naruszono regulamin