2
$\begingroup$

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?

$\endgroup$
1
  • $\begingroup$ you want to center the sinc function and the Kaiser window together. that's now how you are displaying it now. $\endgroup$ Commented Oct 4, 2022 at 15:31

1 Answer 1

2
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ 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. $\endgroup$
    – Hari
    Commented Oct 5, 2022 at 7:56
  • $\begingroup$ If it doesn't allow shifting then you may need to implement the function, yourself. This might help. $\endgroup$ Commented Oct 5, 2022 at 16:12
  • $\begingroup$ okay thank you, I will try implementing the function myself $\endgroup$
    – Hari
    Commented Oct 6, 2022 at 3:36

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.