How to sample a non-periodic signal using an Arduino Due?
The Arduino analogRead takes 100 microseconds per read.  That limits you to a sampling rate under 10kHz.  You will never reach your intended 20kHz sampling rate.
The Serial.println takes time.  Since you are using it in your sampling loop, it makes the time between samples longer. You will never reach the Arduino's theoretical 10kHz sampling rate.
The Due has a real analog output on DAC0 and DAC1, so you should be able to get a real signal out.  It can write about every 4 microseconds when using the analogwrite method.  That's about 10 times faster than the sampling rate of 20kHz that you were aiming for, and a great deal faster than you are really sampling.  Whatever you put out will be compressed in time compared to the original signal.
The signal you are looking at has pulses that are about .3 milliseconds long.  That's a frequency over 3kHz.   To sample it, you'll need well over 6000 samples per second.  Even if you were sampling at the full 10kHz the Arduino is capable of, it would just barely be able to resolve your signal.  It would look pretty much like a bunch of random wiggles around 3 or 4 samples wide.
Your signal seems to be transient.  It comes and then goes away.  Your Arduino program doesn't seem to wait for the signal to start (it has no trigger) so it is entirely possible that it never &quot;sees&quot; the signal at all.  It could be off doing DAC0 output every time your interesting signal occurs.

The Due is only marginally capable of what you want from it, and your programming technique is pushing the real performance even further from the meager reality.  Even if you got things perfect, you wouldn't be happy with the results.
You need to read and write the ports directly (bypassing the Arduino functions) and you need to use timers and interrupts instead of delays to time your sampling and play back. Reading and writing directly gets you much faster read and write response - you can actually read fast enough for what you need.  Using a timer driven interrupt to do your sampling means that the sampling rate is reliable and steady.
You might also switch to a faster, more capable microprocessor.  It won't be as convenient as the Arduino, but you'll have a better chance of accurately sampling your signal.

Just FYI:
The signal trace you showed did not come from a CRO. A CRO would be a &quot;cathode ray oscilloscope.&quot;  That refers to the huge vacuum tube display found in old fashioned oscilloscopes.
Your plot appears to come from a program on a PC reading from one of the headless USB oscilloscopes that are commonly (and cheaply) available.
For reference, this is a cathode ray oscilloscope:

The cathode ray tube is the green display.  It is only about 12 cm across, so the display area isn't huge.  The tube itself is over 30 cm long, though, the whole tube is slightly monstrous.
That's my oscilloscope.  Big, heavy cantankerous, hot.