| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- %%
- %% *SpHEAR Project
- %%
- %% sphear_bf_plot: plot the polar response of a B format signal
- %%
- %% usage:
- %% [BF] = sphear_bf_plot(BF, fmin, fmax)
- %%
- %% BF: B format signal array
- %% fmin, fmax: range of frequencies to consider (to title plot)
- %%
- %% Copyright Fernando Lopez-Lezcano 2016
- %%
- function [BF] = sphear_bf_plot(BF, fmin, fmax, rmax)
- pkg load signal;
- %% to close the polar plots we repeat the first point
- m = size(BF, 1);
- BF(m + 1,:) = BF(1,:);
- theta = (0:m)*(2*pi/m);
-
- %% plot it as a function of angle
- bname = cellstr(['W'; 'X'; 'Y'; 'Z']);
- f = figure;
- for b = 1:4
- subplot(2, 2, b);
- hold on;
- axis square;
- axis([-rmax, rmax, -rmax, rmax]);
- title([char(bname(b)) ": " sprintf("%05.0d", fmin) " to " sprintf("%05.0d", fmax) " Hz"]);
- [xr, yr] = pol2cart(theta', ones(m + 1,1));
- plot(xr, yr);
- [x, y] = pol2cart(theta', abs(BF(:,b)));
- plot(x, y, '.-r', 'LineWidth', 0.5);
- end
- print(f, '-dpng','-color',["figures/sphear_polar_multi_" sprintf("%05d", fmin) "_" sprintf("%05d", fmax) ".png"]);
- end
|