Files
Zcu111ResmReceiver/utilities/soc_rfsoc_init.m
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

87 lines
1.8 KiB
Matlab

%% Derived from preload
fs_eff = fs_RF/IntDecFactor; % Effective fs before interpolation / after decimation
Ts_eff = 1/fs_eff;
%% Host Sample Time in Simulation
%TsHost = 5e-5;
FPGAClkRate = fs_eff/SamplesPerCycle;
TsFPGA = 1/FPGAClkRate;
%% Tx signal generator parameters
% NCO accumulator word length
NCOAccumWL = 16;
% NCO phase increment scale factor
NCOIncScale = Ts_eff*2^NCOAccumWL;
% NCO phase increments datatype
NCOIncDT = numerictype(1,NCOAccumWL,0);
% NCO counter increment datatype
NCOCountIncDT = numerictype(1,NCOAccumWL*2,NCOAccumWL);
%% Test signal parameters
% Pulse width
pulseWidth = 4e-6;
% Pulse start/end frequencies
pulseCentFreq = 0e6;
pulseBw = 0e6; % Pulse bandwidth
% Number of pulses
numPulses = 10;
% Pulse repetition interval
PRF = 20e3;
PRI = 1/PRF;
% CW mode (bypass pulse generation)
CwMode = true;
if CwMode
pulseWidth = 1000; % very long pulse help emulate CW
end
% Counter mode (bypass pulse and CW generation)
CounterMode = true;
% Output gain
pulseGenGain = 1;
%% Software parameters
% Signal generator update rate
TsSW = 0.5;
%% Simulation parameters
% Sim run time
%stoptime = TsFPGA*(9 + 1*348 + 1 + 2*128 + 1); %10*TsSW; %TsFPGA*(1*128+348)
%% Channelizer parameters
%Number of channels, maximally decimated channelizer M/D=1
nChan = 512;
%Taps per band
nTapsPerBand = 16;
%Create channelizer object
channelizer = dsp.Channelizer('NumFrequencyBands',nChan,...
'DecimationFactor',nChan,...
'NumTapsPerBand',nTapsPerBand);
%Channelizer coefficients
channelizerCoeffs = channelizer.coeffs.Numerator;
%Channel bandwidth
%chanBW = fs/nChan;
%Starting frequency for each channel
%chanFStart = chanBW/2:chanBW:(fs/2-chanBW/2);
%Number of frames in the DPW
nFrames = 1024;%nChan/SamplesPerCycle;
% Frame size after serializing x2
%frameSize = SamplesPerCycle/2;