# 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.
• 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 '16 at 16:29