Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top