First entry of a wave becomes weird number after resample

Hi, Recently I am trying to use resample/down=200 to decimate (and filter) some waves. However, I found that in doing so, the first entry of the wave becomes different in order of magnitude, comparing to all the other points inside the same wave. Consider the code below (attached contains the wave files if you would like to try):
make/o/n=1e6 test=gnoise(1)*0.000239305
matrixop/o testIOut = test*I_creator
matrixop/o testQOut = test*Q_creator
resample/down=200 testIOut, testQOut

matrixop/o Iout = ASamplesTrim*I_creator
matrixop/o Qout = ASamplesTrim*Q_creator
resample/down=200 Iout, Qout
In the code, the first section tries to produce a similar wave to ASamplesTrim. From the test wave, I perform digital down-conversion, from which it follows a resample and give testIout and testQout. Then, from the data ASamplesTrim, the same was performed. If you then check the four waves by displaying them, you will see the first element of only Iout being an abruptly different value. The other three wave, Qout, testIout and testQout all looked fine. This seems weird. Also, if I set the first element of I_creator to zero, the problem is also gone. Appreciated if you have any hints for this.
TestWaves.zip (1.81 MB)
Computing the first and last value of the resampling is difficult, because Resample uses a centered FIR filter kernel, so Resample needs values both after and before every point. For the first point, the "after values" are right there in the wave. The "before values" have to be extrapolated. (This is why many people throw the first and last Resampled values away.) Resample's /E parameter controls how this made-up data is created:
/E=endEffect    Determines how to handle the ends of the resampled wave(s) ("w" in these descriptions) when fabricating missing neighbor values.
    endEffect = 0:  Bounce method. Uses w[i] in place of the missing w[-i] and w[n-i] in place of the missing w[n+i].
    endEffect = 1:  Wrap method. Uses w[n-i] in place of the missing w[-i] and vice-versa.
    endEffect = 2:  Zero method (default). Uses 0 for any missing value.
    endEffect = 3:  Repeat method. Uses w[0] in place of the missing w[-i] and w[n] in place of the missing w[n+i].
Not specifying /E is the same as /E=2 (zero method). Convolving half the kernel with 0 obviously leaves the result at the mercy of the right half of the kernel and only the values at the right. With noisy data like you have, Resample/E=0 may be the best bet. --Jim Prouty Software Engineer, WaveMetrics, Inc.
JimProuty wrote:
Computing the first and last value of the resampling is difficult, because Resample uses a centered FIR filter kernel, so Resample needs values both after and before every point. For the first point, the "after values" are right there in the wave. The "before values" have to be extrapolated. (This is why many people throw the first and last Resampled values away.) Resample's /E parameter controls how this made-up data is created:
/E=endEffect    Determines how to handle the ends of the resampled wave(s) ("w" in these descriptions) when fabricating missing neighbor values.
    endEffect = 0:  Bounce method. Uses w[i] in place of the missing w[-i] and w[n-i] in place of the missing w[n+i].
    endEffect = 1:  Wrap method. Uses w[n-i] in place of the missing w[-i] and vice-versa.
    endEffect = 2:  Zero method (default). Uses 0 for any missing value.
    endEffect = 3:  Repeat method. Uses w[0] in place of the missing w[-i] and w[n] in place of the missing w[n+i].
Not specifying /E is the same as /E=2 (zero method). Convolving half the kernel with 0 obviously leaves the result at the mercy of the right half of the kernel and only the values at the right. With noisy data like you have, Resample/E=0 may be the best bet. --Jim Prouty Software Engineer, WaveMetrics, Inc.
Thanks a lot for your comment, now having known the nature of the computation it really helps. In reality I could have slightly extend the sample size by 10 or more samples easily, so it can also help solve the problem.