1
0

sphear_fir_extract.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. %%
  2. %% *SpHEAR Project
  3. %%
  4. %% sphear_fir_extract: extract W and XYZ filter shapes from B format response
  5. %%
  6. %% usage:
  7. %% [] = sphear_fir_extract()
  8. %%
  9. %% Copyright 2016, Fernando Lopez-Lezcano, All Rights Reserved
  10. %% nando@ccrma.stanford.edu
  11. %%
  12. %% This program is free software: you can redistribute it and/or modify
  13. %% it under the terms of the GNU General Public License as published by
  14. %% the Free Software Foundation, either version 3 of the License, or
  15. %% (at your option) any later version.
  16. %%
  17. %% This program is distributed in the hope that it will be useful,
  18. %% but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. %% GNU General Public License for more details.
  21. %%
  22. %% You should have received a copy of the GNU General Public License
  23. %% along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. function [W XYZ] = sphear_fir_extract(B, all, onaxis);
  25. if (all == 1)
  26. m = (1:16);
  27. else
  28. if (onaxis == 1)
  29. m = [1,5,9,13];
  30. else
  31. m = [3, 7, 11, 15];
  32. end
  33. end
  34. %% extract average response shape for W
  35. W = 1.0 ./ reshape(mean(B(m,1,:)), size(B(:,:,:))(3), 1);
  36. %% extract average response shape for XYZ
  37. XYZ = 1.0 ./ reshape(mean(mean(B(m, [2, 3, 4], :))), size(B(:,:,:))(3), 1);
  38. end