1
0

sphear_a_to_b_hf_render.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. %%
  2. %% *SpHEAR Project
  3. %%
  4. %% sphear_a_to_b_hf_render: render impulse responses throught one A2B matrix
  5. %%
  6. %% usage:
  7. %% [] = sphear_a_to_b_hf_render()
  8. %%
  9. %% optional parameters:
  10. %%
  11. %% Copyright 2016, Fernando Lopez-Lezcano, All Rights Reserved
  12. %% nando@ccrma.stanford.edu
  13. %%
  14. %% This program is free software: you can redistribute it and/or modify
  15. %% it under the terms of the GNU General Public License as published by
  16. %% the Free Software Foundation, either version 3 of the License, or
  17. %% (at your option) any later version.
  18. %%
  19. %% This program is distributed in the hope that it will be useful,
  20. %% but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. %% GNU General Public License for more details.
  23. %%
  24. %% You should have received a copy of the GNU General Public License
  25. %% along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. function [BFF] = sphear_a_to_b_hf_render(A2B, N, Npre)
  27. for m = 1:16
  28. %% render b format components
  29. [bf(m,:,:) srate] = sphear_a_to_b_hf(m, A2B, N, Npre);
  30. %% write soundfile with rendered B format signals
  31. %%
  32. %% if we write a 32 bit soundfile we need to scale by 256
  33. %% if we want the same amplitude as when writing a 16 bit
  34. %% per sample soundfile, otherwise we get nasty clipping
  35. wavwrite(reshape(bf(m,:,:),4,[])' / 256, srate, 32, ["../cal/2016.04.20/export/b-format-" sprintf("%02.0f", m) ".wav"]);
  36. end
  37. end