# How good or bad my downsampled data is?

Suppose I have time series data at a one-minute resolution. Now I downsample data by taking mean of every 10-minute window, i.e., after downsampling, 60 readings will reduce to 6 readings. How should I show how good or bad my downsampling technique is? In a good downsampling technique, the downsampled sample should closely represent the original data.

## 1 Answer

First look at the spectrum of the original data $$x[n]$$. Downsampling a discrete-time signal $$x[n]$$ by $$M=10$$ requires that (to prevent aliasing) the signal should be bandlimited to $$|\omega|<\pi/M$$.

If your signal is bandlimited enough, then averaging 10 samples (as a crude lowpass filtering) will suffice. Otherwise, a better filter can be designed by different filter design techniques such as a simple windowed linear phase lowpass filter.

the following matlab excerpt gives you a better result.

K = 15;
h = fir1(2*K, 1/10); % impulse response of a 20th order FIR LPF.
yc = conv(x,h);      % convolve h[n] with x[n] of length L
y = yc(K+1:K+L);     % the filtered signal