# Downsampling and filtering (convolution)

I have a discrete $2N$length signal $y[n]$ which I want to downsample by a factor of $F=2$. In order to avoid aliasing (since I assume that my original sampling rate is exactly equal to $2f_{max}$,i.e., there is no oversampling) I use anti-aliasing filter before downsampling. Filtering corresponds to convolution in time domain,i.e., $\bar{y}[n]=y[n]\star g[n]$. Since convolution changes the size of input signal what should be the size of my filter $g[n]$ in order to get in the end downsampled signal whose length is a twice the length of $y[n]$, i.e., $\frac{2N}{2}=N$. In other words it is possible that signal length stays the same after filtering?

I think you want to take the "central" part of the convolution. Convolution will give a signal that has length(c) = length(a) + length(b) - 1. If you have Matlab or Octave, there is an option when using the convolution function to just take the central part.

• Yes, I do need a central part and in Matlab I can get it using "filter" function but I need mathematical explanation for that, i.e., why am I allowed only to take a central part if convolution actually gives longer sequence.
– Cali
Aug 11, 2016 at 15:47
• From my understanding of convolution, it works like this; imagine you have a signal that you can measure, and the signal goes through a linear system. The signal that goes through the linear system is not actually going to be longer than the original signal, assuming you start and stop measuring both signals at the same time. The central part of the convolution represents what we would actually measure if the signal were to pass through a physical system. Aug 11, 2016 at 15:51
• but why does then convolution gives longer sequence if in real time implementation we will get the same length as in beginning? I am doing some mathematical equations and I do not know how can I explain taking only central part of convolution in math way.
– Cali
Aug 11, 2016 at 16:19
• You could just define your output function piece-wise, which would require 3 parts, pre-, post-, and central-convolution. The definition of convolution of two finite signals gives a longer length because of the sliding/multiplying, that's just how it is. Aug 11, 2016 at 16:26
• Ok, but if I sad that filtered signal is equal to $\bar{y_n}=y_n \star g_n$ then how this pre-, post-, and central- convolutions would look like?
– Cali
Aug 11, 2016 at 16:29