09.02.2013 Views

ITB Journal - Institute of Technology Blanchardstown

ITB Journal - Institute of Technology Blanchardstown

ITB Journal - Institute of Technology Blanchardstown

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ITB</strong> <strong>Journal</strong><br />

w[n] = 0.54 – 0.46 cos ( 2∏n)<br />

_____<br />

N – 1<br />

where N is the length <strong>of</strong> the frame<br />

Java<br />

Power Spectrum<br />

double w[] = new double[frameLength];<br />

for (int n = 0; n < frameLength; n++)<br />

{<br />

w[n] = 0.54 - 0.46 * Math.cos( (2 * Math.PI * n) / (frameLength - 1) );<br />

}<br />

Equation 2 Windowing<br />

The power spectrum is calculated by performing a discrete fouler transform through a fast<br />

Fourier Transform algorithm. The sum <strong>of</strong> the square <strong>of</strong> the resulting real and imaginary arrays<br />

from the fourier transform yields the power spectrum. [13]<br />

Mel Spectrum<br />

s[k] = (real (X[k])) 2 + (imag (X[k])) 2<br />

double pwrpectrum[] = new double[frame.length];<br />

FFT.computeFFT( frame );<br />

for (int k = 0; k < frame.length; k++){<br />

pwrspectrum[k] = Math.pow(FFT.real[k] * FFT.real[k] + FFT.imag[k] * FFT.imag[k], 0.5);<br />

}<br />

Equation 3 Power Spectrum<br />

The Mel spectrum <strong>of</strong> the power spectrum is computed by multiplying the power spectrum by<br />

each <strong>of</strong> the mel filters and integrating the result [13]. The corresponding Java implementation is<br />

not shown due to its size.<br />

Mel Cepstrum<br />

N/2<br />

S[l] = ∑ s[k] M l [k] l=0, 1..., L-1<br />

k=0<br />

N is the length <strong>of</strong> DFT, L is the lotal number <strong>of</strong> mel filters.<br />

Equation 4 Mel Spectrum<br />

A discrete cosine transform is applied to the natural log <strong>of</strong> the mel spectrum to calculate the<br />

cepstrum. [13]<br />

Issue Number 9, May 2004 Page 14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!