Conv is to do convolution, that is, according to the practice of the book, first Flip, in a step-by-step translation, to obtain results. For a sequence of two lengths of n,m, the convolution result length is m+n-1
Filter is to do the filter, in fact, the principle and convolution is figured out, but the method of processing the results are different, first look at the sample program:
x=[1,2,3,4,5];
h=[1,1,1];
Y1=conv (h,x)
y2=filter (h,1,x) y3=filter (x,1,h) y4=filter (X,1,[h,zeros
(1,4)))
The results are:
Y1 =
1 3 6 9 9 5
y2 = 1 3 6 9
y3 =
1 3 6
y4 =
1 3 6 9 of 9 5
The results are now explained;
1.y1 is indeed calculated strictly according to the mathematical expression of convolution, not explained.
In explaining the following several, first say the use of filter: Filter (b,a,x), where b,a form a difference equation, X is the input signal, for example:
Filter ([1,2],1,[1,2,3,4,5]) implements Y[K]=X[K]+2*X[K-1]
What we are talking about here is the situation of a=1. With the basic description, now to the main:
2. The filter function translates to stagnation at x's last input with the filter's first coefficient pair to align. Here for
From
1 1 1 5, 4 3 2 1
Output 1,
to 1 1 + 1 5 4 3 2 1
Output 12
3. To verify the 2 point of view, here is:
From
1 2 3 4, 5 1 1 1
Output 1, to 1 2, 3 4 5 1 1 1
Output 6
4. Still the view of validating 2, from
1 2 3 4-5 0 0 0 0 1 1 1 1
output 1, to
1 2 3 4 5
0 0 0 0 1
1 1 1 output 5
And, in the 4th case, by filling 0, all 1 are moved to the end of the filter tap, and the result is the same as the convolution.
Here, I think we can understand the difference and relationship between the two.