How to emulate a sampling clock offset (between the transmitter and the receiver) of 1 part per million (SCO=1ppm) in Matlab? Theoretically, I can upsample the signal by a factor of 1,000,001 (one million and one) and then downsample it by a factor of 1,000,000 (one million) to emulate resampling the signal at a sampling rate of 1+1e-6. However, doing this is impossible in Matlab. I am thinking of doing this by taking FFT, then padding zeros in the frequency domain, then appropriate selection followed by iFFT...


  • $\begingroup$ "doing this is impossible in Matlab". What happened when you tried? Did you use the upfirdn function which is rather good at this sort of thing? $\endgroup$
    – Ben Voigt
    Commented Jun 8, 2021 at 20:25
  • $\begingroup$ I tried to do it using upfirdn, I got the following error: Error using upfirdn>validateinput The product of the downsample factor Q and the upsample factor P must be less than 2^31. $\endgroup$ Commented Jun 9, 2021 at 8:32

1 Answer 1


I suspect the OP is referring to a frequency offset and not a static time offset.

If the 1ppm is a frequency offset of the clock frequency and not a static time offset, this could be introduced with an numerically controlled oscillator (so in Matlab this is simply multiplying the datapath signal by $e^{j\Delta f t}$). If that clock is a reference to other sources in the receiver (such as the RF Local Oscillator), then the frequency offset introduced at those locations must also be factored in using the appropriate multiplication ratio of the RF to reference frequency.

If the 1ppm is indeed a static time offset that is not changing, then this can be introduced using fractional delay filters. The basic structure for a fractional delay filter is to resample the ideal interpolation Sinc function at the time offset (this can be readily computed using windowed Sinc filter designs). A Farrow Filter is also well suited for this purpose with the ability to provide tunable delays. See:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.