I need to downsample a single period waveform from $M$ samples to $L$ samples. If that matters, in my particular case, $L=M-1$.

I read about downsampling and came to the conclusion I need:

1. *expand* the original waveform by a factor $L$ (some other source call the step *“zero stuffing”*),
2. *interpolate* the missing samples,
3. *decimate* by a factor of $M$:

If I understood it correctly, *expansion* only requires adding $L-1$ zeros between each original sample. *Decimation* seems simple too since it only requires keeping every $M^{th}$ samples.

But I'm stuck with the interpolation process. The naive solution of using linear interpolation gave me surprisingly good results at low frequencies but quickly degraded when the frequency increases (i.e., .when the number of samples in the waveform decrease).

I found several mentions of using an interpolation filter that looks like a dot product1. For example, on the [Upsampling Wikipedia page](https://en.wikipedia.org/wiki/Upsampling#Upsampling_by_an_integer_factor), I see:

> 
> $$y[j+nL] = \sum\_{k=0}^K x[n-k]\cdot h[j+kL],\ \ j = 0,1,\ldots,L-1,$$
> 
> 
> where the h[•] sequence is the impulse response, and K is the largest value of k for which h[j + kL] is non-zero
> 
> 
> 

In my understanding, $x[•]$ is the sequence after the *expansion* step. $y[•]$ is the upsampled waveform. But I don't understand what are $h[•]$ and $K$. I read they are related to the *impulse response* and I understand the concept. But I can't see where it comes from and how to obtain it in practice.

Could someone explain to me how to obtain $h[•]$ and $K$? 

---

1It also looks like a *convolution* to me, but I'm not quite sure of that. And apparently this would be an instance of FIR filter. We already talked about that in other questions, but this is still not clear to me.