Giter Site home page Giter Site logo

tatsu1020 / audio_feature_extraction Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.26 MB

This repository contains implementations of audio feature extractions inlcluding spectrogram, mel-scale spectrogram, mel-frequency cepstrum coefficients (MFCC) with numpy.

Python 100.00%

audio_feature_extraction's Introduction

Audio Feature Extraction

This repository contains implementations of audio feature extractions including spectrogram, mel-scale spectroram, mel-frequency cepstrum coefficients (MFCC) with numpy. Although these audio data preprocessing implementation are provided by many libraries, I wrote a code from scratch to enhance the theoritical understanding.

Audio Samples

In this work, three audio samples taken from YouTube are used. The audio is a speech from the U.S. president Joe Biden, EU commision president Ursula von der Leyen, and Swedish young activist Greta Thunberg.

Each audio signal looks like below.

Joe Biden

Biden

Ursula von der Leyen

Leyen

Greta Thunberg

Greta

Features

Spectrogram

The spectrogram is a time-frequency domain speech features. The spectorgram contains time, frequency and amplitude information of an audio signal.
Extracted spectrogram looks like below.

Biden

Biden

Ursula von der Leyen

Leyen

Greta Thunberg

Greta

Mel-scale Spectrogram

The mel-scale spectrogram is a spectrogram in mel-scale (imitation of human auditory perception scale). Each spectrum is wrapped with mel-scale filter banks. As a result, the dimension is significantly reduced.

MFCC

MFCC is the features containing the spectrum contor over time. As it is onle spectrum envelope, the dimension is more reduced compared to mel-scale spectrogram.

How to extract features

Requirement

You need to have numpy and scipy installed at your environment.

Run the following command inside of the directory

python feature_extraction --audio_dir audio_samples --feature_type "spectrogram"

You can specify the direcotry cotaining audio files with audio_dir. feawture_type is a type offeature to be extracted from audio files.

Outputs

The image of signals and spectrograms are saved under the plots direcotry. If you run the above command, you will get the dimension of the specified feature.

audio_feature_extraction's People

Contributors

tatsu1020 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.