Results 1 to 4 of 4

Math Help - equations to matlab function

  1. #1
    Newbie
    Joined
    Jan 2010
    Posts
    2

    equations to matlab function

    " Formulate the filter as a sequence of vetcor dot
    product between the reference signal h and the
    data x: y[n] = <x[n:n-N+1],h[1:N]>. This is esentially
    what a FIR filter already does. "

    Can anyone help me convert this to a matlab function?
    Last edited by amcneilly; January 27th 2010 at 01:54 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by amcneilly View Post
    " Formulate the filter as a sequence of vetcor dot
    product between the reference signal h and the
    data x: y[n] = <x[n:n-N+1],h[1:N]>. This is esentially
    what a FIR filter already does. "

    Can anyone help me convert this to a matlab function?
    y(n)=sum(x(n:n-length(h)+1).*h);

    CB
    Last edited by CaptainBlack; January 29th 2010 at 04:33 AM.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jan 2010
    Posts
    2
    "x: y[n] = <x[n:n-N+1],h[1:N]>"

    Is there an error in the equation? n-N+1 ?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by amcneilly View Post
    "x: y[n] = <x[n:n-N+1],h[1:N]>"

    Is there an error in the equation? n-N+1 ?
    Probably depending on how you have defined the FIR and the weights. There should be N consecutive x's in the sum which you do have but the summation may not be in the order that you want.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. linear equations in matlab
    Posted in the Math Software Forum
    Replies: 8
    Last Post: December 7th 2009, 10:32 AM
  2. Matlab differential equations
    Posted in the Math Software Forum
    Replies: 20
    Last Post: April 11th 2009, 03:06 AM
  3. Lorentz Equations Matlab
    Posted in the Math Software Forum
    Replies: 7
    Last Post: September 26th 2008, 04:04 AM
  4. Linear equations and matlab
    Posted in the Math Software Forum
    Replies: 1
    Last Post: January 27th 2008, 11:40 PM
  5. Cubic equations and Matlab
    Posted in the Calculus Forum
    Replies: 3
    Last Post: May 3rd 2007, 01:12 PM

Search Tags


/mathhelpforum @mathhelpforum