1
0

make_figures_aes.m 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. %%
  2. %% Make all figures for the AES SFC 2016 Conference paper
  3. %%
  4. %% Copyright 2016, Fernando Lopez-Lezcano, All Rights Reserved
  5. %% nando@ccrma.stanford.edu
  6. %%
  7. %% This program is free software: you can redistribute it and/or modify
  8. %% it under the terms of the GNU General Public License as published by
  9. %% the Free Software Foundation, either version 3 of the License, or
  10. %% (at your option) any later version.
  11. %%
  12. %% This program is distributed in the hope that it will be useful,
  13. %% but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. %% GNU General Public License for more details.
  16. %%
  17. %% You should have received a copy of the GNU General Public License
  18. %% along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. function [FIR] = make_figures_aes(col)
  20. %% start from scratch and load common functions
  21. close all;
  22. clear all;
  23. sphear_common;
  24. global AESDIR = "../figures/";
  25. %% color figures
  26. cext = "_color";
  27. copt = "epsc";
  28. %% mono figures
  29. %% cext = "_mono";
  30. %% copt = "eps";
  31. %% frequency response with just A2B matrices
  32. [F FE Fs A2BF] = sphear_a2b_all((1:16), 300, 20000, 8, 256, 32);
  33. %% deliberately use nyquist to extend this to high frequencies
  34. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 24000, copt);
  35. sphear_fir_render(FIR, 300, 20000, -45, 12, 256, 32, 8192, copt);
  36. close all;
  37. system(["cp -p figures/sphear_bf_azimuth_000" cext ".eps " AESDIR "sphear_bf_azimuth_000_a2b_all.eps"]);
  38. system(["cp -p figures/sphear_bf_azimuth_045" cext ".eps " AESDIR "sphear_bf_azimuth_045_a2b_all.eps"]);
  39. system(["cp -p figures/wxyz_filter_lf" cext ".eps " AESDIR "wxyz_filter_a2b_only.eps"]);
  40. %% frequency response with just the A2B matrices and limit frequency
  41. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, copt);
  42. sphear_fir_render(FIR, 300, 20000, -45, 12, 256, 32, 8192, copt);
  43. close all;
  44. system(["cp -p figures/sphear_bf_azimuth_000" cext ".eps " AESDIR "sphear_bf_azimuth_000_a2b.eps"]);
  45. system(["cp -p figures/sphear_bf_azimuth_045" cext ".eps " AESDIR "sphear_bf_azimuth_045_a2b.eps"]);
  46. system(["cp -p figures/wxyz_filter_lf" cext ".eps " AESDIR "wxyz_filter_lf_a2b.eps"]);
  47. %% and now design the full filter, on-axis averaging only
  48. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, 0);
  49. sphear_fir_render(FIR, 300, 20000, -45, 0, 256, 32, 8192, 0);
  50. [B] = sphear_a2b_fir_all(300, 20000, 8, 8192, 48000, 0);
  51. [W X Y Z] = sphear_fir_extract(B, 0, 1);
  52. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, copt, W, X, Y);
  53. sphear_fir_render(FIR, 300, 20000, -45, 0, 256, 32, 8192, copt);
  54. sphear_fir_render_directions(FIR, 3000, 20000, 256, 32, 4096, copt);
  55. [B] = sphear_a2b_fir_all(300, 20000, 8, 8192, 48000, 1);
  56. close all;
  57. %% recovered cardioid versus frequency
  58. sphear_cardioid_plot_all([500, 2000, 5000, 7000, 10000, 14000], 300, 20000, 8, 8192, 48000, "epsc");
  59. system(["cp -p figures/sphear_bf_azimuth_000" cext ".eps " AESDIR "sphear_bf_azimuth_000.eps"]);
  60. system(["cp -p figures/sphear_bf_azimuth_045" cext ".eps " AESDIR "sphear_bf_azimuth_045.eps"]);
  61. system(["cp -p figures/wxyz_filter_ff" cext ".eps " AESDIR "wxyz_filter_ff.eps"]);
  62. system(["cp -p figures/sphear_directions.eps " AESDIR "sphear_directions_onaxis.eps"]);
  63. system(["cp -p figures/sphear_polar_multi_00604_00659_color.eps " AESDIR "sphear_polar_multi_600.eps"]);
  64. system(["cp -p figures/sphear_polar_multi_01216_01327_color.eps " AESDIR "sphear_polar_multi_1200.eps"]);
  65. system(["cp -p figures/sphear_polar_multi_05383_05875_color.eps " AESDIR "sphear_polar_multi_5000.eps"]);
  66. system(["cp -p figures/sphear_polar_multi_10840_11831_color.eps " AESDIR "sphear_polar_multi_10000.eps"]);
  67. system(["cp -p figures/sphear_cardioid_polar.eps " AESDIR "sphear_cardioid_polar.eps"]);
  68. %% and again with all angles averaging
  69. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, 0);
  70. sphear_fir_render(FIR, 300, 20000, -45, 0, 256, 32, 8192, 0);
  71. [B] = sphear_a2b_fir_all(300, 20000, 8, 8192, 48000, 0);
  72. [W X Y Z] = sphear_fir_extract(B, 1, 1);
  73. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, copt, W, X, Y);
  74. sphear_fir_render(FIR, 300, 20000, -45, 0, 256, 32, 8192, copt);
  75. sphear_fir_render_directions(FIR, 3000, 20000, 256, 32, 4096, copt);
  76. close all;
  77. system(["cp -p figures/sphear_bf_azimuth_000" cext ".eps " AESDIR "sphear_bf_azimuth_000_all.eps"]);
  78. system(["cp -p figures/sphear_bf_azimuth_045" cext ".eps " AESDIR "sphear_bf_azimuth_045_all.eps"]);
  79. system(["cp -p figures/wxyz_filter_ff" cext ".eps " AESDIR "wxyz_filter_ff_all.eps"]);
  80. system(["cp -p figures/sphear_directions.eps " AESDIR "sphear_directions_all.eps"]);
  81. end