93 Commits

Author SHA1 Message Date
canisio
19b0513809 docs: update documentation for capture redesign and validation 2026-04-29 10:03:34 -03:00
canisio
b3ba729f8b Pulsed input LFM tested on board. Appears ok on both channelizer and bypass. 2026-04-28 17:43:45 -03:00
canisio
c7cb4e770f Simulated with pulsed signal before testing on ZCU111 2026-04-28 16:31:04 -03:00
canisio
6093942ab3 include check scripts to the project.
changed pulseWidth to pulseT.
2026-04-28 15:22:03 -03:00
canisio
edef1dbed3 validation: add checkCounterSamples and verify capture up to 1024 frames on ZCU111
Created checkCounterSamples.m to validate sample continuity, counter wraps,
and frame index progression. Verified counter bypass, sine bypass, and
channelizer modes up to nFrames=1024 across 10 DPWs on ZCU111.
2026-04-27 18:32:31 -03:00
canisio
b8d2d6a5dd updated postload funcion to not break when top is unloaded 2026-04-27 12:21:03 -03:00
canisio
4216288e2a Removed delays from bypass
Removed visualisation from PS
DPW visualization and log outside PS (external mode)
2026-04-27 12:09:46 -03:00
canisio
df335aac1e validation: verified capture pipeline in counter bypass, sine bypass, and sine channelizer modes (nFrames=8)
Validated end-to-end data integrity and visualization across all modes.
2026-04-25 12:58:22 -03:00
canisio
1ebf8aa076 codegen: increase max identifier length to 64 in soc_rfsoc_proc and gm_soc_rfsoc_top_sw
Updated Configuration Parameters (Code Generation -> Identifiers) in both
soc_rfsoc_proc and parent model gm_soc_rfsoc_top_sw to set Maximum identifier
length from 31 to 64. This avoids truncation of generated identifiers, reduces
risk of name collisions, and ensures consistency across referenced models to
prevent build mismatches.
2026-04-25 11:53:24 -03:00
canisio
f9a2eff397 validate sine over bypass using a post processing script in the logged data. Added folter post_processing and script checkTimeSamples 2026-04-25 11:28:43 -03:00
canisio
2f5a466ace Visualization blocks, rate changed to TsSW/nFrames 2026-04-24 17:31:17 -03:00
canisio
ff3aa5e89f Revert "Created valid_out for conter input test"
This reverts commit a7e710b603.
2026-04-24 17:25:45 -03:00
canisio
a7e710b603 Created valid_out for conter input test 2026-04-24 16:36:13 -03:00
canisio
c10736a5d7 AXI4-S2Software>Main>Advanced>Interconnect: Data width (bits) changed to 128 2026-04-24 12:14:14 -03:00
canisio
2b7d05b3d9 FPGA Packer: Changed to uint128, changed endianess order of packing (selectors 4,3,2,1) 2026-04-24 11:59:16 -03:00
canisio
4cbe3b5699 renamed array plots os gm model 2026-04-24 11:33:15 -03:00
canisio
bbf87121f0 changed to upper and lower halves after stream read. No difference (only first lane of 4x1 being read) 2026-04-23 15:26:22 -03:00
canisio
525a5f65e5 unchecked "enable sample packing" on signal attributes of AXI4-stream to software 2026-04-23 08:53:01 -03:00
canisio
9a7a05f450 stream read read only first sample of [4 x 1] bundle 2026-04-22 16:38:16 -03:00
canisio
0df1044d13 Input test counter moved to Rx Subsystem 2026-04-22 14:37:28 -03:00
canisio
f5ec4e6b6e sine and channelizer appear to work on board. Need to move counter to Rx to fully validate sample order 2026-04-22 12:29:13 -03:00
canisio
293b0e6c50 Updated memory mapped addresses 2026-04-22 10:45:07 -03:00
canisio
9a0404f1a9 4 dalay on the signals of bypass to align test counter to frame start. Appears to be working. Test on board. 2026-04-22 10:30:14 -03:00
canisio
6098d86851 problem on the bypass sample counter: if delay sof,eof,vali on FSM input ok for counter but wrong for channelizer 2026-04-21 18:00:44 -03:00
canisio
4ad5c3c5ea appear to be working with 4 daley after multi-frame capture. Problem is on visualization, 2026-04-21 16:19:43 -03:00
canisio
4b1b94c424 Added counter mode as input, real part = sample counter, imag part = frame counter. Reset on software trigger 2026-04-21 12:25:21 -03:00
canisio
78a7d1ae68 updated interface model. Still not working 2026-04-21 10:00:38 -03:00
canisio
97d5494781 updated gm_top_sw. Runs on board, but capture is not in sync 2026-04-20 17:10:59 -03:00
canisio
7f369d8692 runs on the board. But capture is not in sync 2026-04-20 17:09:57 -03:00
canisio
286c464f5a set SoCData as datatype again on the stream read inport (I dont know if this was the problem, but its working again) 2026-04-20 15:04:14 -03:00
canisio
91b02cdc79 organized register... stopped working 2026-04-20 11:53:26 -03:00
canisio
0b1dc081e5 commented display on PS, before testing in the board 2026-04-20 10:51:08 -03:00
canisio
d8fe924f6e tests before trying in the board 2026-04-20 10:49:21 -03:00
canisio
b2ce956f41 Multi-frame capture integrated into full design with trigger-controlled DPW; AXI stream (uint32 [4x1]) and DMA framing aligned; fixed FSM termination condition (no overflow); validated end-to-end (PL→DMA→PS) using counter input for multiple nFrames 2026-04-17 17:03:34 -03:00
canisio
fc50e71ab5 AXI stream updated to uint32 [4x1] format; samples-per-frame aligned to nFrames×512; PS stream read configured accordingly; single-frame (nFrames=1) validated end-to-end (PL→DMA→PS) with correct unpacking and data integrity 2026-04-17 12:22:12 -03:00
canisio
ce87190fba If sw side of AXI4-Stream to Software block is set to fixdt(128), frames appear to be arriving correctly on PS. However, reinterpretation is failing when using option "uint32" 2026-04-17 11:33:18 -03:00
canisio
cb56e78923 changed folder name for all testbench models 2026-04-17 08:31:14 -03:00
canisio
a3d46a9113 New register MF_nFrames added to PS (initialize and data genearation/capture). Not tested 2026-04-16 17:35:10 -03:00
canisio
15f20619b1 MultiFrame camputre PL part integrated (no test, no PS) 2026-04-16 17:25:28 -03:00
canisio
88e9df3dbb Multi-frame capture (trigger-controlled DPW) validated in testbench; added 128-bit packer replacing serializer, correct unpacking (SI reinterpret) and frame reconstruction verified (counter + PFB); implemented VALID gating (zero when idle) and AXI-aligned pipelining; nFrames parameterized in TB 2026-04-16 16:44:44 -03:00
canisio
beb5410390 added visualisation to validate ouput of multiple frames 2026-04-16 11:56:25 -03:00
canisio
2b8f8de030 Validation of multiframe on TBm_capture done. 2026-04-15 17:52:09 -03:00
canisio
9fd110f451 Replace serializer with 128-bit packer and add MultiFrameCapture (testbench)
Removed FIFO serializer and implemented 128-bit AXI packing (4 samples/beat)
Added initial MultiFrameCapture FSM
Validated with counter input
Sine/channelizer validation pending (frame interpretation update needed)
2026-04-14 17:56:57 -03:00
canisio
aad231b55a AXI with 128 bits and no serializer appears to be working 2026-04-14 16:46:18 -03:00
canisio
3748b65872 implemented sample packer to construct 128 AXI. Partially working (only bypass works?) 2026-04-14 12:25:01 -03:00
canisio
d83006c50c Added counter as input for the TBm_capture 2026-04-14 10:32:02 -03:00
canisio
5e5bba3ce6 Stable 16-bit Q1.15 Rx chain before AXI width upgrade 2026-04-14 09:25:01 -03:00
canisio
ccc6b9cd73 Validate 16-bit Q1.15 Rx chain (baseline, partial validation)
Standardized ADC/DAC and channelizer input to fixdt(1,16,15)
Rescaled channelizer output from sFix25_En23 to 16-bit complex
Verified channelizer path and spectrum behavior in full simulation
Bypass path and datatype tuning (coefficients/output) pending validation
2026-04-13 17:47:08 -03:00
canisio
f221e14c2c updated Rx documentation 2026-04-13 16:47:42 -03:00
canisio
a01186484e Rx: standardize to Q1.15 and reduce channelizer output to 32-bit complex
- ADC/DAC set to fixdt(1,16,15)
- Channelizer output scaled from sFix25_En23 to Q1.15
- Data width reduced from 50b to 32b
- Validated channelizer and bypass paths

Model: TBm_capture.slx
2026-04-13 16:47:25 -03:00
canisio
4241699c3d TBm_caputre. changed PFB internals and output datatype 2026-04-09 12:43:32 -03:00
canisio
d4e53a67ee Stable single frame (512 samples) baseline before capture redesign 2026-04-09 09:27:44 -03:00
canisio
2e570cee8b Created folder and test bench model for new capture block. Copied from current version. 2026-04-08 15:50:59 -03:00
canisio
f8edb31dc2 updated doc: Tx subsystem 2026-04-08 15:04:15 -03:00
canisio
520a37f520 CW mode integrated to design 2026-04-08 15:00:47 -03:00
canisio
cd91e3066b added CW mode (with LFM) to the chirp block (TB, not integrated yet) 2026-04-08 12:19:03 -03:00
canisio
5a3bc8891d cleaned up log signals (still not working) 2026-04-07 09:26:50 -03:00
canisio
fdde9ec62b Initiliaze funcion back to 1 (in the toggle registers). Still not working 2026-04-06 17:39:05 -03:00
canisio
84b795203a pulse generator integrated but not working 2026-04-06 16:16:42 -03:00
canisio
ada7e324cd Fixed register address on "update parameters" 2026-04-06 15:15:55 -03:00
canisio
7813d9744c Modified PS part and interface towards pulse generation integration 2026-04-06 12:26:06 -03:00
canisio
05b74503dc Fixed init callback for pulse gen testbench 2026-04-06 10:45:21 -03:00
canisio
72b9a34db9 Ready to move from sine to pulse generator (Tx Subsystem) 2026-04-06 10:23:23 -03:00
canisio
3c6ae0cfe9 finished organization of init funcions and parameters 2026-04-04 16:05:17 -03:00
canisio
eb14676581 Oganize preload and init functions and parameters (ongoing) 2026-04-04 15:16:58 -03:00
canisio
040834d511 added docs folder to project path.
tested remotely. OK
2026-04-03 20:47:13 -03:00
canisio
a92709b500 Added bypass of channelizer to the documentation 2026-04-02 17:39:01 -03:00
canisio
27ec12161c detailed subsystems 2026-04-02 17:36:23 -03:00
canisio
5caaa7fd9a updated README 2026-04-02 17:32:03 -03:00
canisio
ea0ecefae1 Added documentation and updated README 2026-04-02 17:29:24 -03:00
canisio
e810145620 Pulse Generator TB validated 2026-04-02 17:08:44 -03:00
canisio
a82aed0d5a Changed NCO to complex on TBm_chirp 2026-04-02 16:43:03 -03:00
canisio
62ab58b741 Changed Update parameter subsystem on chirp TB to pulse fc and pulse BW. 2026-04-02 16:28:41 -03:00
canisio
8e397fa41e Added draft to TBm_chirp model. Added init function script to testbench 2026-04-02 12:03:59 -03:00
canisio
790c2fdb37 added placeholder for chirp block 2026-04-01 12:05:57 -03:00
canisio
872fbfcd6e Minor changes 2026-04-01 11:51:59 -03:00
canisio
9794b2d540 tested on HW. Bypass ok. 2026-03-31 18:47:13 -03:00
canisio
b72a8cd616 added time scope to interface 2026-03-31 18:00:27 -03:00
canisio
f66c3ffd06 Changed interface model to reflect bypass 2026-03-31 17:51:26 -03:00
canisio
0c6938bff2 commented initialize register on proc model 2026-03-31 17:25:01 -03:00
canisio
66ad6149e6 Added switch and led (physical) 2026-03-31 16:41:27 -03:00
canisio
a9b4ad9e17 Added bypass toggle via memory mapped register 2026-03-31 16:17:34 -03:00
canisio
0ea6881d1e Added bypass to Rx on FPGA. Test OK 2026-03-31 15:55:46 -03:00
canisio
278e318715 Added simulink model to testbench bypass funcion (bypass folder) 2026-03-31 14:26:45 -03:00
canisio
e0765a6afe Added bypass funcion and its testbench (bypass folder) 2026-03-31 14:25:43 -03:00
canisio
dd70d58f2a Added frtt_codegen folder to the project initialization 2026-03-31 09:19:28 -03:00
canisio
d8a9e026ff Added testbench for simulink model. Added f0 option to both testbenches 2026-03-30 16:01:46 -03:00
canisio
1613ae8ad9 Ran codegen for mex and tested. Working ok 2026-03-30 11:44:31 -03:00
canisio
7b04d52204 Added frft functions towards codegen (c code on PS) 2026-03-30 11:16:12 -03:00
canisio
30b31509c1 Updated README 2026-03-30 09:30:16 -03:00
canisio
10644b0475 added README 2026-03-27 18:41:29 -03:00
canisio
43f91b281b Tested on board. Running ok. Updated interface model and added shortcut to it. 2026-03-27 17:52:13 -03:00
canisio
89ecf79e61 Added comment os PS system. Info from training says the time-driven tasks are all inside the processor block, except the event driven and the initialize 2026-03-27 17:17:28 -03:00
117 changed files with 1449 additions and 30 deletions

92
README.md Normal file
View File

@@ -0,0 +1,92 @@
# 📡 RFSoC Channelizer + PS Processing (R-ESM Prototype)
## Overview
This project is based on the RFSoC SoC Blockset reference design, adapted as a prototype for a Radar Electronic Support Measures (R-ESM) receiver.
The system implements a high-throughput signal chain in the FPGA (PL) and performs frame-based processing in the processor (PS).
---
## Current Status
- Tx subsystem: LFM pulse generator (DDS-based, complex output)
- Rx subsystem: fully functional channelizer pipeline (PFB-based) or bypass
- PL → PS interface: AXI4-Stream + DMA operational
- PS processing: frame-based algorithm on a Data Process Window (DPW)
---
## System Architecture
Tx (PL)
→ Waveform Generator (LFM / CW / Pulsed)
→ DAC
→ RF Loopback / Input
Rx (PL)
→ ADC
→ Channelizer (PFB, 512 bins) / Bypass / Counter
→ Capture (frame control)
→ AXI4-Stream (128-bit, 4 samples/clock)
→ DMA (S2MM)
→ PS Memory
→ Processor Algorithm
Post Processing (PS)
→ Triggered Capture
→ Sample Unpacking (I/Q)
→ Data Reshaping → [FrameSize x nFrames x nTriggers]
→ Host Communication / Processing / Visualization
→ One DPW is a windows of FrameSize x nFrames samples
---
## Key Parameters
- ADC Sampling Rate: 4096 MSPS
- Decimation: 8
- Effective BW: 512 MHz
- Channels (FFT size): 512
- Samples per clock: 4
- FPGA clock: 128 MHz
- Frame size (PS): 512 samples
---
## 📚 Documentation
### FPGA (PL)
- [Tx Subsystem (Pulse Generator)](docs/pl_tx_subsystem.md)
- [Rx Subsystem (Channelizer)](docs/pl_rx_subsystem.md)
### Processor (PS)
- [PS Subsystem](docs/ps_subsystem.md)
---
## System Flow
Tx → Rx → PS
- Tx generates waveform
- Rx captures and channelizes
- PS processes frames
---
## Roadmap
1. Functional FrFT (PS)
2. Profiling
3. NEON optimization
4. Throughput tuning
5. PL acceleration
---
## Key Takeaway
First make it work end-to-end, then make it fast.

BIN
block_bypass/TBm_bypass.slx Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,142 @@
%% FrFT Validation Script (Reference vs Original)
% Author: Canisio Barth
clear; clc; close all;
%% Parameters
Fs = 512e6; % Sampling rate
T = 1e-6; % Signal duration
N = Fs*T; % 512 samples
n = (0:N-1).';
t = (n - N/2)/ Fs;
% Beta range (Hz/s)
betas = (-32e12 : 8e12 : 32e12);
% Order sweep (for heatmap)
a_vec = linspace( 0.5, 1.5, 100);
% Center frequency
f0 = 0e6; % center frequency (Hz) set as needed
%% ============================================================
%% A) HEATMAP (single chirp, order sweep)
%% ============================================================
beta0 = 64e12; % pick one chirp for visualization
% Generate LFM chirp
x = exp(1j*(2*pi*f0*t + pi*beta0*t.^2));
% External interpolation (IMPORTANT)
x_interp = bizinter(x);
N_interp = length(x_interp);
N_out = N_interp/2; % after decimation
% Allocate
FrFT_map_ref = zeros(N_out, length(a_vec));
FrFT_map_cmp = zeros(N_out, length(a_vec));
for k = 1:length(a_vec)
a = a_vec(k);
% Reference
y_ref = fracF_ref(x_interp, a);
%y_ref = fracF_cg(x_interp, a);
% Comparison (original / other implementation)
%y_cmp = fracF_cg(x_interp, a);
y_cmp = fracF_cg_mex(single(x_interp), single(a));
FrFT_map_ref(:,k) = y_ref;
FrFT_map_cmp(:,k) = double(y_cmp);
end
% Global relative error
rel_err_global = norm(FrFT_map_ref(:) - FrFT_map_cmp(:)) / ...
norm(FrFT_map_ref(:));
fprintf('Global relative error: %.3e\n', rel_err_global);
% Plot - Reference
figure;
imagesc(a_vec, -N_out/2:N_out/2-1, abs(FrFT_map_ref) / sqrt(N));
axis xy;
xlabel('Order a');
ylabel('Index');
title('FrFT Magnitude (Reference)');
colorbar;
% Plot - Comparison
figure;
imagesc(a_vec, -N_out/2:N_out/2-1, abs(FrFT_map_cmp) / sqrt(N));
axis xy;
xlabel('Order a');
ylabel('Index');
title('FrFT Magnitude (Comparison)');
colorbar;
% Plot - Difference
figure;
rel_err_map = abs(FrFT_map_ref - FrFT_map_cmp) ./ ...
(abs(FrFT_map_ref) + eps);
imagesc(a_vec, -N_out/2:N_out/2-1, rel_err_map);
axis xy;
xlabel('Order a');
ylabel('Index');
title('Absolute Difference |Ref - Cmp|');
colorbar;
%% ============================================================
%% B) PEAK VS BETA (matched order)
%% ============================================================
peak_ref = zeros(size(betas));
peak_cmp = zeros(size(betas));
for i = 1:length(betas)
beta = betas(i);
% Generate chirp
x = exp(1j*(2*pi*f0*t + pi*beta*t.^2));
% External interpolation
x_interp = bizinter(x);
% Matched order
a = -(2/pi)*atan(Fs/(beta*T));
% Compute FrFT
y_ref = fracF_ref(x_interp, a);
%y_ref = fracF_cg(x_interp, a);
%y_cmp = fracF_cg(x_interp, a);
y_cmp = fracF_cg_mex(single(x_interp), single(a));
% Normalized peak magnitude
peak_ref(i) = max(abs(y_ref)) / sqrt(N);
peak_cmp(i) = max(abs(y_cmp)) / sqrt(N);
end
% Plot peaks
figure;
plot(betas/1e12, peak_ref, 'o-', 'LineWidth', 1.5); hold on;
plot(betas/1e12, peak_cmp, 's--', 'LineWidth', 1.5);
xlabel('\beta (MHz/\mus)');
ylabel('Peak Magnitude');
title('Peak vs Chirp Rate');
legend('Reference','Comparison');
grid on;
% Plot relative error
figure;
rel_err = abs(peak_ref - peak_cmp) ./ peak_ref;
plot(betas/1e12, rel_err, 'o-', 'LineWidth', 1.5);
xlabel('\beta (MHz/\mus)');
ylabel('Relative Error');
title('Relative Error between Implementations');
grid on;

Binary file not shown.

37
codegen_frft/bizinter.m Normal file
View File

@@ -0,0 +1,37 @@
function xint=bizinter(x)
N=length(x);
im = 0;
if sum(abs(imag(x)))>0
im = 1;
imx = imag(x);
x = real(x);
end
x2=x(:);
x2=[x2.'; zeros(1,N)];
x2=x2(:);
xf=fft(x2);
if rem(N,2)==1 %N = odd
N1=fix(N/2+1); N2=2*N-fix(N/2)+1;
xint=2*real(ifft([xf(1:N1); zeros(N,1) ;xf(N2:2*N)].'));
else
xint=2*real(ifft([xf(1:N/2); zeros(N,1) ;xf(2*N-N/2+1:2*N)].'));
end
if ( im == 1)
x2=imx(:);
x2=[x2.'; zeros(1,N)];
x2=x2(:);
xf=fft(x2);
if rem(N,2)==1 %N = odd
N1=fix(N/2+1); N2=2*N-fix(N/2)+1;
xmint=2*real(ifft([xf(1:N1); zeros(N,1) ;xf(N2:2*N)].'));
else
xmint=2*real(ifft([xf(1:N/2); zeros(N,1) ;xf(2*N-N/2+1:2*N)].'));
end
xint = xint + 1j*xmint;
end
xint = xint(:);
end

80
codegen_frft/fracF_cg.m Normal file
View File

@@ -0,0 +1,80 @@
function F = fracF_cg(f, a)
%#codegen
%% fracF_cg Fractional Fourier Transform (FrFT) - codegen-ready version
%
% Author: Canisio Barth
%
% F = fracF_cg(f, a) computes the Fractional Fourier Transform (FrFT)
% of the input signal 'f' for a single transform order 'a'.
%
% This version is adapted for MATLAB Coder and hardware-oriented workflows.
%
% Key characteristics:
% - Fixed input size: [1024 x 1] complex(single)
% - Output size: [512 x 1] complex(single)
% - Assumes input 'f' is already interpolated externally
% - No input validation (assumes valid scalar 'a' in core region)
% - Deterministic execution (no branching, no dynamic allocation)
%
% INPUTS:
% f - [1024 x 1] complex(single)
% a - scalar single
%
% OUTPUTS:
% F - [512 x 1] complex(single)
%
% Notes:
% - Internal FFT size = 2048
% - Designed for code generation and future FPGA mapping
% Fixed sizes
N = 1024;
%N2 = 512;
Nfft = 2048;
% Ensure types
pi_s = single(pi);
% Transform parameter
phi = a * (pi_s / 2);
% Precompute trig terms
tan_half_phi = tan(phi / 2);
sin_phi = sin(phi);
cos_phi = cos(phi);
csc_phi = 1 / sin_phi;
cot_phi = cos_phi / sin_phi;
twoDelta = 2 * sqrt(single(N) / 2);
%% === Chirp A ===
n = single((-N/2:N/2-1).') / twoDelta;
Achirp = exp(-1j * pi_s * (n .* n) * tan_half_phi);
%% Chirp multiplication #1
g = Achirp .* f;
%% === Chirp B ===
m = single((-N:N-1).') / twoDelta;
Bchirp = exp(1j * pi_s * csc_phi .* (m .* m));
%% === Zero-padded buffer ===
g_pad = complex(zeros(Nfft,1,'single'));
g_pad(1:N) = g;
%% === FFT convolution ===
G = ifft( fft(g_pad) .* fft(Bchirp) );
%% Extract valid part and decimate
G_valid = G(N+1:2:end); % [512 x 1]
%% Complex phase constant
Aphi = sqrt(1 - 1j * cot_phi);
%% === Chirp multiplication #2 ===
F = (Aphi / twoDelta) .* G_valid .* Achirp(1:2:end);
end

77
codegen_frft/fracF_ref.m Normal file
View File

@@ -0,0 +1,77 @@
function [F] = fracF_ref(f, a)
%% fracF_ref Reference Fractional Fourier Transform (FrFT) implementation
%
% Author: Canisio Barth
%
% F = fracF_ref(f, a) computes the Fractional Fourier Transform (FrFT)
% of the input signal 'f' for a single transform order 'a'.
%
% This function serves as a reference (golden model) for validation and
% comparison against future code generation and hardware-oriented
% implementations.
%
% Key characteristics:
% - Scalar transform order 'a' (no vector support).
% - Assumes input signal 'f' is already interpolated externally.
% - Maintains original algorithm structure, including internal
% decimation after convolution.
% - Uses full MATLAB flexibility (not yet restricted for codegen).
%
% INPUTS:
% f - Input signal, [N x 1] column vector.
% IMPORTANT: 'f' must already be interpolated (expanded signal).
%
% a - Scalar transform order.
% Expected to satisfy: 0.5 < |a| < 1.5
%
% OUTPUTS:
% F - Fractional Fourier Transform, [(N/2) x 1] column vector.
% (Decimated output, consistent with original algorithm.)
%
% LIMITATIONS:
% - No internal interpolation is performed.
% - Only valid for scalar 'a'.
% - Assumes caller enforces correct parameter range and signal format.
%
% See also: fracF (Ozaktas)
% Validate scalar 'a'
if ~isscalar(a)
error('Parameter ''a'' must be scalar.');
end
% Range check (core region)
if abs(a) < 0.5 || abs(a) > 1.5
error('Parameter ''a'' must be within the interval [0.5, 1.5].');
end
N = length(f); % already interpolated length
% Transform parameter
twoDelta = 2 * sqrt(N/2);
phi = a * pi / 2;
% === Chirp A ===
n = ((-N/2:N/2-1) / twoDelta).';
Achirp = exp(-1j * pi * (n .* n) * tan(phi/2));
% Chirp multiplication #1
g = Achirp .* f;
% === Chirp B ===
m = ((-N:N-1) / twoDelta).';
Bchirp = exp(1j * pi * csc(phi) .* (m .* m));
% === Chirp convolution ===
G = ifft(fft([g; zeros(N,1)]) .* fft(Bchirp));
% Extract valid part and decimate
G = G(end/2+1:2:end);
% Complex phase constant
Aphi = sqrt(1 - 1j * cot(phi));
% === Chirp multiplication #2 ===
F = (Aphi / twoDelta) .* G .* Achirp(1:2:end);
end

144
docs/pl_rx_subsystem.md Normal file
View File

@@ -0,0 +1,144 @@
# 📡 PL Rx Subsystem (Channelizer)
[🏠 Project Home](../README.md)
---
## Overview
The Rx subsystem implements a **polyphase filter bank (PFB) channelizer** followed by FFT processing, a **bypass path**, and a **multi-frame capture pipeline**.
It converts wideband ADC input into frequency-domain channels (or raw samples via bypass) and streams the result to the PS.
---
## Architecture
### Channelizer Path (default)
ADC
PFB Channelizer (Decimation + Filtering)
FFT (512 bins)
Capture (frame control)
AXI4-Stream (128-bit, 4 samples/clock)
DMA
---
### Bypass Path (Debug / Raw Data)
ADC
Bypass Path
Capture (frame control)
AXI4-Stream (128-bit, 4 samples/clock)
DMA
---
## Capture Pipeline
- Multi-frame acquisition (configurable nFrames)
- Frame size: 512 samples
- Supports asynchronous capture start (not frame-aligned)
- TLAST asserted at frame boundaries
### Behavior
- First frame may be partial
- Frames may contain ≤ 2 frame indices (expected)
- DPW spans nFrames frames but covers nFrames + 1 frame regions
---
## Processing Chain (Channelizer Mode)
### ADC Input
- Sampling rate: 4096 MSPS
- Data type: **fixdt(1,16,15)** (Q1.15)
### PFB Channelizer
- Decimation: 8
- Effective bandwidth: 512 MHz
### FFT
- Size: 512
- Produces frequency bins
### Capture
- Defines frame boundaries (512 samples)
- Generates TLAST
---
## Numeric Format and Scaling
### System Standardization
- End-to-end Q1.15 (**fixdt(1,16,15)**)
### Channelizer Output Scaling
- Native: **sFix25_En23**
- Quantized to: **fixdt(1,16,15)** (round + saturate)
---
## Data Packing (Updated)
- 4 samples per clock
- Each sample: complex (16-bit real + 16-bit imag)
- Packed into **128-bit AXI4-Stream word**
Benefits:
- Matches datapath parallelism
- Efficient DMA transfers
- Eliminates need for serializer stage
---
## AXI4-Stream Output
- Width: 128 bits
- Contains 4 complex samples per cycle
- TLAST = frame boundary
---
## Debug / Validation Features
A counter-based debug mode is implemented:
- Real part → sample counter (0..511)
- Imag part → frame index
Used to validate:
- Sample continuity
- Frame boundaries
- DMA ordering and integrity
---
## Key Characteristics
- Fully streaming pipeline
- Deterministic latency
- High throughput (4 samples/clock)
- Dual-mode operation (channelizer / bypass)
- Validated up to nFrames = 1024
---
## 🔗 Related Components
- [🏠 Project Home](../README.md)
- [PL Tx Subsystem](pl_tx_subsystem.md)
- [PS Subsystem](ps_subsystem.md)

177
docs/pl_tx_subsystem.md Normal file
View File

@@ -0,0 +1,177 @@
# 📡 PL Tx Subsystem (Pulse & Continuous LFM Generator)
[🏠 Project Home](../README.md)
---
## Overview
The Tx subsystem implements a **pulse-based and continuous Linear Frequency Modulated (LFM) chirp generator** using a DDS/NCO architecture in the FPGA (PL).
The generator produces **complex baseband output**:
x[n] = exp(j·φ[n])
and operates deterministically in the PL after a trigger from the PS.
---
## Architecture
TxPulseStart (PS)
pulse_gen_ctrl (FSM)
tx_active
Phase Increment Logic
NCO (DDS)
Complex Output (I/Q)
---
## Operating Modes
The subsystem now supports multiple Tx modes:
### 1. Pulsed LFM (default)
- Chirp generated only during pulse window
- Phase resets at each pulse start
- Standard radar burst operation
---
### 2. CW Mode (Continuous Wave)
- `tx_active = 1` continuously
- Generates a single-tone output
- Achieved by setting constant phase increment
---
### 3. Continuous LFM (Workaround Implementation)
- `tx_active` forced HIGH continuously
- A **1-cycle LOW pulse** is inserted periodically
- This LOW→HIGH transition **resets the NCO**
Result:
- Continuous chirp
- Bounded bandwidth
- Periodic repetition of LFM
---
## Chirp Generation Principle
The chirp is generated using a second-order phase accumulator:
Δφ[n] = Δφ[n1] + step
φ[n] = φ[n1] + Δφ[n]
This results in a linear frequency sweep.
---
## Parameterization (PS → PL)
Inputs:
- Center frequency: Fc
- Bandwidth: B
- Pulse width: N (samples)
Derived internally:
f_start = Fc B/2
step = B / (N 1)
These values are converted to DDS phase increments before being written to PL registers.
---
## Pulse Timing (FSM)
States:
- IDLE: waits for trigger and latches parameters
- ACTIVE: generates pulses
- DONE: waits for trigger reset
---
## Timing Behavior
### Pulsed Mode
|<------ PRI ------>|
|<-- pulse -->| idle |
- tx_active = 1 → chirp output
- tx_active = 0 → output zero
---
### Continuous LFM Mode
tx_active behavior:
1 1 1 1 1 0 1 1 1 1 ...
- 1-cycle LOW inserted at end of chirp period
- Rising edge resets NCO
- Defines chirp repetition interval
---
## CW / Continuous LFM Implementation Details
- CW mode bypasses FSM output
- A dedicated counter generates periodic reset pulses
- Reset timing is based on `pulse_width_cycles`
Important:
- Reset pulse is exactly **1 clock cycle**
- Ensures deterministic NCO restart
- Decoupled from PRI/FSM timing
---
## Burst Trigger (PS Interaction)
- Controlled via TxPulseStart (memory-mapped register)
- Rising edge triggers burst
- PL runs autonomously afterward
---
## Key Characteristics
- Deterministic timing (128 MHz)
- Efficient DDS (adder-based)
- Complex output (I/Q)
- Supports:
- Pulsed radar mode
- Continuous wave (CW)
- Continuous LFM (periodic chirp)
---
## Design Notes
- FSM controls **timing (when to transmit)**
- NCO controls **frequency evolution**
- Continuous LFM implemented via **tx_active edge reuse**
- Minimal hardware overhead (no additional NCO logic)
---
## 🔗 Related Components
- [🏠 Project Home](../README.md)
- [PL Rx Subsystem](pl_rx_subsystem.md)
- [PS Subsystem](ps_subsystem.md)

140
docs/ps_subsystem.md Normal file
View File

@@ -0,0 +1,140 @@
# 🧠 PS Subsystem (Control + Capture + Processing)
[🏠 Project Home](../README.md)
---
## Overview
The PS subsystem is responsible for:
- System initialization
- Configuring PL subsystems
- Triggering captures
- Receiving data via DMA
- Preparing data for processing and visualization
The current implementation acts as a **placeholder for post-processing**, focusing on reliable data acquisition and host interaction.
---
## Responsibilities
### Control & Initialization
- Configure PL parameters:
- Tx waveform configuration
- Capture parameters (nFrames, etc.)
- Initialize DMA and memory buffers
- Manage system startup
---
### Trigger & Capture
- Generates capture trigger (software-controlled)
- Controls DPW acquisition timing
- Each trigger initiates one DPW capture
---
### DMA Handling
- AXI4-Stream → DMA (S2MM)
- Receives **128-bit stream** (4 samples per clock)
- Stores data in PS DDR memory
Configuration:
- Frame size: 512 samples
- nFrames: configurable (validated up to 1024)
---
## Data Format
### Raw DMA Data
- Packed complex samples
- 16-bit real + 16-bit imag per sample
- 4 samples per 128-bit word
---
### Processing Representation
Data is unpacked and reshaped into:
```
[FrameSize x nFrames x nTriggers]
```
---
## Processing Pipeline (Current)
DMA
→ Unpack samples (I/Q separation)
→ Convert to complex representation
→ Reshape into 3D structure
→ Visualization / basic analysis
---
## Validation Support
Uses counter-based validation:
- Real part → sample counter
- Imag part → frame index
Enables verification of:
- Data continuity
- Frame alignment
- Correct ordering from DMA
---
## Execution Model
- Triggered (event-based)
- Burst capture (DPW)
- Not continuous real-time streaming
---
## Performance Notes
- Designed for correctness and validation (not optimized)
- Bottleneck: unpacking + data movement
- Full-rate continuous processing not supported
---
## Role in System
The PS currently serves as:
- Control interface
- Data acquisition manager
- Pre-processing stage
Future implementations will replace the current processing with advanced algorithms (e.g., FrFT).
---
## Future Work
- FrFT-based processing
- Timestamp integration
- UDP streaming
- Optimization (NEON / vectorization)
- Metadata extraction (move complexity to PL)
---
## 🔗 Related Components
- [🏠 Project Home](../README.md)
- [PL Tx Subsystem](pl_tx_subsystem.md)
- [PL Rx Subsystem](pl_rx_subsystem.md)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="aux" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="soc_rfsoc_prj_startup.m" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="soc_rfsoc_preload.m" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="post_processing" type="File"/>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="soc_rfsoc_startup.m" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="soc_rfsoc_postload.m" type="File"/>

View File

@@ -1,2 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info Ref="" Type="Relative"/>

View File

@@ -1,2 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<Info location="7ac7702b-30c0-47d0-8a3a-1562b67f2ab5" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="block_pulsegen" Type="Relative"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="6a9c972f-52d5-42e0-8c82-940b26905df7" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="block_bypass" Type="Relative"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="f7229047-4926-407b-902a-a25e790af1a9" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="" Type="Relative"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="a92ac691-f104-48a3-8517-c0b00eec410f" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="utilities/aux" Type="Relative"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="ac65d1bc-e8fa-4056-83e4-eaba335b5aa3" type="Reference"/>

View File

@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="referencedmodels" Type="Relative"/>

View File

@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml version="1.0" encoding="UTF-8"?>
<Info location="15258b0d-3597-4917-9d8b-5ec7677aa528" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="block_capture" Type="Relative"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="c26ab781-2c03-423c-8199-bc6903e4e4f7" type="Reference"/>

View File

@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="utilities" Type="Relative"/>

View File

@@ -1,2 +1,2 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml version="1.0" encoding="UTF-8"?>
<Info location="082474f0-d7d9-423c-bb63-dc039b2ad79a" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="docs" Type="Relative"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="de23f5bc-2dc5-4828-b061-5d044a37a018" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info Ref="utilities/post_processing" Type="Relative"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="5bfc0575-1eef-448a-a3a2-ced40deb5860" type="Reference"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info description="RFSoC Channelizer + PS Processing (R-ESM Prototype)&#10;&#10;This project is based on the RFSoC SoC Blockset reference design, adapted as a prototype for a Radar Electronic Support Measures (R-ESM) receiver.&#10;&#10;The system implements a high-throughput signal chain in the FPGA (PL) and performs frame-based processing in the processor (PS)."/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="Information" type="Extension"/>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info File="utilities/soc_rfsoc_startup.m" GroupUUID="default" Icon="" Name="soc_rfsoc_startup" Type="StartUp" Visible="0">
<Info File="utilities/soc_rfsoc_prj_startup.m" GroupUUID="default" Icon="" Name="soc_rfsoc_startup" Type="StartUp" Visible="0">
<Extension Name="StartUpPrev" Value="HEAD"/>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="TBm_pulsegen.slx" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="1" type="DIR_SIGNIFIER"/>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="1" type="DIR_SIGNIFIER"/>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="1" type="DIR_SIGNIFIER"/>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="TBm_capture.slx" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="1" type="DIR_SIGNIFIER"/>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="TBm_bypass.slx" type="File"/>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="checkTimeSamples.m" type="File"/>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="checkFreqSamples.m" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="1" type="DIR_SIGNIFIER"/>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info>
<Category UUID="FileClassCategory">
<Label UUID="design"/>
</Category>
</Info>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="checkCounterSamples.m" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="block_pulsegen" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="README.md" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="block_capture" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="block_bypass" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="docs" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="ps_subsystem.md" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="pl_rx_subsystem.md" type="File"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info location="1" type="DIR_SIGNIFIER"/>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Info/>

Some files were not shown because too many files have changed in this diff Show More