Added testbench for simulink model. Added f0 option to both testbenches
This commit is contained in:
@@ -17,14 +17,17 @@ 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 = 8e12; % pick one chirp for visualization
|
||||
beta0 = 64e12; % pick one chirp for visualization
|
||||
|
||||
% Generate LFM chirp
|
||||
x = exp(1j*pi*beta0*t.^2);
|
||||
x = exp(1j*(2*pi*f0*t + pi*beta0*t.^2));
|
||||
|
||||
% External interpolation (IMPORTANT)
|
||||
x_interp = bizinter(x);
|
||||
@@ -59,7 +62,7 @@ fprintf('Global relative error: %.3e\n', rel_err_global);
|
||||
|
||||
% Plot - Reference
|
||||
figure;
|
||||
imagesc(a_vec, 1:N_out, abs(FrFT_map_ref) / sqrt(N));
|
||||
imagesc(a_vec, -N_out/2:N_out/2-1, abs(FrFT_map_ref) / sqrt(N));
|
||||
axis xy;
|
||||
xlabel('Order a');
|
||||
ylabel('Index');
|
||||
@@ -68,7 +71,7 @@ colorbar;
|
||||
|
||||
% Plot - Comparison
|
||||
figure;
|
||||
imagesc(a_vec, 1:N_out, abs(FrFT_map_cmp) / sqrt(N));
|
||||
imagesc(a_vec, -N_out/2:N_out/2-1, abs(FrFT_map_cmp) / sqrt(N));
|
||||
axis xy;
|
||||
xlabel('Order a');
|
||||
ylabel('Index');
|
||||
@@ -80,7 +83,7 @@ figure;
|
||||
rel_err_map = abs(FrFT_map_ref - FrFT_map_cmp) ./ ...
|
||||
(abs(FrFT_map_ref) + eps);
|
||||
|
||||
imagesc(a_vec, 1:N_out, rel_err_map);
|
||||
imagesc(a_vec, -N_out/2:N_out/2-1, rel_err_map);
|
||||
axis xy;
|
||||
xlabel('Order a');
|
||||
ylabel('Index');
|
||||
@@ -99,7 +102,7 @@ for i = 1:length(betas)
|
||||
beta = betas(i);
|
||||
|
||||
% Generate chirp
|
||||
x = exp(1j*pi*beta*t.^2);
|
||||
x = exp(1j*(2*pi*f0*t + pi*beta*t.^2));
|
||||
|
||||
% External interpolation
|
||||
x_interp = bizinter(x);
|
||||
BIN
frft_codegen/TBm_lfm_fracF.slx
Normal file
BIN
frft_codegen/TBm_lfm_fracF.slx
Normal file
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="TBc_lfm_fracF.m" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="frft_tb_lfm.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="TBm_lfm_fracF.slx" type="File"/>
|
||||
Binary file not shown.
Reference in New Issue
Block a user