I added a few blocks to your block diagram to meet your requirements

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/Hvpqc.png