Plotting a filter from it's transfer function

Status
Not open for further replies.

Emil09

New Member
I'm trying to figure out how to plot the response of discrete time filters based on their transfer functions. For example, if I have the expression of a filter's transfer function, how do I go about translating that into something I can input into Matlab?
 
Hello there,

Give us an example of your transfer function and we can probably help with this.
 
Hello there,

Give us an example of your transfer function and we can probably help with this.

Here's the transfer function:

**broken link removed**

And here's where I'm starting in Matlab:

**broken link removed**

This returns an error due to a zero vector. I understand that the vectors must be nonzero but as you can see from the transfer function, I need two of the coefficients to be zero.
 
Try:

num = [0.094, 0.3759, 0.5639, 0.3759, 0.094];
den = [1, 0, 0.486, 0, 0.0117];
sys = filt(num, den);
bode(sys)
 
Last edited:
Try:

num = [0.094, 0.3759, 0.5639, 0.3759, 0.094];
den = [1, 0, 0.486, 0, 0.0117];
sys = filt(num, den);
bode(sys)

Matlab syntax is painful when you are used coding with C.

It works! Thanks! When I looked at your post I immediately thought that I would get the same error message about vectors having to be nonzero but ... not this time!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…