Skip to content

Repository files navigation

🎧 Audio Processing Workflow

🧰 Tools Used

1. 📥 Reading the Audio File

  • We use librosa to load and process audio files.
  • The sample is a 4-second audio clip sampled at 22050 Hz.
  • Time-domain waveform plot:

Original Signal

mmmm.mov

2. 🔍 Voice Activity Detection (VAD) & Clipping

  • VAD detects segments with human speech.

  • Steps:

    • Normalize signal amplitude to [-1, 1]
    • Apply a threshold to filter speech vs noise
    • Clip the audio to keep only speech segments

VAD Output Plot:

VAD

  • Red: VAD mask
  • Blue: Original signal
  • Selected range: Retained for clipping

Cropped Signal Plot:

Clipped Signal

2.vad_croped.mov

3. 📈 Pre-Emphasis

  • Enhances high frequencies before analysis.

  • Helps:

    1. Balance spectrum
    2. Avoid numerical issues in FFT
    3. Improve SNR

Filter Equation:

$$ y(t) = x(t) - \alpha x(t-1),\quad \alpha = 0.97 $$

Plot after Pre-emphasis:

Pre-emphasis

3.preempha.mov

4. 🧩 Splitting the Audio

  • Audio is split into 10ms frames using a sliding window.

Frame Sequence Visualization:

Frames

Single Frame Example:

Single Frame

5. 🪟 Hann Window Function

  • Reduces spectral leakage by smoothing frame edges.

Window Function:

$$ w(n) = 0.5 \left(1 - \cos\left({2\pi nN}\right)\right),\quad 0 \leq n \leq N $$

Windowed Frame Sequence:

Windowed Frames

Windowed Single Frame:

Windowed Frame

6. 🔄 Time → Frequency Domain (FFT)

  • We apply Fast Fourier Transform (FFT) to convert from time to frequency domain.

Time Domain:

Time

Frequency Domain:

Frequency

7. 🌈 Spectrogram

  • A spectrogram displays how frequency content changes over time.

Axes:

  • X-axis: Time
  • Y-axis: Frequency
  • Color: Amplitude (Power in dB)

Spectrogram:

Spectrogram

8. 🔍 MFCC Feature Extraction

  • MFCCs capture perceptual characteristics of audio relevant to human hearing.

  • Widely used in speech recognition.

  • Frequency perception is:

    • Linear < 1kHz
    • Logarithmic > 1kHz

Axes:

  • X-axis: Time
  • Y-axis: MFCC coefficients (12 in our case)

MFCC Plot:

MFCC

9. 🔄 Reconstructing Audio from MFCC

  • Audio can be partially reconstructed from MFCCs with acceptable quality loss.

4.reconstructed.mov

📜 License

MIT License © 2025-PRESENT wudi

About

Audio Processing Workflow

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages