Time and Frequency Domains¶
Most of the analysis tools in Acoustica are related to the time and frequency content of the recorded audio. The chapter Working with Digital Audio describes how sound is captured and converted to a series of samples. We call this the time domain, since each sample is part of a time series that represents the audio signal. Our perception of audio, however, is more like a combination of tones with different pitches and timbres along with noise. Spectrum analysis allows us to present audio in a different way and the signal is represented as sum of frequency components which is called the frequency domain.
All natural sounds can be described as an infinite sum of sine waves. The frequency of a sine wave is related to what we sense as pitch. Our ears are not able to hear frequencies above 20 kHz (a sine wave with 20 thousand completed wavelengths within one second), so the mentioned infinite sum turns into a finite sum which is possible to handle on a computer. The signal in the frequency domain is represented through the weight of each sine wave needed to recreate the signal, rather than the sampled values from the time series. These weights can be visualized in Acoustica using the Spectrum analysis tool or the real-time Spectrum Analyzer. The mathematical tool that converts a time series to the frequency domain is called the Fourier transform (the computer optimized version thereof is called Fast Fourier Transform or FFT).
Combining Time and Frequency¶
Now we have a tool for examining the frequency content (the spectrum) of our recording and we have the normal wave plot visualization for examining how our recording evolves over time. Is there a possibility to combine these features, in order to study how the frequency content evolves over time? Actually, Acoustica features two ways of displaying so called time-frequency plots: the spectrogram and the wavelet transform (based on the Morlet class of wavelets for the advanced reader).
Spectrogram analysis¶
The spectrogram is created by creating spectra of slices of audio at regular intervals and creating a two dimensional intensity map with the time on the horizontal and frequency on the vertical axis as depicted below:

Spectrogram analysis of three whistled notes.
The length of each slice of audio determines the frequency and time resolution. Time slices with a longer duration result in a better frequency resolution, but the time resolution gets poorer.
Analysis Windows¶
Some care is required when analyzing time slices as described above due to the fact that the Fourier transform is cyclic by nature and considers each time slice as an infinitely repeating sequence. To avoid discontinuities between the start and end of the time slices we apply an analysis window. There are several different analysis windows available in the literature. Acoustica uses a Dolph Chebyshev window that is well suited because the noise caused by the edge discontinuities can be reduced to a user specified level. The downside is that the frequency resolution decreases as the attenuation increases.
Wavelet Analysis¶
The wavelet analysis is similar to the spectrogram, but the duration of each time slice depends on the frequency so that higher frequencies get a better time resolution (at the cost of a poorer frequency resolution).

Wavelet analysis of three whistled notes. Notice the better time resolution at higher frequencies.