Table of Contents
Chapter 1: Introduction
1.1 | Time, time series, signals, and time-frequency analyses
Time is an immutable force that governs nearly every aspect of our lives, from perceiving the world around us to scheduling work meetings to the inevitable process of aging. Most events are defined at least partly by their changes over time or durations in time. Thus, characterizing, quantifying, and interpreting how events in the world change over time is fundamental to many aspects of science and engineering.
This book concerns the analysis of time series data. "Time series data" simply means any measurement that changes in amplitude over time. Examples include music, speech, EEG (electroencephalogram; brain electrical activity), radio waves, bat echolocations, bird calls, etc.
The terms "time series" and "signal" are often used inter-changeably. In this book, a clear distinction will be made. A "time series" is simply a collection of numbers that is sampled at regular intervals (e.g., once each millisecond, or one thousand times per second) and that changes over time. The "signal," on the other hand, is a component of the time series that contains the information that should be isolated. That is, a time series can contain only signal, it can contain signal plus noise (and thus, one of the goals of the analysis is to separate the signal from the noise), or it can contain only noise. In the simulated time series data in this book, the signal and noise are created independently and then combined to arrive at the time series. In real (empirically obtained) time series data, it is often more difficult to separate the signal from the noise.
Many time series analyses involve representing the time series as a combination of sine waves or sine-wave-like templates. This is called a Fourier-based or frequency-based approach. In many time series, the characteristics change over time; for such data, a time-frequency approach is appropriate.
1.2 | This book
This book takes a practical and implementation-based approach to learning time-frequency analyses. Mathematical proofs and equations are avoided when possible, and theoretical discussions involving continuous signals are kept to a minimum. Instead, the book focuses on how to implement analysis algorithms in programming code. The idea is to gain an intuitive understanding of time-frequency-based analyses of discrete, sampled time series data, by implementing those analyses in computer code. In other words, learning by doing.
There are many analyses that can be applied to time series data, and this book does not cover all of them. Indeed, even the 770-page tome Time-Frequency Analysis by Boualem Boashash (2003) cannot cover all of the possible time-frequency-based analyses, parameters, and implementation details. However, by going through this book you will be well prepared to learn and implement methods that are not covered here. Indeed, the Fourier transform and its inverse, convolution, wavelets, and stationarity are fundamental concepts that form the foundation of nearly all time-frequency-based data analysis methods.
This book is not a manual for a toolbox. Rather than describing functions that you can simply call to produce a result and a figure, the focus is on understanding the analysis methods and data transformations. You can use this book to design custom-written code to perform time-frequency analyses, or you can use this book to help understand what is happening "under the hood" when you use functions from other toolboxes or point-and-click options in graphical-user-based software packages.
This book is also not an "idiot's guide" to time-frequency analysis. Understanding the concepts and programming implementations in this book may require some effort, particularly if you do not have a strong background in math or programming. That said, the book is designed for new-comers to time series analysis, and starts with basic foundations before building up to more complex analyses. Almost anyone with some patience and perseverance should be able to understand all of the material in this book and accurately complete all of the exercises at the end of the chapters.
Readers interested in deeper mathematical explanations of the algorithms and how to extend them can consider the Boashash 2003 book mentioned above, and the book Time Frequency Analysis: Theory and Applications (Prentice Hall) by Leon Cohen (unrelated to the author of this book). Readers interested in the use of time-frequency analyses for brain electrical time series data can consider the book Analyzing Neural Time Series: Theory and Practice (MIT Press, 2014).
1.3 | eBook
Why publish this book as an eBook? Many excellent academic books are expensive, sometimes prohibitively so, usually costing over $100 and occasionally up to nearly $400. An electronic-only book helps keep costs down so it can be affordable and easily purchased from anywhere in the world with stable electricity and internet access. Traditional books are published with paper and inkexpensive and limited resources, and not without environmental impact. This eBook can be viewed on any computer, Amazon Kindle, ipad, smartphone, or any other e-reading device that supports a Kindle reading app.
On the other hand, formatting an eBook is a challenge for a book like this, precisely because there are no traditional pages. Page widths and formats depend on the reading device, different reading devices have different fonts installed, many devices do not have color, and the user (that is, you) can select the font size. This necessarily means that some visual aesthetics must be sacrificed. Thus, the visual formatting of this book may be less polished than that of a traditional book, but this must be balanced against the increased flexibility and decreased publication costs.
For the same reason, the figures in this book are intentionally kept at a somewhat low resolution, and in grayscale. This is done to decrease file size and thus keep both download/loading times and costs down, and also to ensure viewability on non-color reading devices.
However, as explained below, nearly all of the figures in this book can be reproduced on your computer. This will generate high resolution color images that can be inspected much more carefully and in much greater depth than even a paper book with high-quality glossy pages.
1.4 | Intended audience and background knowledge
This book is intended for individuals who want to learn about frequency and time-frequency analyses of time series data. It may be most helpful for students taking courses in signal processing, computer science, and engineering, but will also be useful for anyone interested in learning about how to characterize and interpret time-varying multidimensional changes in the complex signals that surround them.
There is no strict prerequisite knowledge that is necessary for this book. Some background in signal processing or mathematics will be useful but not necessary. Some familiarity with basic trigonometry (e.g., the Pythagorean theorem, calculating angles on a right-side triangle, plotting a complex number on the complex plane) will also be useful.
Programming is perhaps the most important background knowledge. Although the code in this book is not very advanced, understanding much of the book relies on being able to look at and interpret basic Matlab code. Readers with no programming experience may benefit from first going through some Matlab introductory programming resources.