An AT328 is nowhere near fast or accurate enough to do this.
You'll need some external hardware. Lots available.
Allan