|
@@ -43,7 +43,9 @@
|
|
|
|
|
|
|
|
function [FIR] = sphear_fir_design(F, A2BF, n, maxboost, Fs, Fl, plot_on, W, X, Y, Z)
|
|
function [FIR] = sphear_fir_design(F, A2BF, n, maxboost, Fs, Fl, plot_on, W, X, Y, Z)
|
|
|
|
|
|
|
|
- fig = figure;
|
|
|
|
|
|
|
+ if (plot_on != 0)
|
|
|
|
|
+ fig = figure;
|
|
|
|
|
+ end
|
|
|
|
|
|
|
|
if (exist("W") == 1 && ! exist("Z"))
|
|
if (exist("W") == 1 && ! exist("Z"))
|
|
|
%% Z was not supplied, just average X and Y data
|
|
%% Z was not supplied, just average X and Y data
|
|
@@ -188,25 +190,29 @@ function [FIR] = sphear_fir_design(F, A2BF, n, maxboost, Fs, Fl, plot_on, W, X,
|
|
|
copt = '-mono';
|
|
copt = '-mono';
|
|
|
cext = "_mono";
|
|
cext = "_mono";
|
|
|
end
|
|
end
|
|
|
- axis([300, (Fs/2)]);
|
|
|
|
|
- tics('x', [300, 500, 1000, 2000, 3000, 5000, 7000, 10000, 15000, 20000]);
|
|
|
|
|
grid on;
|
|
grid on;
|
|
|
|
|
+ axis([300, (Fs/2)]);
|
|
|
|
|
+ xticks = [300, 500, 1000, 2000, 3000, 5000, 7000, 10000, 20000];
|
|
|
|
|
+ set(gca, 'XTick', xticks);
|
|
|
|
|
+ set(gca, 'XTickLabel', sprintf('%d|', xticks));
|
|
|
|
|
+ ca=get (gcf, "currentaxes");
|
|
|
|
|
+ set(ca,"fontweight","bold","linewidth",1.5)
|
|
|
pbaspect([16, 9, 1])
|
|
pbaspect([16, 9, 1])
|
|
|
- title(sprintf("B format FIR filters (transition frequency: %d Hz)", Fl));
|
|
|
|
|
|
|
+ %% title(sprintf("B format FIR filters (transition frequency: %d Hz)", Fl));
|
|
|
hold on;
|
|
hold on;
|
|
|
%% plot real measured points
|
|
%% plot real measured points
|
|
|
- ph = semilogx(F, 20*log10(abs(A2BF(:,c,b)))', popts);
|
|
|
|
|
|
|
+ %% ph = semilogx(F, 20*log10(abs(A2BF(:,c,b)))', popts, "linewidth", 1.5);
|
|
|
%% plot extrapolated filter
|
|
%% plot extrapolated filter
|
|
|
if (b == 1)
|
|
if (b == 1)
|
|
|
%% W
|
|
%% W
|
|
|
- wh = semilogx(fi*(Fs/2), 20*log10(abs(ri)), wopts);
|
|
|
|
|
|
|
+ wh = semilogx(fi*(Fs/2), 20*log10(abs(ri)), wopts, "linewidth", 1.5);
|
|
|
else
|
|
else
|
|
|
if (b == 4)
|
|
if (b == 4)
|
|
|
%% Z
|
|
%% Z
|
|
|
- zh = semilogx(fi*(Fs/2), 20*log10(abs(ri)), zopts);
|
|
|
|
|
|
|
+ zh = semilogx(fi*(Fs/2), 20*log10(abs(ri)), zopts, "linewidth", 1.5);
|
|
|
else
|
|
else
|
|
|
%% XY
|
|
%% XY
|
|
|
- xyh = semilogx(fi*(Fs/2), 20*log10(abs(ri)), xyopts);
|
|
|
|
|
|
|
+ xyh = semilogx(fi*(Fs/2), 20*log10(abs(ri)), xyopts, "linewidth", 1.5);
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
@@ -218,7 +224,7 @@ function [FIR] = sphear_fir_design(F, A2BF, n, maxboost, Fs, Fl, plot_on, W, X,
|
|
|
|
|
|
|
|
if (plot_on != 0)
|
|
if (plot_on != 0)
|
|
|
l = legend([wh, zh, xyh], {'W', 'XY', 'Z'});
|
|
l = legend([wh, zh, xyh], {'W', 'XY', 'Z'});
|
|
|
- legend(l, 'location', 'southwest');
|
|
|
|
|
|
|
+ legend(l, 'location', 'west');
|
|
|
if (exist("W") == 1)
|
|
if (exist("W") == 1)
|
|
|
if (strcmp(plot_on, 'eps') || strcmp(plot_on, 'epsc') || plot_on == 1)
|
|
if (strcmp(plot_on, 'eps') || strcmp(plot_on, 'epsc') || plot_on == 1)
|
|
|
print(fig, '-deps','-tight',copt,["figures/wxyz_filter_ff" cext ".eps"]);
|
|
print(fig, '-deps','-tight',copt,["figures/wxyz_filter_ff" cext ".eps"]);
|