• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » IIR and FIR filter library questions
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • Forums

    IIR and FIR filter library questions

    This question is not answered
    Maxpower
    Posted by Maxpower
    on Oct 13 2010 09:26 AM
    Intellectual685 points

    I am using the F28335 chip. I looked for iir and fir filters and found some for the C2000 but they are written for integer math. My questions are:

    1) Is there a library for the C2000 chips with floating point support?

    2) If not and I need to use the integer versions, for iir32, do I need to scale the input to Q15 (ie x 32768) before feeding it to the filter function?

    3) Why isn't there a 32 bit version of the FIR? Or is there?

    Thanks

    28335 iir fir
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Lori Heustess
      Posted by Lori Heustess
      on Oct 13 2010 22:03 PM
      Guru50930 points

      Maxpower

      I am using the F28335 chip. I looked for iir and fir filters and found some for the C2000 but they are written for integer math. My questions are:

      1) Is there a library for the C2000 chips with floating point support?

      Maxpower,

      Floating-point filters is definitely on our list of to-dos for early next year.  In the meantime I have some preliminary filter functions that I am willing to share - they just haven't been packaged/documented/etc.  I will post them tomorrow when I'm back in the office.

      -Lori

       

      Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Maxpower
      Posted by Maxpower
      on Oct 14 2010 06:41 AM
      Intellectual685 points

      Thanks. I look forward to checking them out.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Lori Heustess
      Posted by Lori Heustess
      on Oct 14 2010 21:34 PM
      Guru50930 points

      Max - my apologies I just realized I forgot to respond back before leaving the office.   I still have this on my to-do.

      -Lori

      Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Lori Heustess
      Posted by Lori Heustess
      on Oct 15 2010 13:00 PM
      Guru50930 points

      Max,

      I found a copy of the FIR but I think its not the latest.  I want to check with a co-worker first.

      Regards

      Lori

      Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Maxpower
      Posted by Maxpower
      on Oct 15 2010 14:06 PM
      Intellectual685 points

      Lori,

         Thanks for the great communication. I am not in a hurry at the moment. I am running the integer version, FIR16, and it seems to work. It is very quick in execution. I was concerened about the integer math because when I used the iir16 I had resolution issues.

      I am going to be away from my project next week so the earliest I can try anything is a week from now.

      Thanks and best regards,

      Max

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yu Cai58368
      Posted by Yu Cai58368
      on Oct 18 2010 09:10 AM
      Prodigy230 points

      -Max,

      There is a fixed-point version of filter library available downloaded from

      http://focus.ti.com/docs/toolsw/folders/print/sprc082.html

      This is a very old lib and I tested the fir and iir 16 bit version. both of them are work. But the document has some problem.

       This lib has 16 bit FIR and 16/32 bit IIR. At this moment, there is not 32 bit fixed point FIR in this library.

      For IIR version, you not only needs scale to Q15 but also needs some scaling factor. This lib can not work independently from

      matlab.

      We are gonna release a updated version of this lib soon. So you would be able to get something easier to use for sure. :)

       -Yu Cai

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Maxpower
      Posted by Maxpower
      on Oct 18 2010 10:00 AM
      Intellectual685 points

      Thank you.

       

      That is the library I am using now and it does seem to work. At least the FIR16 does. I had some resolution issues with the iir16. I look forward to the updated filer libraries.

       

      Kidn regards,

      Max

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yu Cai58368
      Posted by Yu Cai58368
      on Oct 18 2010 10:08 AM
      Prodigy230 points

      -Max,

      The IIR 16 version also works, but eziir_matlab has some mistakes. If you follow that document step by step, it's kinda confusing. The output *.dat file is correct though.

      I am currently testing IIR 32 version, i believe it would work as well.  I will keep you posted and if anything else resources which potentially be helpful to you, please let me know. 

      Thanks

      Yu Cai 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yu Cai58368
      Posted by Yu Cai58368
      on Oct 19 2010 09:04 AM
      Prodigy230 points

      -Max

      I tested fixed point IIR 32 bit version. It has a bug in the old lib. Please be careful when you tried to use that. I will put a fixed one in the update release.

      Thanks

      -Yu Cai

      iir
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Maxpower
      Posted by Maxpower
      on Oct 25 2010 06:54 AM
      Intellectual685 points

      Yu Cai

          Thank you for the heads up. Let me know when the update is available.

       

      Max

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Maxpower
      Posted by Maxpower
      on Oct 26 2010 07:51 AM
      Intellectual685 points

      Lori,

          Do you have a floating point version of the IIR fitler available yet for me to try?

      Thanks

      Max

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yu Cai58368
      Posted by Yu Cai58368
      on Oct 26 2010 09:11 AM
      Prodigy230 points

      Max,

      I currently have FIR and IIR working version in both 16 and 32 bit. Now I am documenting them.  We don't have floating point version of optimized IIR filter library at this time. If you really want to implement it in floating point. You can use C to do that.

      -Yu Cai

      iir fir
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Maxpower
      Posted by Maxpower
      on Oct 26 2010 09:48 AM
      Intellectual685 points

      Yu Cai,

          I can work with the integer versions but Lori (above) mentioned there were floating point versions being worked on and that I might be able to get ahold of some code to try out.

      I look forwared to getting the latest integer versions to try in the meantime.

      Thanks

      Max

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Lori Heustess
      Posted by Lori Heustess
      on Oct 26 2010 19:22 PM
      Guru50930 points

      Maxpower

      Lori,

          Do you have a floating point version of the IIR fitler available yet for me to try?

      Thanks

      Max

      Hi Max,

      Unfortunately Yu Cai is correct.  What I found was an FIR tucked away but I was not able to find the IIR.  I apologize for that.  At the moment Yu Cai is finishing up some fixed point cleanup but will be working on the float soon.

      I hope what you have at this time will work for you until then.

      -Lori

       

      Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Maxpower
      Posted by Maxpower
      on Oct 27 2010 14:58 PM
      Intellectual685 points

      Yu Cai,

          While I am waiting for an updated iir32, I am trying to get iir16 to work. All my math is in floating point on the F28335. The output from the iir16 matlab script is:

      #define IIR16_COEFF {\
         0,5716,0,89,89,\
         -5781,13114,9879,19759,9879}

      #define IIR16_ISF 2476
      #define IIR16_NBIQ 2
      #define IIR16_QFMAT 13

      I call the initialize function as in the examples given.

       

      This is the code I use to convert my floating point number to an integer in Q15 format and then convert from a Q14.

          iir.input = (int)floor((speed_control.Out * 32768.0));          // Scale to Q15 format
          iir.calc(&iir);
          angle->omega_m = (float)iir.output / 16384.0;                    // 2^14 which is the output format

      According to the iir16 asm source, the output is in Q14 format so I have to divide to convert it back to floating point

      Is this correct?

       

      I am not getting the desired results so I am wondering what I am doing wrong.

      Thanks

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    123
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use