I need to develop a moving average filter that only considers the time window PRIOR TO a certain instant. In other words, considering the value of my output signal at a certain time t0, it must be the result of the prior time window. Therefore, the averaging time window must not be centred in t0, but end in t0. The application will be implemented real-time and there is not yet a time after t0.
filtCoeff = ones(1, T)/T;
output = filter(filtCoeff, 1, input);
Do you think these two lines correctly carry out what I am trying to do? If not, how to do it?
Thanks a lot. Filippo