1
0

make_figures_aes.m 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. %%
  2. %% Make all figures for the AES paper
  3. %%
  4. %% Copyright Fernando Lopez-Lezcano 2016
  5. %% nando@ccrma.stanford.edu
  6. function [FIR] = make_figures_aes(col)
  7. %% start from scratch and load common functions
  8. close all;
  9. clear all;
  10. sphear_common;
  11. global AESDIR = "../papers/AES_SFCconf2016/AES_SFCconf2016_template_abstractOnly/";
  12. %% color figures
  13. cext = "_color";
  14. copt = "epsc";
  15. %% mono figures
  16. %% cext = "_mono";
  17. %% copt = "eps";
  18. %% frequency response with just A2B matrices
  19. [F FE Fs A2BF] = sphear_a2b_all((1:16), 300, 20000, 8, 256, 32);
  20. %% deliberately use nyquist to extend this to high frequencies
  21. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 24000, copt);
  22. sphear_fir_render(FIR, 300, 20000, -45, 12, 256, 32, 8192, copt);
  23. close all;
  24. system(["cp -p figures/sphear_bf_azimuth_000" cext ".eps " AESDIR "sphear_bf_azimuth_000_a2b_all.eps"]);
  25. system(["cp -p figures/sphear_bf_azimuth_045" cext ".eps " AESDIR "sphear_bf_azimuth_045_a2b_all.eps"]);
  26. system(["cp -p figures/wxyz_filter_lf" cext ".eps " AESDIR "wxyz_filter_a2b_only.eps"]);
  27. %% frequency response with just the A2B matrices and limit frequency
  28. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, copt);
  29. sphear_fir_render(FIR, 300, 20000, -45, 12, 256, 32, 8192, copt);
  30. close all;
  31. system(["cp -p figures/sphear_bf_azimuth_000" cext ".eps " AESDIR "sphear_bf_azimuth_000_a2b.eps"]);
  32. system(["cp -p figures/sphear_bf_azimuth_045" cext ".eps " AESDIR "sphear_bf_azimuth_045_a2b.eps"]);
  33. system(["cp -p figures/wxyz_filter_lf" cext ".eps " AESDIR "wxyz_filter_lf_a2b.eps"]);
  34. %% and now design the full filter, on-axis averaging only
  35. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, 0);
  36. sphear_fir_render(FIR, 300, 20000, -45, 0, 256, 32, 8192, 0);
  37. [B] = sphear_a2b_fir_all(300, 20000, 8, 8192, 48000, 0);
  38. [W X Y Z] = sphear_fir_extract(B, 0, 1);
  39. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, copt, W, X, Y);
  40. sphear_fir_render(FIR, 300, 20000, -45, 0, 256, 32, 8192, copt);
  41. sphear_fir_render_directions(FIR, 3000, 20000, 256, 32, 4096, copt);
  42. [B] = sphear_a2b_fir_all(300, 20000, 8, 8192, 48000, 1);
  43. close all;
  44. %% recovered cardioid versus frequency
  45. sphear_cardioid_plot_all([500, 2000, 5000, 7000, 10000, 14000], 300, 20000, 8, 8192, 48000, "epsc");
  46. system(["cp -p figures/sphear_bf_azimuth_000" cext ".eps " AESDIR "sphear_bf_azimuth_000.eps"]);
  47. system(["cp -p figures/sphear_bf_azimuth_045" cext ".eps " AESDIR "sphear_bf_azimuth_045.eps"]);
  48. system(["cp -p figures/wxyz_filter_ff" cext ".eps " AESDIR "wxyz_filter_ff.eps"]);
  49. system(["cp -p figures/sphear_directions.eps " AESDIR "sphear_directions_onaxis.eps"]);
  50. system(["cp -p figures/sphear_polar_multi_00604_00659_color.eps " AESDIR "sphear_polar_multi_600.eps"]);
  51. system(["cp -p figures/sphear_polar_multi_01216_01327_color.eps " AESDIR "sphear_polar_multi_1200.eps"]);
  52. system(["cp -p figures/sphear_polar_multi_05383_05875_color.eps " AESDIR "sphear_polar_multi_5000.eps"]);
  53. system(["cp -p figures/sphear_polar_multi_10840_11831_color.eps " AESDIR "sphear_polar_multi_10000.eps"]);
  54. system(["cp -p figures/sphear_cardioid_polar.eps " AESDIR "sphear_cardioid_polar.eps"]);
  55. %% and again with all angles averaging
  56. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, 0);
  57. sphear_fir_render(FIR, 300, 20000, -45, 0, 256, 32, 8192, 0);
  58. [B] = sphear_a2b_fir_all(300, 20000, 8, 8192, 48000, 0);
  59. [W X Y Z] = sphear_fir_extract(B, 1, 1);
  60. FIR = sphear_fir_design(F, A2BF, 256, 20, Fs, 4000, copt, W, X, Y);
  61. sphear_fir_render(FIR, 300, 20000, -45, 0, 256, 32, 8192, copt);
  62. sphear_fir_render_directions(FIR, 3000, 20000, 256, 32, 4096, copt);
  63. close all;
  64. system(["cp -p figures/sphear_bf_azimuth_000" cext ".eps " AESDIR "sphear_bf_azimuth_000_all.eps"]);
  65. system(["cp -p figures/sphear_bf_azimuth_045" cext ".eps " AESDIR "sphear_bf_azimuth_045_all.eps"]);
  66. system(["cp -p figures/wxyz_filter_ff" cext ".eps " AESDIR "wxyz_filter_ff_all.eps"]);
  67. system(["cp -p figures/sphear_directions.eps " AESDIR "sphear_directions_all.eps"]);
  68. end