annotate arrows/dsp/apow2melspec.m @ 6:0ce3c2070089
Removed duplicate code and fixed doc in timed_action.
author |
samer |
date |
Mon, 14 Jan 2013 14:33:37 +0000 |
parents |
672052bd81f8 |
children |
|
rev |
line source |
samer@0
|
1 % apow2melspec - arrow from power spectra to log mel spectra
|
samer@0
|
2 %
|
samer@0
|
3 % apow2melspec ::
|
samer@0
|
4 % N:natural ~'size of FFT used to compute spectra',
|
samer@0
|
5 % nonneg ~'sampling frequency',
|
samer@0
|
6 % [[1,2]->freq] ~'upper and lower frequency limits',
|
samer@0
|
7 % L:natural ~'number of mel bands to compute'
|
samer@0
|
8 % -> arrow( {[[dftbins(N)]]}, {[[L]]}, empty).
|
samer@0
|
9
|
samer@0
|
10 function o=apow2melspec(N,fs,flim,L)
|
samer@0
|
11 melW = tri_filterbank_aa(melspace(flim(1),min(flim(2),fs/2),L+2),binmap(0,fs/2,dftbins(N)));
|
samer@0
|
12 o=arr(@cc);
|
samer@0
|
13 function y=cc(x), y = log(melW*x+5e-9); end
|
samer@0
|
14 end
|