Compare commits
40 Commits
43f91b281b
...
v1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4e53a67ee | ||
|
|
2e570cee8b | ||
|
|
f8edb31dc2 | ||
|
|
520a37f520 | ||
|
|
cd91e3066b | ||
|
|
5a3bc8891d | ||
|
|
fdde9ec62b | ||
|
|
84b795203a | ||
|
|
ada7e324cd | ||
|
|
7813d9744c | ||
|
|
05b74503dc | ||
|
|
72b9a34db9 | ||
|
|
3c6ae0cfe9 | ||
|
|
eb14676581 | ||
|
|
040834d511 | ||
|
|
a92709b500 | ||
|
|
27ec12161c | ||
|
|
5caaa7fd9a | ||
|
|
ea0ecefae1 | ||
|
|
e810145620 | ||
|
|
a82aed0d5a | ||
|
|
62ab58b741 | ||
|
|
8e397fa41e | ||
|
|
790c2fdb37 | ||
|
|
872fbfcd6e | ||
|
|
9794b2d540 | ||
|
|
b72a8cd616 | ||
|
|
f66c3ffd06 | ||
|
|
0c6938bff2 | ||
|
|
66ad6149e6 | ||
|
|
a9b4ad9e17 | ||
|
|
0ea6881d1e | ||
|
|
278e318715 | ||
|
|
e0765a6afe | ||
|
|
dd70d58f2a | ||
|
|
d8a9e026ff | ||
|
|
1613ae8ad9 | ||
|
|
7b04d52204 | ||
|
|
30b31509c1 | ||
|
|
10644b0475 |
79
README.md
Normal file
79
README.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# 📡 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)
|
||||
- PL → PS interface: AXI4-Stream + DMA operational
|
||||
- PS processing: frame-based algorithm (RMS + peak detection)
|
||||
|
||||
---
|
||||
|
||||
## System Architecture
|
||||
|
||||
ADC → Channelizer (PFB, 512 bins)
|
||||
→ FFT_Capture (frame control)
|
||||
→ FIFO Serializer (4 FIFOs → 1 stream)
|
||||
→ AXI4-Stream (uint64)
|
||||
→ DMA (S2MM)
|
||||
→ PS Memory
|
||||
→ Processor Algorithm
|
||||
|
||||
---
|
||||
|
||||
## 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
bypass_block/TBm_bypass.slx
Normal file
BIN
bypass_block/TBm_bypass.slx
Normal file
Binary file not shown.
BIN
capture_block/TBm_capture.slx
Normal file
BIN
capture_block/TBm_capture.slx
Normal file
Binary file not shown.
134
docs/pl_rx_subsystem.md
Normal file
134
docs/pl_rx_subsystem.md
Normal file
@@ -0,0 +1,134 @@
|
||||
# 📡 PL Rx Subsystem (Channelizer)
|
||||
|
||||
[🏠 Project Home](../README.md)
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The Rx subsystem implements a **polyphase filter bank (PFB) channelizer** followed by FFT processing.
|
||||
|
||||
It converts wideband ADC input into frequency-domain channels and streams the result to the PS.
|
||||
|
||||
A **bypass path** is also available for raw data inspection and debugging.
|
||||
|
||||
---
|
||||
|
||||
## Architecture
|
||||
|
||||
### Channelizer Path (default)
|
||||
|
||||
ADC
|
||||
↓
|
||||
PFB Channelizer (Decimation + Filtering)
|
||||
↓
|
||||
FFT (512 bins)
|
||||
↓
|
||||
FFT Capture
|
||||
↓
|
||||
FIFO Serializer (4 → 1)
|
||||
↓
|
||||
AXI4-Stream
|
||||
↓
|
||||
DMA
|
||||
|
||||
---
|
||||
|
||||
### Bypass Path (Debug / Raw Data)
|
||||
|
||||
ADC
|
||||
↓
|
||||
Bypass Path
|
||||
↓
|
||||
FIFO / Serializer
|
||||
↓
|
||||
AXI4-Stream
|
||||
↓
|
||||
DMA
|
||||
|
||||
---
|
||||
|
||||
## Bypass Functionality
|
||||
|
||||
The bypass allows direct observation of the input signal without channelization.
|
||||
|
||||
### Purpose
|
||||
|
||||
- Debugging and validation
|
||||
- Access to raw ADC-domain data
|
||||
- Comparison with channelized output
|
||||
- Verification of downstream processing
|
||||
|
||||
---
|
||||
|
||||
### Behavior
|
||||
|
||||
- Input data is routed directly to output
|
||||
- No filtering or FFT applied
|
||||
- Maintains same output interface (AXI4-Stream)
|
||||
|
||||
---
|
||||
|
||||
### Selection Mechanism
|
||||
|
||||
A selector signal chooses between:
|
||||
|
||||
- Channelizer output (normal operation)
|
||||
- Bypass output (raw data)
|
||||
|
||||
Implementation typically uses:
|
||||
- Parallel paths
|
||||
- Output switching logic
|
||||
|
||||
---
|
||||
|
||||
## Processing Chain (Channelizer Mode)
|
||||
|
||||
### ADC Input
|
||||
- Sampling rate: 4096 MSPS
|
||||
|
||||
### PFB Channelizer
|
||||
- Decimation: 8
|
||||
- Effective bandwidth: 512 MHz
|
||||
|
||||
### FFT
|
||||
- Size: 512
|
||||
- Produces frequency bins
|
||||
|
||||
### FFT Capture
|
||||
- Controls frame boundaries
|
||||
|
||||
### FIFO Serializer
|
||||
- Converts parallel streams into single stream
|
||||
|
||||
---
|
||||
|
||||
## AXI4-Stream Output
|
||||
|
||||
- Data type: uint64
|
||||
- Packed real/imag
|
||||
- TLAST = frame boundary
|
||||
|
||||
---
|
||||
|
||||
## Data Format
|
||||
|
||||
- Frame size: 512 samples
|
||||
- Complex values packed into uint64
|
||||
|
||||
---
|
||||
|
||||
## Key Characteristics
|
||||
|
||||
- Fully streaming pipeline
|
||||
- High throughput
|
||||
- Deterministic latency
|
||||
- Supports dual-mode operation (channelizer / bypass)
|
||||
|
||||
---
|
||||
|
||||
## 🔗 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
177
docs/pl_tx_subsystem.md
Normal 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] = Δφ[n−1] + step
|
||||
φ[n] = φ[n−1] + Δφ[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)
|
||||
85
docs/ps_subsystem.md
Normal file
85
docs/ps_subsystem.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# 🧠 PS Subsystem (Control + Processing)
|
||||
|
||||
[🏠 Project Home](../README.md)
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The PS subsystem is responsible for:
|
||||
|
||||
- Configuring PL subsystems
|
||||
- Receiving data via DMA
|
||||
- Performing frame-based processing
|
||||
|
||||
---
|
||||
|
||||
## Responsibilities
|
||||
|
||||
### Control
|
||||
|
||||
- Writes parameters to PL registers:
|
||||
- Tx generator configuration
|
||||
- Generates TxPulseStart trigger
|
||||
|
||||
---
|
||||
|
||||
### DMA Handling
|
||||
|
||||
- AXI4-Stream → DMA (S2MM)
|
||||
- Data stored in PS DDR
|
||||
|
||||
Configuration:
|
||||
- Frame size: 512
|
||||
- Buffers: 16
|
||||
|
||||
---
|
||||
|
||||
### Processing Pipeline
|
||||
|
||||
DMA → uint64[512]
|
||||
→ unpack real/imag
|
||||
→ convert to complex
|
||||
→ RMS + peak detection
|
||||
|
||||
---
|
||||
|
||||
## Execution Model
|
||||
|
||||
- Event-driven (DMA trigger)
|
||||
- No buffering queue
|
||||
- Frames may be dropped
|
||||
|
||||
---
|
||||
|
||||
## Performance Notes
|
||||
|
||||
- Bottleneck: unpacking + conversion
|
||||
- Cannot sustain full-rate input
|
||||
|
||||
---
|
||||
|
||||
## Interaction with PL
|
||||
|
||||
### Tx Control
|
||||
- Low-rate trigger (~Hz)
|
||||
- Starts burst generation
|
||||
|
||||
### Rx Data
|
||||
- Continuous high-rate stream
|
||||
|
||||
---
|
||||
|
||||
## Future Work
|
||||
|
||||
- Replace processing with FrFT
|
||||
- NEON optimization
|
||||
- Throughput improvements
|
||||
|
||||
---
|
||||
|
||||
## 🔗 Related Components
|
||||
|
||||
- [🏠 Project Home](../README.md)
|
||||
- [PL Tx Subsystem](pl_tx_subsystem.md)
|
||||
- [PL Rx Subsystem](pl_rx_subsystem.md)
|
||||
142
frft_codegen/TBc_lfm_fracF.m
Normal file
142
frft_codegen/TBc_lfm_fracF.m
Normal 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;
|
||||
BIN
frft_codegen/TBm_lfm_fracF.slx
Normal file
BIN
frft_codegen/TBm_lfm_fracF.slx
Normal file
Binary file not shown.
37
frft_codegen/bizinter.m
Normal file
37
frft_codegen/bizinter.m
Normal 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
frft_codegen/fracF_cg.m
Normal file
80
frft_codegen/fracF_cg.m
Normal 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
frft_codegen/fracF_ref.m
Normal file
77
frft_codegen/fracF_ref.m
Normal 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
|
||||
Binary file not shown.
BIN
pulsegen_block/TBm_pulsegen.slx
Normal file
BIN
pulsegen_block/TBm_pulsegen.slx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="TBm_capture.slx" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="TBc_lfm_fracF.m" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="fracF_cg.m" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="bizinter.m" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="fracF_ref.m" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="TBm_lfm_fracF.slx" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="aux" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="soc_rfsoc_prj_startup.m" type="File"/>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="soc_rfsoc_preload.m" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="soc_rfsoc_startup.m" type="File"/>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="soc_rfsoc_postload.m" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info Ref="" Type="Relative"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<Info location="7ac7702b-30c0-47d0-8a3a-1562b67f2ab5" type="Reference"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="bypass_block" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="088fd74d-4620-4cf8-826f-495fb91d19ae" type="Reference"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="capture_block" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="14d75155-da33-4258-97c9-15567dccec3d" type="Reference"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="a92ac691-f104-48a3-8517-c0b00eec410f" type="Reference"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="utilities/aux" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="ac65d1bc-e8fa-4056-83e4-eaba335b5aa3" type="Reference"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="pulsegen_block" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="e221a7ac-a0f0-4b2d-8909-e0ce275dca2e" type="Reference"/>
|
||||
@@ -1,2 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="referencedmodels" Type="Relative"/>
|
||||
@@ -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"/>
|
||||
@@ -1,2 +1,2 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="utilities" Type="Relative"/>
|
||||
@@ -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"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="docs" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="de23f5bc-2dc5-4828-b061-5d044a37a018" type="Reference"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="frft_codegen" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="7b5b7cf9-d79f-4236-86f3-d37f9b8a15b3" type="Reference"/>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="TBm_bypass.slx" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info description="RFSoC Channelizer + PS Processing (R-ESM Prototype) 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)."/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="Information" type="Extension"/>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="TBm_pulsegen.slx" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="1" type="DIR_SIGNIFIER"/>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="capture_block" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="frft_codegen" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="bypass_block" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="pulsegen_block" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="README.md" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="docs" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="ps_subsystem.md" type="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
Reference in New Issue
Block a user