There are several ways that MATLAB implements FIR.
- One of them is that convolution function
convdirectly implements the convolution equation and if the input is a vector of $M$ and impulse response of a filter is a vector of $N$ then the output gives a vector of length $N+M-1$. I have tried it with pen and paper and finally got it (thanks to people here).
- There is another method that uses
filterfunction and in this case the output gives out a vector with size $M$ which is different than the result I was getting with convolution. Apparently in this case MATLAB supplies one output for each input. From what I know from filters is that the output is the input convolved with impulse response.
So what exactly MATLAB is thinking when it spits out one output for one input?