annotate dsp/spectraldata.m @ 47:82075c94eed1
adding a bunch of stuff, including graphics and pitch toolboxes.
author |
samer |
date |
Sat, 17 Jan 2015 15:20:35 +0000 |
parents |
c3b0cd708782 |
children |
|
rev |
line source |
samer@32
|
1 function a=spectraldata(source,specfn,windowfn)
|
samer@32
|
2 % SPECTRALDATA - Spectral data from buffered frames
|
samer@32
|
3 %
|
samer@32
|
4 % spectraldata :: (
|
samer@32
|
5 % source: seq[n,l], ~ source data
|
samer@32
|
6 % specfn: [n,l]->[m,l], ~ compute spectrum from frames
|
samer@32
|
7 % windowfn: (n:natural->[n]) ~ function to compute window, eg hanning
|
samer@32
|
8 % ) -> seq[m,l]
|
samer@32
|
9
|
samer@32
|
10 H=spdiag(feval(windowfn,size(source,1)));
|
samer@32
|
11 a=map(@(x)specfn(H*x),source);
|
samer@32
|
12 %a=fnseq(fn,source,'charfn',@charfn);
|
samer@32
|
13
|
samer@32
|
14 % function s=charfn(o)
|
samer@32
|
15 % s=sprintf('%s >> %s/%s',char(source(o)),tostring(specfn),tostring(windowfn));
|
samer@32
|
16 % end
|
samer@32
|
17 end
|
samer@32
|
18
|