2

I am trying to apply the kaiser window during sinc interpolation.

The following is my sinc interpolation code:

def sincTrain(sig, interpolationFactor):
    tn = np.arange(0,len(sig),1)
    t  = np.arange(0,len(sig),1/interpolationFactor)
sincTrain = np.zeros((len(t),len(sig)))

w = np.kaiser(len(t),2.5)
nind = 0
for n in tn:
    sincTrain[:, nind] = sig[nind]*np.sinc((t - n)) * w
    nind+=1

return np.sum(sincTrain,1)

I realised that the kaiser window does not follow my sinc function. I have added the plots below to better illustrate the problem I am having.

enter image description here

enter image description here

How can I modify the code such that the kaiser window moves along with the sinc function?

Hari
  • 93
  • 6

1 Answers1

2

You are using t-n as the argument for sinc(), in order for it to be calculated at different points in time, but you are generating the window based on a fixed t. Try applying t-n there, as well. Also, don't forget that the widow looks to be shifted, while your sinc starts at 0.

a concerned citizen
  • 1,828
  • 1
  • 9
  • 15
  • I understand the issue now. Could you also explain how the kaiser window can be converted to change with t-n ? The in-built numpy package only allows for a kaiser window to be generated based on a fixed t. – Hari Oct 05 '22 at 07:56
  • If it doesn't allow shifting then you may need to implement the function, yourself. This might help. – a concerned citizen Oct 05 '22 at 16:12
  • okay thank you, I will try implementing the function myself – Hari Oct 06 '22 at 03:36