Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

conv & filter function in matlab?

Status
Not open for further replies.

david753

Full Member level 1
Full Member level 1
Joined
Jan 9, 2005
Messages
96
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
856
In matlab, there are two functions that can represent convolution function.
one is CONV, the other is FILTER.
But, their output point numbers are different.
As bellowing example, stp_rep2 is twice times length than stp_rep3.
Which one is more reasonable?

stp_rep1=filter(b,a,x_imp);
stp_rep2=conv(x_in,stp_rep1);
stp_rep3=filter(b,a,x_in);
 

Hi David,

conv(x,b) performs the complete convolution. The length of the result is length(x)+ length(b)-1 .
filter(b,[1],x) gives an output of the same length than x. It doesn’t flush the delay line of the filter.

Assume x is a row vector. Make x0 = [x zeros(1,length(b)-1)]; now filter(b,[1],x0) is the same than conv(x,b) . This is because the additional 0’s are used to flush te delay line.

Which one is more reasonable? It depends of what you need!
Regards

Z
 
zorro has provided a good explaination. But if you really need more help while working in the matlab command window type the commands 'help conv' or 'help filter' to see matlab's version.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top