0

I am studying the effect of sampling frequency offset on OFDM, and in order to emulate SFO, I have to slightly change the sampling rate of the signal. In order to have a +5ppm offset, I have to change the sampling rate (in Matlab) from 1 to 1.000005. I tried to use "y=resample(x,200001,200000)" in Matlab but apparently there is a limitation and I could not do it. How can I simulate an SFO? How can I use resample in this case?

thanks

Amro Goneim
  • 393
  • 1
  • 3
  • 14

1 Answers1

2

You effectively want a interpolated waveform that is interpolated by 200,000 such that for each new sample with the 5 ppm offset you can select one additional offset to induce that time offset, for example

x[1], x[200,002], x[400,003], x[600,004]....

(Or equally one less if your sampling clock increased in frequency 5ppm).

One very simple approach to do this is to use linear interpolation to determine the value of each new sample given the adjacent two samples, or curve fitting to more adjacent samples using higher order polynomials which is what is done with detailed filter design approaches. If your waveform is sufficiently oversampled to start with, then a simple linear interpolation approach may be more than sufficient. (To assess this you could measure the error vector magnitude of the mid sample using linear interpolation compared to a resample by 2 and see if that error is less than your target SNR requirement).

With a 5ppm lower clock the new samples would be:

$$y[n]=x[n] + mod(n,200,000)(x[n+1]-x[n])/200000$$

For n as the index of the original N sample waveform 0 to N-1

For example, If the first 4 samples were

2, 5, 8, 11

First sample: 2

Second sample: $5+ 1(8-5)/200,000$

Third sample: $8+ 2(11-8)/200,000$

Dan Boschen
  • 50,942
  • 2
  • 57
  • 135
  • Thanks Dan, could you please describe to me how to do it in steps, I am a bit confused. – Amro Goneim Dec 25 '19 at 23:00
  • What part are you confused about? How do to linear interpolation? – Dan Boschen Dec 25 '19 at 23:02
  • I think now understand how to emulate SFO, I will oversample the signal by 200,000. Then I will select the first sample followed by x(1+n*200,001). Nice idea.. Thanks – Amro Goneim Dec 25 '19 at 23:10
  • Yes just think with the sampling clock offset your sample position will “roll” accordingly between samples. – Dan Boschen Dec 25 '19 at 23:15
  • @DanBoschen Thank you for you help, I have a question here, can we also consider the effect of the sampling frequency offset similar to the effect carrier frequency offset ? It means we only add such phase into the time domain signal. – Sajjad Jun 17 '22 at 01:23
  • @Sajjad Related but not identical - these posts may help answer your question with more detail: https://dsp.stackexchange.com/questions/62831/what-is-the-difference-between-sample-timing-offset-carrier-frequency-offset/62844#62844 and https://dsp.stackexchange.com/questions/67990/offset-in-carrier-and-timing/67996#67996 – Dan Boschen Jun 17 '22 at 01:29
  • @DanBoschen I have made the code following your above equations here https://dsp.stackexchange.com/questions/83488/sampling-frequency-offset-vs-carrier-frequency-offset-effects and thta shows the rotation resulted from the added SFO effect. My question, why do I see a rotation also when adding 1 ppm? I mean replacing the 200000 by 1e6. However, that should be near into the optimal constellation which doesn't have any rotation. – Sajjad Jun 21 '22 at 01:35
  • 1
    @Sajjad please post new questions separately where you can further detail your expectations on what you calculate the rotation to be and share your measurements; you can add further details to what your question is so that myself or someone else here can hopefully clear up the confusion - thanks! – Dan Boschen Jun 21 '22 at 01:41
  • @DanBoschen Ok, got it. it's here https://dsp.stackexchange.com/questions/83532/high-error-when-adding-small-value-of-sfo-into-the-ofdm-signal – Sajjad Jun 21 '22 at 09:40