
SampleTime = 1/128e6;

%% Create test vector for simulation
samplesPerClk = 2;
AxisDDRobj = SoCDDR4TransmitRepeatHelper;
AxisDDRobj.AXISFrameSize = streamWrFrameSize; % Add 1 for header packet
AxisDDRobj.SamplesPerClock = samplesPerClk*2; % As the data is complex, double the samples per clk


data_type = numerictype('WordLength',16,'FractionLength',0);
waveformSamples = waveformTxData(1:Tx_DDR4_NumSamples);
waveformSamples = 0.95 * waveformSamples / max(abs(waveformSamples));
waveformSamples = reinterpretcast(fi(waveformSamples, 1, 16, 15), data_type );
FrameTxObj = AxisDDRobj.AssembleTxFrame(waveformSamples); % in this process, some data may get truncated

[~, numFrames] = size(FrameTxObj.FrameBody);
waveformData = FrameTxObj.FrameBody(:);
AXI4ReadFrameSize = numel(waveformData);

fid = fopen('5GNRWave.bin', 'w');
fwrite(fid, uint64(waveformData), 'uint64');
fclose(fid);
clear fid;