Files
Zcu111ResmReceiver/codegen_fracFdpw/fracF_dpw.m

116 lines
2.8 KiB
Matlab

function F = fracF_dpw(f,...
Achirp,...
H,...
Cchirp,...
Aa)
%#codegen
%% fracF_dpw Fractional Fourier Transform for an entire DPW
%
% F = fracF_dpw(f,Achirp,H,Cchirp,Aa)
%
% Computes the Fractional Fourier Transform (FrFT) of all frames in a
% Digital Processing Window (DPW) using a matrix-oriented implementation.
%
% The algorithm follows the same chirp-convolution-chirp formulation as
% fracF_cg(), but processes all DPW frames simultaneously. Each column of
% the input matrix is treated as an independent frame, following the same
% "columns are channels" convention used by DSP System Toolbox blocks.
%
% Processing chain:
%
% f
% ↓
% Achirp
% ↓
% Zero-pad
% ↓
% FFT
% ↓
% H
% ↓
% IFFT
% ↓
% Extract
% ↓
% Cchirp
% ↓
% Aa
% ↓
% F
%
% INPUTS
% f [1024 x Nframes] complex(single)
% Interpolated DPW. Each column corresponds to one frame.
%
% Achirp [1024 x 1] complex(single)
% Pre-multiplication chirp (A chirp).
%
% H [2048 x 1] complex(single)
% FFT of the convolution chirp (B chirp).
%
% Cchirp [512 x 1] complex(single)
% Post-multiplication chirp (C chirp).
%
% Aa scalar complex(single)
% FrFT amplitude factor (A_alpha).
%
% OUTPUT
% F [512 x Nframes] complex(single)
% FrFT result for all DPW frames.
%
% Notes
% - Input length is fixed at N = 1024 samples.
% - Output length is N/2 = 512 samples.
% - All DPW frames are processed simultaneously.
% - Numerically equivalent to applying fracF_cg() independently to
% each column of the input matrix.
% - Intended for code generation and RFSoC PS deployment.
%
% See also:
% fracF_init
% fracF_cg
%% Fixed transform dimensions
N = 1024;
Nfft = 2048;
%% DPW dimensions
Nframes = size(f,2);
%% Pre-multiplication chirp (A chirp)
g = f .* Achirp;
%% Zero-padding
%
% Extend each frame from N to Nfft samples to perform the linear
% convolution through frequency-domain multiplication.
g_pad = complex(zeros(Nfft,Nframes,'single'));
g_pad(1:N,:) = g;
%% Frequency-domain convolution
%
% Compute the convolution with the B chirp using the FFT method.
Gfft = fft(g_pad);
G = ifft(Gfft .* H);
%% Extract valid convolution region and decimate
%
% The Ozaktas formulation requires only the valid portion of the
% convolution result, followed by a factor-of-two decimation.
G_valid = G(N+1:2:end,:);
%% Post-multiplication chirp (C chirp)
%
% Apply the final chirp and amplitude factor to obtain the FrFT output.
F = Aa .* G_valid .* Cchirp;
end