From d6d617c72285aa1f562be1e5b405bb38ec3ecf66 Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Wed, 14 Aug 2024 09:54:47 +0200
Subject: [PATCH] Clarify FIR part and upsampling of synthesis filterbank.

---
 .../pfb_bunton_annotated/polyphase_synthesis_b.m     | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/applications/lofar2/model/pfb_bunton_annotated/polyphase_synthesis_b.m b/applications/lofar2/model/pfb_bunton_annotated/polyphase_synthesis_b.m
index 3e1ae4f366..c13e920b95 100644
--- a/applications/lofar2/model/pfb_bunton_annotated/polyphase_synthesis_b.m
+++ b/applications/lofar2/model/pfb_bunton_annotated/polyphase_synthesis_b.m
@@ -27,15 +27,17 @@ end
 
 outData = (1:nof_blocks*Nstep + Ncoefs) * 0;
 for n = 1:nof_blocks
-    % Copy the data at each tap
+    % Copy the FFT data at each FIR tap
     temp2 = (1:Ncoefs) * 0;
     for m = 0:Ntaps-1
         temp2((1:Nfft) + m*Nfft) = temp(n, 1:Nfft);
     end
-    % Filter input using bfir as window
+    % Apply the FIR coefficients by using bfir as window
     temp2 = temp2 .* bfir;
-    % Overlap add to sum the taps, with upsampling rate Nstep
+
+    % Sum the FIR taps by overlap add the weighted input to the output.
+    % Progress with Nstep per block of Nfft to upsample by Nstep, to match
+    % the downsample by Nstep of the analysis filterbank.
     range = (1:Ncoefs) + (n-1)*Nstep;
-    outData(range) = outData(range) + temp2;  % for continuous time output
-    %outData(n,:) = temp2;  % for output in blocks
+    outData(range) = outData(range) + temp2;  % continuous time output
 end
-- 
GitLab