Hi,
try attached VI. It reallocates memory in every loop iteration so it shouldn't be used for long running applications because sooner or later application will run out of memory. Run attached code play with the input parameters. If you enable/disable additional noise to the signal you will clearly see what is the time relation between both signals.
BTW if this was your homework, you should know teachers are monitoring this public forum ... 
BR,
Ondřej K.
CLA, CTA, CLED