Added codegen folder and scripts for fracF operating in DPW (matrix)

This commit is contained in:
canisio
2026-06-09 16:15:39 -03:00
parent 22c51e1597
commit f64f4fde31
18 changed files with 185 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
function F = fracF_dpw(f,...
Achirp,...
AchirpOut,...
H,...
scale)
%#codegen
%
% fracF_dpw
%
% Matrix FrFT processing for an entire DPW.
%
% INPUT:
% f [1024 x Nframes] complex(single)
% Achirp [1024 x 1]
% AchirpOut [512 x 1]
% H [2048 x 1]
% scale scalar
%
% OUTPUT:
% F [512 x Nframes]
N = 1024;
Nfft = 2048;
Nframes = size(f,2);
%% First chirp multiplication
g = f .* Achirp;
%% Zero-padding
g_pad = complex(zeros(Nfft,Nframes,'single'));
g_pad(1:N,:) = g;
%% FFT convolution
Gfft = fft(g_pad);
G = ifft(Gfft .* H);
%% Extract valid region and decimate
G_valid = G(N+1:2:end,:);
%% Final chirp multiplication
F = scale .* G_valid .* AchirpOut;
end