Skip to content
Snippets Groups Projects
Commit 5d17b5e1 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Do IFFT in the loop.

parent 11f135c0
Branches
No related tags found
1 merge request!420Resolve RTSD-264
...@@ -20,24 +20,22 @@ Ncoefs = Ntaps * Nfft; ...@@ -20,24 +20,22 @@ Ncoefs = Ntaps * Nfft;
bfir = (1:Ncoefs) * 0; bfir = (1:Ncoefs) * 0;
bfir(1:length(filt)) = filt; bfir(1:length(filt)) = filt;
% IFFT
for n = 1:nof_blocks
temp(n, 1:Nfft) = real(ifft(inBins(n,:)));
end
outData = (1:nof_blocks*Nstep + Ncoefs) * 0; outData = (1:nof_blocks*Nstep + Ncoefs) * 0;
for n = 1:nof_blocks for n = 1:nof_blocks
% IFFT
inData = real(ifft(inBins(n,:)));
% Copy the FFT data at each FIR tap % Copy the FFT data at each FIR tap
temp2 = (1:Ncoefs) * 0; tapData = (1:Ncoefs) * 0;
for m = 0:Ntaps-1 for m = 0:Ntaps-1
temp2((1:Nfft) + m*Nfft) = temp(n, 1:Nfft); tapData((1:Nfft) + m*Nfft) = inData;
end end
% Apply the FIR coefficients by using bfir as window % Apply the FIR coefficients by using bfir as window
temp2 = temp2 .* bfir; tapData = tapData .* bfir;
% Sum the FIR taps by overlap add the weighted input to the output. % 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 % Progress with Nstep per block of Nfft to upsample by Nstep, to match
% the downsample by Nstep of the analysis filterbank. % the downsample by Nstep of the analysis filterbank.
range = (1:Ncoefs) + (n-1)*Nstep; range = (1:Ncoefs) + (n-1)*Nstep;
outData(range) = outData(range) + temp2; % continuous time output outData(range) = outData(range) + tapData; % continuous time output
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment