Analysis of Popping Popcorn Audio File

Application of Big Data Techniques

Dr Robert Batzinger
Instructor Emeritus

2022-08-15

Audio processing workshop:

Analysis of popping corn audioclips

as an exercise in Big Data analysis

CS424 - Big Data

Friday, 8 September 2023

13:30 - 15:00

:::

ANALYSIS OF AUDIO FILES

  • Amplitude
  • Sampling rate
  • Tracks

Audo sampling rate:

Sound waves

Fast Fourier Transform



# Audio files as a data vector

* Audio recordings can be multitrack
* Typically recorded at 44-1000 KHz  

## Reading audio files

# TuneR library

<small>

* Process audio files:
   * generate or read/write audio filessome data: such as `sine`
   * read or write audio files: (such as `readWave`, `writeWave`)
   * represent or construct channelled Wave files: (such as `Wave`, `WaveMC`)
   * transform Wave objects (`bind`, `channel`, `downsample`, `extractWave`, `mono`, `stereo`)
   * play Wave objects (`play`)
   
* Analysing signals
   * calculate periodograms of a signal (`periodogram`, `Wspec`)
   * estimate the fundamental frequencies (`FF`, `FFpure`)

* Convert sound to music
   * derive the corresponding notes and melody (`noteFromFF`, `melodyplot`)
   * quantization and plot corresponding music (`quantize`,`quantplot`)
   * create sheet music `lilyinput`

</small>

::: {.cell}

:::

## Loading a sound clip as a data vector

<small>


::: {.cell}
::: {.cell-output .cell-output-stdout}

Wave Object Number of Samples: 2425500 Duration (seconds): 55 Samplingrate (Hertz): 44100 Channels (Mono/Stereo): Stereo PCM (integer format): TRUE Bit (8/16/24/32/64): 24

Summary statistics for channel(s):

      Min. 1st Qu. Median      Mean 3rd Qu.    Max.

left -4843869 -14542 0 -8.73294 15368 4625660 right -4183111 -17246 0 -24.29296 17544 4820805 ``` ::: :::

Visualizing the sound clip

Seewave

  • sound wave analysis, manipulation, display, editing and synthesis
  • processes oscillograms, spectral content, frequency coherence, dominant frequency, analytic signal, 2D and 3D spectrograms.
  • resonance quality factor, entropy, cross correlation and autocorrelation, zero-crossing,
  • Homepage: homepage

Analysis of popping corn audio file

  • Download the sound file from Freesound

Popping popcorn

Run a spectro analysis

Filter out the relevant frequencies

Check the amplitude of the filtered sound clip

Analyze the pop of a typical kernel pop

Rectified wave form

Smoothed rectified wave form

Select a threshold for the pop indicator

Create a database of all pops

Area

Set threshold for kernel popping

Show popping behavior

Count the pops

There are 243 popped kernels of corn.

Classify the pops

Fit a surge function to model the pops per second

\[(pop/sec) = \frac{A \cdot t^C}{e^{Bt}}\] \[ \log \left(\frac{pops}{sec}\right) = \log(A)+ C \log(t) - B t\]

Modelling

Determine the mean absolute deviation (MAD) of the prediction.

\[MAD = \sum_{i=1}^n \frac{|\hat y_i - y_i|}{n}\]

  • \(MAD_A =\) 4.7673064

  • \(MAD_B =\) 3.0490908

  • \(MAD_C =\) 2.4443408

Predict the popping cycle of a pot with 2000 kernels of corn given the same conditions.

Document the experimental results

  • Title: A descriptive name for this research
  • Abstract: A synopsis of the work and outcome
  • Introducti`on: What prompted this work? What do we intend to discover?
  • Methodology W:hat research methodology will we use?
  • Results: What did we find out?
  • Discussion: What do the findings suggest?
  • References: What citations and related work are there?

Bibliography

Possible Class Projects

  • Effect of butter and different vegetable oils on popping behavior at a given power setting
  • Effect of power settings on popping behavior
  • Comparison of the popping behavior of different brands of popcorn
  • Correlation of popcorn flavor and texture at different stages of the popping cycle
  • Identification of the optimal conditions for popping popcorn