FIR filter generic

Discussion in 'VHDL' started by Zorjak, Oct 20, 2006.

  1. Zorjak

    Zorjak Guest

    Hi.
    I am trying to write generic VHDL code for FIR filter. generic
    parametars should be word_length, filter_order. Can anybody help me
    how to input filter coeficients. I tought something like, read
    coeficitients from file and write it in some LUT table. Could it be
    done (or something similar)?

    Thanks for help
    Zorjak, Oct 20, 2006
    #1
    1. Advertising

  2. Zorjak

    Jiri Plasil Guest

    Zorjak napsal(a):
    > Hi.
    > I am trying to write generic VHDL code for FIR filter. generic
    > parametars should be word_length, filter_order. Can anybody help me
    > how to input filter coeficients. I tought something like, read
    > coeficitients from file and write it in some LUT table. Could it be
    > done (or something similar)?
    >
    > Thanks for help
    >

    You can use e.g. std.textio.all package. The coeffs can be stored in the
    regular text file. In case std.textio.all the content of the file is
    binary string like

    -- file.dat
    0010000
    0010001
    ....

    --

    (there is also possibility to use hex representation but different
    package has to be used - from IEEE....)

    Then just define ROM (distributed or block RAM) by array statement. E. g.
    TYPE ROM IS ARRAY (N_COEFF - 1 DOWNTO 0) OF SIGNED(N_BITS - 1 DOWNTO 0);

    Define function "init_function" to be able read data from file by means
    of "readline" and "read" statement from textio package.

    And finally initiate e. g. constant of coeffs.
    CONSTANT coeff : ROM := init_function("file.dat");

    It works in XST. I don't have any experience with Quartus. Check in the
    Quartus documentation how is possible define initial value of registers
    an memories.
    Jiri Plasil, Oct 26, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hari

    FIR Filter

    Hari, Jan 27, 2004, in forum: VHDL
    Replies:
    3
    Views:
    900
  2. Yttrium

    FIR filter design + COE file

    Yttrium, Feb 9, 2004, in forum: VHDL
    Replies:
    1
    Views:
    2,926
  3. dhaanya nair
    Replies:
    0
    Views:
    3,847
    dhaanya nair
    Feb 26, 2004
  4. Wiener, Norbert
    Replies:
    4
    Views:
    578
    Jerry Avins
    Nov 18, 2004
  5. mindenpilot

    Re: fir decimation filter in VHDL

    mindenpilot, Nov 19, 2005, in forum: VHDL
    Replies:
    1
    Views:
    2,362
    saras
    Nov 21, 2005
Loading...

Share This Page