jingpeng / AudioProcessing-toolbox

calculate the audio finger printer,short-time energy,specgram,landmark,zcr,etc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AudioProcessing

An toolbox for audio processing in Matlab,the verison of Matlab is R2016a.
The audio sample in this toobox is 8000Hz, 16 bits.

extractAudioFingerpriner

extract audio fingerprinter by calcuating the difference of the energy of each frequency sub-band Extraction process

  1. divide audio into frames, the overlap length is alterable
  2. do fft for each frame
  3. divide frequency spectrum into 32 frequency sub bands
  4. calcuate the energy of each sub band
  5. calcuate audio fingerprinter as follow
    Bit Derviation

The result is shown below printer

getZCR

calcuate the zero-crossing which can be used to predict the frequency roughly

  1. divide audio into frames
  2. calcuate zcr of each frame using the following equation

ZCR

where sgn(x) is given by

sgn(x)

The result is shown below.

zcrpic

getLocalMaximum

This function is to get few maximuns in local matrix in a given matrix

getLandmarks

calcuate the enegry max points(also called landmark) in frequency spectrum

  1. divide audio into frames, the overlap length is alterable
  2. do fft for each frame
  3. calcuate the energy of frequency
  4. calcuate the local maximum as landmark The result is shown below landmark-2d landmark-3d

getEnergy

calcuate the short-time energy
1.divide audio into frames, the overlap length is alterable
2.calcuate the energy using the following equation:
stenergy

The result is shown below
getEnrgy

getSpecgram

Implementation of matlab function Specgram()

  1. divide signal into frames in time domain
  2. do fft of each frame
    specgram

getLMSPredictor

LMS where a = b = 0.953125
r0 = r1 = 0
COR0 = COR1 =0
VAR0 = VAR1 = 1
The update procedure is shown below:
K1(n) = bCOR0(n-1)/VAR0(n-1);
K2(n) = b
COR1(n-1)/VAR1(n-1);
Xest(n) = K1(n)r0(n-1) + K2(n)r1(n-1);
e0(n) = Xrec(n);
e1(n) = e0(n) - K1(n)r0(n-1);
VAR0(n) = u
VAR0(n-1) + 0.5
[r0(n-1)^2+e0(n)^2];
COR0(n) = u
COR0(n-1) + r0(n-1)e0(n);
VAR1(n) = u
VAR1(n-1) + 0.5*[r1(n-1)^2+e1(n)^2];
COR1(n) = u*COR1(n-1) + r1(n-1)e1(n);
r1(n) = a
(r0(n-1)-K1(n)e0(n));
r0(n) = a
e0(n);
Xerr(n) = Xrec(n) - Xest(n);
The function returns the estimate value Xest and the setimate error Xerr

About

calculate the audio finger printer,short-time energy,specgram,landmark,zcr,etc

License:MIT License


Languages

Language:MATLAB 100.0%