digital filter


Closed Thread
Results 1 to 2 of 2

Thread: digital filter

  1. #1

    Question digital filter

    Hi
    I want to calculate this expression:

    y_n=(b0*x_n)+(b1*x_n_1)+(b2*x_n_2)+(b3*x_n_3)

    -(a1*y_n_1)-(a2*y_n_2)-(a3*y_n_3)
    That:

    x_n;x_n_1;x_n_2;x_n_3;y_n;y_n_1;y_n_2;y_n_3;a1;a2; a3;b0;b1;b2;b3
    are variables and their type is Word.

    Infact I want to use this equation for implementing a digital filter
    maximum order of filter is 3.
    I must input a1;a2;a3;b0;b1;b2 and b3 from keyboard.These valuse can be
    negative or positive.I use PICBasic Pro compiler and PIC16F877 MCU.I am a
    beginner therefore I get in to trouble;My problems are:

    1-I know that pbp uses unsigned integers but I want to input
    signed values from keyboard please help me how I can do that.

    2-Suppose that the result of (b0*x_n)+(b1*x_n_1)+(b2*x_n_2)+(b3*x_n_3)
    has overflow because type of my variables is word how I can prevent
    this event.

    3-Suppose that the coefficients are float for example a1=0.2
    a2=6;a3=-0.6 In this case how I can calculate above equasion.

    Any suggestion would be helpful for me specially number 1 and 3 questions.
    Thank you very much.

  2. #2
    magix's Avatar
    magix Guest


    Did you find this post helpful? Yes | No

    Default

    I suggest you to make Moving Average Filter. It is expecially suited for microcontroller application.
    It is very fast and very effective.

Similar Threads

  1. Average Values and digital filter ...
    By jorge in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 24th April 2010, 13:29
  2. Atod Digital Filter
    By GeoJoe in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd April 2008, 18:04
  3. 2nd Order Digital Filter for 24-bit
    By sefayil in forum mel PIC BASIC
    Replies: 0
    Last Post: - 2nd December 2005, 22:55
  4. implementig digital filter and my problems????????
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 2nd June 2004, 19:06
  5. digital filter with pic16f877
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th April 2004, 04:51

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts