Mercurial > hg > aimc
diff trunk/matlab/bmm/carfac/SAI_UpdateBuffers.m @ 665:d0ff15c36828
Turn the AGC coeffs inside out: array of structs instead of a struct of little arrays.
In C++ use a vector<AGC_coeffs> for this; each of 4 stages has an entry; many fewer places
need to do indexing by stage, and this removes the temptation to use little eigen arrays
for the 4 stages.
Also latest version of experimental log-lag SAI hacks.
author | dicklyon@google.com |
---|---|
date | Tue, 21 May 2013 04:24:05 +0000 |
parents | 2e456754fe20 |
children |
line wrap: on
line diff
--- a/trunk/matlab/bmm/carfac/SAI_UpdateBuffers.m Fri May 17 19:52:45 2013 +0000 +++ b/trunk/matlab/bmm/carfac/SAI_UpdateBuffers.m Tue May 21 04:24:05 2013 +0000 @@ -42,7 +42,7 @@ %% % Decimate using a 2-3-4-filter and partial differencing emphasize onsets: kernel = filter([1 1]/2, 1, filter([1 1 1]/3, 1, [1 1 1 1 0 0 0 0]/4)); -kernel = kernel + 2*diff([0, kernel]); +% kernel = kernel + 2*diff([0, kernel]); % figure(1) % plot(kernel) @@ -65,11 +65,13 @@ n_shift = floor(n_shift); % Grab new stuff from new end (big time indices) of previous layer. % Take twice as many times as we need, + 5, for decimation, and do - % 343 smoothing to get new points. + % smoothing to get new points. new_chunk = ... layer_array(layer - 1).nap_buffer((end - 2*n_shift - 4):end, :); new_chunk = filter(kernel, 1, new_chunk); - new_chunk = gain * new_chunk(7:2:end, :); + % new_chunk = gain * new_chunk(7:2:end, :); + % try a little extra smoothing: + new_chunk = gain * (new_chunk(7:2:end, :) + new_chunk(6:2:(end-1), :))/2; end % Put new stuff in at latest time indices.