|
@@ -105,10 +105,17 @@ function [FIR] = sphear_fir_design(F, A2BF, n, maxboost, Fs, Fl, W, X, Y, Z)
|
|
|
|
|
|
|
|
%% normalize all components to the average of W levels for all
|
|
%% normalize all components to the average of W levels for all
|
|
|
%% capsules around the transition frequency
|
|
%% capsules around the transition frequency
|
|
|
- nrm = mean([mean(A2BF([dlast-1, dlast, dlast+1],1,1))
|
|
|
|
|
- mean(A2BF([dlast-1, dlast, dlast+1],2,1))
|
|
|
|
|
- mean(A2BF([dlast-1, dlast, dlast+1],3,1))
|
|
|
|
|
- mean(A2BF([dlast-1, dlast, dlast+1],4,1))]);
|
|
|
|
|
|
|
+ if ((dlast+1) > size(A2BF(:,1,1))(1))
|
|
|
|
|
+ %% special case for testing with a very high transition frequency
|
|
|
|
|
+ avg = [dlast-3, dlast-2, dlast-1];
|
|
|
|
|
+ else
|
|
|
|
|
+ avg = [dlast-1, dlast, dlast+1];
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ nrm = mean([mean(A2BF(avg,1,1))
|
|
|
|
|
+ mean(A2BF(avg,2,1))
|
|
|
|
|
+ mean(A2BF(avg,3,1))
|
|
|
|
|
+ mean(A2BF(avg,4,1))]);
|
|
|
|
|
|
|
|
for b = 1:4
|
|
for b = 1:4
|
|
|
for c = 1:4
|
|
for c = 1:4
|