-
Notifications
You must be signed in to change notification settings - Fork 6
/
calc_audftrs.m
28 lines (22 loc) · 888 Bytes
/
calc_audftrs.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function [hists, params] = calc_audftrs(d, sr)
% [hists, params] = calc_audftrs(d, sr)
% Calculate "auditory model" subband PCA VQ histogram feature.
% 2013-08-23 Dan Ellis [email protected]
% Main subband PCA core
[pcas,params] = calc_sbpca(d, sr);
% Load VQ codebook
vqfile = 'CB-sbpca-4x60x1000.mat';
C = load(vqfile);
params.vqcodebook = C.codebook;
params.vqmeans = C.recMean;
params.vqstds = C.recStd;
% vector quantize - <nRect> x <nframe>
VQs = sbpca_vqs(pcas, params);
% histogram - <nRect x cbSize> x <nblock>
params.histwin = 2.0; % histograms over 2 sec wins
params.histhop = 2.0; % windows every 2 sec in file
hists = sbpca_hist(VQs, params);
% 2013-08-11 Up to here verified as almost identical to calcSBPCA
% (just off by one or two frames on histogram aggregation windows)
% but I think these ones are more on-target (ignoring the 25 ms
% flank, I suppose).