function soc_ddr4datacapture_init(bdroot)
% Initialization fcn for the model. It sets the model-wide params
% which are derived based on sample rate.

% 'FrameSize and 'NumBuffers' variables are set during model
% PreLoadFcn callback into base workspace. These two variables should be
% changed directly at the MATLAB command

FrameSize = evalin('base','FrameSize');

dacSampleRate = get_param([bdroot '/RF Data  Converter'], 'dacSampleRate');
dacSampleRate = evalin('base', dacSampleRate)*1e6;
dacSamplesPerCycle = str2double(get_param([bdroot '/RF Data  Converter'], 'dacSamplesPerCycle'));
dacInterpolationMode = str2double(get_param([bdroot '/RF Data  Converter'], 'interpolationMode'));
streamClkFrequency = dacSampleRate/(dacSamplesPerCycle*dacInterpolationMode);

SampleTime = 1/streamClkFrequency;
TaskDuration = FrameSize*SampleTime - 1e-6;
NCOPhaseIncrScale = 2^14/(dacSampleRate/dacInterpolationMode);


% derived model-wide variables set into base workspace.
assignin('base','SampleTime', SampleTime);
assignin('base','TaskDuration',TaskDuration);
assignin('base','NCOPhaseIncrScale',NCOPhaseIncrScale);
end