Analytics & ML · Study deck

Audio Feature Extraction for IoT

Picture a small device that must tell a knock from fan noise.

Data Dora is your guide for this deck.

modelingaudio
Data Dora, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: Window choice is a measurement trade, not decoration: a speech-envelope model often accepts the wider lobe, whereas a narrow machine-fault tone may require a longer frame or a different window.
  • Explain: The filter therefore suppresses slow/common components relative to rapid changes, partly flattening the downward spectral tilt common in voiced speech and improving numeric use of the later spectrum.
  • Explain: A device has produced messy evidence, an analytic step is about to change an alert or control decision, and someone has to explain why the result should be trusted.
iotclass.org

Major section

Start With the Story

More sound can help a model, but it can also cost power and expose speech.

  • Smaller records save space, yet they may lose a clue the task needs.
  • The worked feature path later in the chapter provides that detail.
  • A device has produced messy evidence, an analytic step is about to change an alert or control decision, and someone has to explain why the result should be trusted.
iotclass.org

Major section

Short-Time Audio Features

That reduction can support minimisation, but it is not automatically anonymous.

  • This advances the running narrative: retain raw clips only under an explicit need, consent, access, and deletion rule, and version the exact feature recipe used after deletion.
MFCC feature extraction pipeline from audio input to compact feature output
MFCC feature extraction pipeline from audio input to compact feature output
iotclass.org

Major section

Phoebe's Field Notes: Why 16 kHz Audio Cannot Hear An 18-22 kHz Tone Honestly

The mathematical gist.: At 16 kHz, Nyquist limits honest input to 8 kHz.

  • The chapter's 25 ms frame therefore holds 400 samples, its 10 ms hop holds 160, and the stated schedule produces 98 frames per second.

Numbers to remember

8 kHzNyquist limits honest input to 8 kHz.
25 msThe chapter's 25 ms frame therefore holds 400 samples
10 msits 10 ms hop holds 160
iotclass.org

Major section

MFCC Feature Record

Pre-emphasis and window changes the shape of the frame without changing its size, which is why leakage and spectral tilt are corrected here and nowhere later.

  • Those 13 are the model's entire view of 25 milliseconds of sound.
  • And as the closing panel insists, that compression is minimisation, not anonymity.

Why it matters

The second card is the practical consequence: a record that names only "MFCC" cannot be reproduced, because the FFT length, the mel filter count, and whether coefficient zero was kept all change the numbers without changing the name.

The frame loses 97% of its numbers before the model ever sees it.
The frame loses 97% of its numbers before the model ever sees it.
iotclass.org

Major section

MFCC Feature Record (continued)

Speech and many mechanical sounds are not stationary over a whole recording.

  • At DC, the gain is $|1-\alpha|$; at the Nyquist frequency it is $|1+\alpha|$.
  • With $\alpha=0.97$, those gains are 0.03 and 1.97 respectively.
  • Libraries also use $1/N^2$, one-sided energy doubling, or window-energy normalization.
iotclass.org

Major section

MFCC Feature Record (continued)

The filter therefore suppresses slow/common components relative to rapid changes, partly flattening the downward spectral tilt common in voiced speech and improving numeric use of the later spectrum.

  • At 16 kHz, a 25 ms frame has $N=400$ samples and a 10 ms hop has $R=160$, so adjacent frames overlap by 240 samples, or 60%.
  • That taper reduces sidelobes and therefore spectral leakage, at the cost of a wider main lobe and reduced ability to separate very close tones.
  • Three formulas have now been introduced, and each of them does something to the signal that a plot makes obvious in a second.
iotclass.org

Major section

MFCC Feature Record (continued)

Window choice is a measurement trade, not decoration: a speech-envelope model often accepts the wider lobe, whereas a narrow machine-fault tone may require a longer frame or a different window.

  • Those conventions change feature magnitudes even when the waveform is identical, so record the FFT length, one- or two-sided spectrum, and normalization rule with the model.
  • Retaining the lower-order $c_{i,r}$ coefficients gives the compact MFCC record; higher orders mostly describe finer variations across the filter-bank envelope.
  • A model trained with 40 filters, one normalization rule, and 13 retained coefficients cannot safely consume features produced by an undocumented “equivalent” pipeline.
iotclass.org

Major section

FFT And MFCC Parameter Explorer

An FFT size is an evidence choice, not a quality slider.

  • At sample rate $f_s$, an $N$-sample frame spans $N/f_s$ seconds and its bin spacing is $f_s/N$.
  • A window reduces edge discontinuities at the cost of widening the response around a tone.
  • The final row is a small leakage probe, not a specification for a window: it evaluates the selected tone at the nearest bin and its two neighbors.

Why it matters

Overlap reduces the hop between decisions and increases compute; it does not create new independent samples.

iotclass.org

Deck summary

Key takeaways

More sound can help a model, but it can also cost power and expose speech.

  • That reduction can support minimisation, but it is not automatically anonymous.
  • The mathematical gist.: At 16 kHz, Nyquist limits honest input to 8 kHz.
  • Pre-emphasis and window changes the shape of the frame without changing its size, which is why leakage and spectral tilt are corrected here and nowhere later.
  • Speech and many mechanical sounds are not stationary over a whole recording.
iotclass.org

Retrieval practice

Recall check 1 of 3

Data Dora says: answer from memory, then check your reasoning.

Q1Why should an IoT audio classifier record its frame size and hop size with the model evidence?

ABecause the frame and hop define how raw samples become feature records
BBecause audio features are independent of the waveform sampling process.
CBecause hop size sets the stored feature count used to allocate the model's input buffer.
DBecause the frame settings let MFCC extraction separate background noise from the target sound.
Show answer

Answer: A Frame and hop parameters are part of the evidence boundary for audio feature extraction.

iotclass.org

Retrieval practice

Recall check 2 of 3

Data Dora says: answer from memory, then check your reasoning.

Q2A 16 kHz audio pipeline uses 25 ms frames and a 10 ms hop. How many samples are in each frame, and how many samples does the window advance each hop?

A400 samples per frame, advancing 160 samples per hop.
B160 samples per frame, advancing 400 samples per hop.
C25 samples per frame, advancing 10 samples per hop.
D16,000 samples per frame, advancing 16,000 samples per hop.
Show answer

Answer: A Feature records should preserve the arithmetic that maps raw samples to model inputs.

iotclass.org

Retrieval practice

Recall check 3 of 3

Data Dora says: answer from memory, then check your reasoning.

Q3An MFCC extractor places filter centers at equal intervals on the mel scale between 0 and 8 kHz. Which account of the resulting filterbank and MFCC handoff is correct?

AThe centers are closer together in hertz at low frequency and farther apart at high frequency; each triangle sums weighted power, then log compression precedes the DCT.
BThe centers remain equally spaced in hertz; the DCT is applied to FFT phase before the triangular filters calculate power.
CThe centers spread farther apart at low frequency and crowd together at high frequency; taking the logarithm reconstructs the discarded FFT phase.
DEach triangle keeps one FFT bin unchanged, so changing the mel-filter count cannot change the coefficients if the DCT retains 13 outputs.
Show answer

Answer: A MFCC reasoning follows the full sequence: unequal hertz spacing from equal mel points, triangular power sums, logarithm, then the cosine transform.

iotclass.org

Print reference

Answers

Answer key.

  1. A · Frame and hop parameters are part of the evidence boundary for audio feature extraction.
  2. A · Feature records should preserve the arithmetic that maps raw samples to model inputs.
  3. A · MFCC reasoning follows the full sequence: unequal hertz spacing from equal mel points, triangular power sums, logarithm, then the cosine transform.
iotclass.org