1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: MATLAB Filtering Signals?

  1. Oct 7, 2012 #1
    1. The problem statement, all variables and given/known data

    Consider the system defined by Y(s) = H(s)X(s) with H(s) = K [itex]\frac{s-a}{(s-b)(s-c)}[/itex]. Build a function in MATLAB to simulate this system for given values of a,b,c,K and various input signals x(t) (in the time or in s-domain). Include a function to display plots of the time functions x and y and the Bode plot of the transfer function. You can choose b,c so that the system is stable (that is, both b,c are positive).

    2. Relevant equations

    3. The attempt at a solution
    I believe that the question is asking for two different functions. Here's my attempt at the first function:

    function simButter(a, b, c, K, x)
    syms s
    sys = K * (s-a)/((s-b)*(s-c))

    dt = 0.01;
    t = 0:dt:10; %dt and 10 were arbitrarily picked; what else would I choose?

    lsim(sys, x(t), t)


    For the second function, I have:
    function plotXYandTF(x,y)
    dt = 0.01;
    t = 0:dt:10;

    subplot(1, 2, 1);
    plot(t, x(t)); hold on;
    plot(t, y(t)); hold off;

    sys = tf(x,y);


    Is this even right? I am kind of confused about the way the question is phrased. In general, I know very little about filtering with MATLAB, despite reading alot of the docs on mathworks.
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted