Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between filter and conv in Matlab?

I am trying to calculate the output of a LTI system. I came across two different Matlab functions that are supposed to be appropriate for the job: filter and conv. What is the difference between the two of them?

like image 736
nikos Avatar asked Dec 06 '11 16:12

nikos


People also ask

What is the difference between convolution and filter?

Convolution filters generate output images in which the brightness value at a particular pixel depends on the weighted sum (i.e. linear combination) of the brightness of the neighboring pixels. Mathematical morphology filters on the other hand perform nonlinear processing on images.

What is conv Matlab?

c = conv( a,b ) returns the convolution of input vectors a and b , at least one of which must be a fi object. example. c = conv( a,b , shape ) returns a subsection of the convolution, as specified by shape .

What is a filter in Matlab?

Filters are data processing techniques that can smooth out high-frequency fluctuations in data or remove periodic trends of a specific frequency from data. In MATLAB®, the filter function filters a vector of data x according to the following difference equation, which describes a tapped delay-line filter.


1 Answers

filter can handle FIR and IIR systems, while conv takes two inputs and returns their convolution. So conv(h,x) and filter(h,1,x) would give the same result. The 1 in filter indicates that the recursive coefficients of the filter are just [1]. But if you have an IIR filter, you can't use conv. filter can also return the filter states, so that it can be used in subsequent calls without incurring filter transients.

See the conv and filter documentation for details.

like image 101
mtrw Avatar answered Sep 28 '22 11:09

mtrw