Kaynağa Gözat

add special case for testing

Fernando Pablo Lopez-Lezcano 10 yıl önce
ebeveyn
işleme
ad11da3ecd
1 değiştirilmiş dosya ile 11 ekleme ve 4 silme
  1. 11 4
      sphear_fir_design.m

+ 11 - 4
sphear_fir_design.m

@@ -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
   %% 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 c = 1:4