Added codegen folder and scripts for fracF operating in DPW (matrix)
This commit is contained in:
51
codegen_fracFdpw/fracF_dpw.m
Normal file
51
codegen_fracFdpw/fracF_dpw.m
Normal 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
|
||||
Reference in New Issue
Block a user