validate sine over bypass using a post processing script in the logged data. Added folter post_processing and script checkTimeSamples
This commit is contained in:
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="post_processing" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="utilities/post_processing" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="5bfc0575-1eef-448a-a3a2-ced40deb5860" 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="checkTimeSamples.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"/>
|
||||
83
utilities/post_processing/checkTimeSamples.m
Normal file
83
utilities/post_processing/checkTimeSamples.m
Normal file
@@ -0,0 +1,83 @@
|
||||
%% =========================================================
|
||||
% Data
|
||||
% =========================================================
|
||||
X = single(complex_out.Data);
|
||||
|
||||
%% =========================================================
|
||||
% Parameters
|
||||
% =========================================================
|
||||
Fs = 512e6; % Sampling rate (Hz)
|
||||
N = 512; % Frame size
|
||||
|
||||
% Your data variable (rename if needed)
|
||||
% Expected size: [512 x 4 x 8]
|
||||
% X(frameSamples, frameIndex, timeIndex)
|
||||
% Example: X = your_workspace_variable;
|
||||
|
||||
[nSamples, nFrames, nTime] = size(X);
|
||||
|
||||
%% =========================================================
|
||||
% FFT Computation
|
||||
% =========================================================
|
||||
FFT_all = zeros(N, nFrames*nTime);
|
||||
|
||||
idx = 1;
|
||||
|
||||
for t = 1:nTime
|
||||
for f = 1:nFrames
|
||||
|
||||
x = X(:, f, t);
|
||||
|
||||
% Optional window (uncomment if needed)
|
||||
% w = hann(N);
|
||||
% x = x .* w;
|
||||
|
||||
Xf = fftshift(fft(x));
|
||||
FFT_all(:, idx) = abs(Xf);
|
||||
|
||||
idx = idx + 1;
|
||||
end
|
||||
end
|
||||
|
||||
%% =========================================================
|
||||
% Axes
|
||||
% =========================================================
|
||||
f_axis = (-N/2 : N/2-1) * (Fs/N) / 1e6; % MHz
|
||||
t_axis = 1:(nFrames*nTime); % frame index
|
||||
|
||||
%% =========================================================
|
||||
% Spectrogram-like view (BEST)
|
||||
% =========================================================
|
||||
figure;
|
||||
surf(t_axis, f_axis, 20*log10(FFT_all + 1e-12), 'EdgeColor', 'none');
|
||||
view(2);
|
||||
axis tight;
|
||||
|
||||
xlabel('Frame index');
|
||||
ylabel('Frequency (MHz)');
|
||||
title('FFT over time (per frame)');
|
||||
colorbar;
|
||||
|
||||
%% =========================================================
|
||||
% 3D Visualization (optional)
|
||||
% =========================================================
|
||||
figure;
|
||||
surf(t_axis, f_axis, FFT_all, 'EdgeColor', 'none');
|
||||
xlabel('Frame index');
|
||||
ylabel('Frequency (MHz)');
|
||||
zlabel('Magnitude');
|
||||
title('3D FFT evolution');
|
||||
|
||||
%% =========================================================
|
||||
% Single frame debug (optional)
|
||||
% =========================================================
|
||||
figure;
|
||||
x_dbg = X(:,1,1);
|
||||
Xf_dbg = fftshift(fft(x_dbg));
|
||||
|
||||
plot(f_axis, 20*log10(abs(Xf_dbg)+1e-12));
|
||||
grid on;
|
||||
|
||||
xlabel('Frequency (MHz)');
|
||||
ylabel('Magnitude (dB)');
|
||||
title('Single Frame FFT');
|
||||
@@ -49,7 +49,7 @@ pulseGenGain = 1;
|
||||
%% Software parameters
|
||||
|
||||
% Signal generator update rate
|
||||
TsSW = 0.001;
|
||||
TsSW = 0.5;
|
||||
|
||||
%% Simulation parameters
|
||||
|
||||
|
||||
Reference in New Issue
Block a user