Explorar el Código

make the y axis range of the plots programmable

Fernando Pablo Lopez-Lezcano hace 10 años
padre
commit
946ee31a8f
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      sphear_fir_render.m

+ 4 - 3
sphear_fir_render.m

@@ -4,10 +4,11 @@
 %% sphear_fir_render: render impulse responses throught the FIR filter A2B matrix
 %%
 %% usage:
-%%   [] = sphear_fir_render(FIR, fmin, fmax, N, Npre, Nfft, plot_on, smooth)
+%%   [] = sphear_fir_render(FIR, fmin, fmax, ymin, ymax, N, Npre, Nfft, plot_on, smooth)
 %%
 %% FIR: A2B matrix of FIR filters
 %% fmin, fmax: range of frequencies to use
+%% ymin, ymax: y range to plot
 %% N: number of samples to filter
 %% Npre: number of samples before the main impulse peak
 %% Nfft: size of fft used to calculate frequency response
@@ -34,7 +35,7 @@
 %%  You should have received a copy of the GNU General Public License
 %%  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-function [BFF] = sphear_fir_render(FIR, fmin, fmax, N, Npre, Nfft, plot_on, smooth)
+function [BFF] = sphear_fir_render(FIR, fmin, fmax, ymin, ymax, N, Npre, Nfft, plot_on, smooth)
 
   %% no smoothing or plotting by default
   if (!exist("smooth"))
@@ -104,7 +105,7 @@ function [BFF] = sphear_fir_render(FIR, fmin, fmax, N, Npre, Nfft, plot_on, smoo
       angle = 360 / 16 * (m - 1);
       %% we add the title as a subfigure in the paper
       %% title(sprintf("azimuth = %.1f degrees", angle));
-      axis([fmin, fmax, -45, 12]);
+      axis([fmin, fmax, ymin, ymax]);
       tics('y', [6, 3, 0, -3, -6, -9, -12, -15, -20, -25, -30, -40, -50]);
       tics('x', [300, 500, 1000, 2000, 3000, 5000, 7000, 10000, 15000, 20000]);
       ca=get (gcf, "currentaxes");