annotate arrows/dsp/amagspec.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 672052bd81f8
children
rev   line source
samer@0 1 % apowspec - Arrow to compute power spectra
samer@0 2 %
samer@0 3 % apowspec ::
samer@0 4 % [[N]] ~'analysis window'
samer@0 5 % -> arrow( {[[N]]}, {[[dftbins(N)]]}, empty).
samer@0 6 %
samer@0 7 % apowspec ::
samer@0 8 % [[M]] ~'analysis window',
samer@0 9 % N ~'size for FFT'
samer@0 10 % -> arrow( {[[M]]}, {[[dftbins(N)]]}, empty).
samer@0 11 function [o,fx]=apowspec(window,N)
samer@0 12 W=spdiag(window);
samer@0 13 if nargin<2, N=length(window); end
samer@0 14 fx=(0:dftbins(N)-1)/N;
samer@0 15 o=arr(@ps);
samer@0 16 function y=ps(x)
samer@0 17 y=magspec(W*x,N);
samer@0 18 end
samer@0 19 end