annotate arrows/dsp/spec_bench1.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 % spec_bench - Arrow for doing spectral-based processing
|
samer@0
|
2 %
|
samer@0
|
3 % spec_bench ::
|
samer@0
|
4 % N:natural ~'frame size',
|
samer@0
|
5 % M:natural ~'hop size'
|
samer@0
|
6 % arrow( {[dftbins(N),W]}, {[dftbins(N),W]}, S1), ~'arrow to process magnitude spectra'
|
samer@0
|
7 % -> arrow( {[N,W]}, {[dftbins(N),W]}, spec_bench1_state(S1,S2)) ~'total arrow'.
|
samer@0
|
8 %
|
samer@0
|
9 % This splits a signal into magnitude and phase spectra (using Hanning analysis window),
|
samer@0
|
10 % applies supplied arrows to the two branches, and then recombines them using an inverse
|
samer@0
|
11 % DFT and overlap-and-add to compose the output signal.
|
samer@0
|
12
|
samer@0
|
13 function [o,path]=spec_bench1(N,M,a1,a2)
|
samer@0
|
14 H=spdiag(hanning(N,'periodic'));
|
samer@0
|
15
|
samer@0
|
16 o= ( amult(H) ... % analysis window
|
samer@0
|
17 * mag_phase_split(N) ... % split into magnitude and phase spectra
|
samer@0
|
18 * (a1 + anull) ... % apply a1 and a2 to mag and phase
|
samer@0
|
19 );
|
samer@0
|
20 path=[2,1];
|
samer@0
|
21 end
|
samer@0
|
22
|