Using the Matlab code as a reference have developed an open loop AGC. Equations as well as block diagram are provided below. Wondered how can this be converted into a closed loop structure.
Seems that the following is a more relevant design. https://sci-hub.tw/10.1109/fskd.2012.6234143 Will review further and update.