samer@0: % spec_bench - Arrow for doing spectral-based processing samer@0: % samer@0: % spec_bench :: samer@0: % N:natural ~'frame size', samer@0: % M:natural ~'hop size' samer@0: % arrow( {[dftbins(N),W]}, {[dftbins(N),W]}, S1), ~'arrow to process magnitude spectra' samer@0: % -> arrow( {[N,W]}, {[dftbins(N),W]}, spec_bench1_state(S1,S2)) ~'total arrow'. samer@0: % samer@0: % This splits a signal into magnitude and phase spectra (using Hanning analysis window), samer@0: % applies supplied arrows to the two branches, and then recombines them using an inverse samer@0: % DFT and overlap-and-add to compose the output signal. samer@0: samer@0: function [o,path]=spec_bench1(N,M,a1,a2) samer@0: H=spdiag(hanning(N,'periodic')); samer@0: samer@0: o= ( amult(H) ... % analysis window samer@0: * mag_phase_split(N) ... % split into magnitude and phase spectra samer@0: * (a1 + anull) ... % apply a1 and a2 to mag and phase samer@0: ); samer@0: path=[2,1]; samer@0: end samer@0: