• 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 » Data Converters » Audio Converters » Audio Converters Forum » Algorithm to calculate the coefficients of Parametric Equaliser of PPS
Share
Audio Converters
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS
Check out
Analog Wire blog
  • $core_v2_blog.Current.Name

    Cable equalization 101 – Automating your design

    Posted 2 days ago
    by Hooman Hashemi
    Judging by the number of views on a post related to numerical...
  • $core_v2_blog.Current.Name

    RS-485 - Who says you can't teach an old dog new tricks?

    Posted 6 days ago
    by Neel Seshan
    Would you agree that RS-485 has turned out to be one of the most...
  • $core_v2_blog.Current.Name

    Filter for thought

    Posted 7 days ago
    by Soufiane Bendaoud
    Have you ever wondered how engineers designed active filters...

Forums

Algorithm to calculate the coefficients of Parametric Equaliser of PPS

This question is answered
Hector Bunker
Posted by Hector Bunker
on Sep 13 2011 15:58 PM
Prodigy90 points
I want to add to a product the Parametric Equaliser, the user will have the option to change Fc, Q and Gain. I normally create a table and keep it in the microcontroller and then send the coeficients B0,B1,B2, A1 via I2C to the TAS3204. In this case it will not work for my application, the table would have to be greater than 32k Flash of the uController. So in order to solve this i need to have the equations to calculate the coeficients of the PEQ and then convert the number to a HEX format (32bits) that the TAS3204 can accept. Please advice.

Hector, Bunker

TAS3204
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • susan xu
    Posted by susan xu
    on Sep 19 2011 11:27 AM
    Expert3030 points

     

    I  found this paper on the internet, see if it can help. 

    Susan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Hector Bunker
    Posted by Hector Bunker
    on Sep 28 2011 17:49 PM
    Prodigy90 points
    Hi Susan, thank you for the information, i have solved the point of calculating the coeficients. Now i need to convert the coeficient to hex, do you have information?

    Hector, Bunker

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • susan xu
    Posted by susan xu
    on Sep 28 2011 18:54 PM
    Expert3030 points

     

    Hector,

    Please let me know in a bit detail what you plan to do.  If you calculate the coefs in DAP in real time, you don't need to convert it.  How did you calculate the coefs?

    Susan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Hector Bunker
    Posted by Hector Bunker
    on Sep 29 2011 15:11 PM
    Prodigy90 points
    Hi Susan, I have a microcontroller from another manufacturer. I use this microcontroller to work as the interface of the user (GUI), all the parameters are entered thru a keyboard and displayed on a LCD. On this microcontroller i am calculating the coefs, my problem now is that the format of the float variables on this microcontroller is differente from the format Pure Path Studio has. Thats why i need to know the format PPS use for the float variables. After your comments you have placed things on a different perspective, you say that i can calculate the coefs on the DAP, well, my question also will be how can i create an interface with the DAP and have it calculate the coefs, is there a object on PPS that allows me to do so? Best Regards

    Hector, Bunker

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • susan xu
    Posted by susan xu
    on Sep 29 2011 16:35 PM
    Expert3030 points

    Hector,

    If you calculate the coefs in your micro and need to transfer the value through I2C, then you need to convert it to 5.23 format which is the format of the coef memory in DAP. For example, if the coef is 0.12345, then the number would be  0x00FCD35, since I2C is 8bit, we need to add another 4 bit at front, so the 32bit hex would be 0x000FCD35.

    If you want to calculate the coefs in DAP, then you need to pass the user input through I2C to DAP and make a component in DAP using the user input.

    I think you calculating the coefs in micro probably is the easier way.

    let me know if I didn't answer your question.

    Susan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Hector Bunker
    Posted by Hector Bunker
    on Nov 09 2011 15:00 PM
    Prodigy90 points
    Hi Susan, I have made the code on the microcontoller, also took the algorithms for the PEQ (non constant Q) from another user of this site: http://e2e.ti.com/support/applications/audio/f/22/p/77346/277665.aspx#277665 Q = 1 Fs = 48000 F0 = 1000 Dbgain = 12 A = 10 ^ (Dbgain/40) W0 = 2*pi*(f0/fs) Cosw0 = Cos(w0) Sinw0 = Sin(w0) Alpha = Sinw0 / 2*Q B0 = 1 + (Alpha * A) B1 = -2 * Cosw0 B2 = 1 - (Alpha * A) A0 = 1 + (Alpha / A) A1 = -2 * Cosw0 A2 = 1 - (Alpha/A) B0 = B0 / A0 B1 = B1 / A0 B2= B2 / A0 A1 = A1 / A0 A2 = A2 / A0 The code of the microcontroller is working and the coeficient calculation is also correct, the coeficients i tested on Matlab and the 5.23 format i made is correct, but still the output is not what i was expecting (the output signal is totaly bad). If the coeficients work on Matlab and i have confirmed that i have changed correctly the coeficients format to 5.23, why dont they work on TAS3204?. Do you have a different algorithm i can test? The coeficients that PPS give me are different from the one calculated by the the algorithm shown, but still, on Matlab this algorithm works, why doesn't it work on the TAS3204? BR

    Hector, Bunker

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • susan xu
    Posted by susan xu
    on Nov 09 2011 18:36 PM
    Expert3030 points

    Hector,

    First, let's check whether you do have the correct coefficient in DAP memory:  after you built your project, there is a dsp_main.lst file, in which all the address allocation are listed.  Using the I2C memory tool, peek the memory location that the coefficients should be and check whether they're the value expected.

    Susan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Hector Bunker
    Posted by Hector Bunker
    on Nov 09 2011 21:30 PM
    Prodigy90 points
    Hi Susan, thanks for the quick response. I am working on my own board, NOT THE EVM of the TAS3204. I have made some test with my code, when i send the coefficients given by PPS it works ok, when i send the values calculated by the algorithm shown above, then it does not work. I will make a test on the EVM and i will let you know the result of the peak and poke. Can you provide the algorithm that TI uses to calculate the coefficients for the Equalizer (Q factor)?

    Hector, Bunker

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • susan xu
    Posted by susan xu
    on Nov 10 2011 08:12 AM
    Expert3030 points

    Hector,

    Can you send me the two sets of coeffs calculated by you and PPS and also the parameters you used?  If it works in Matlab, it should work in DAP.  There're many ways of calculating coeffs, I feel that the method of calculating is not the problem.

    Susan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Hector Bunker
    Posted by Hector Bunker
    on Nov 12 2011 07:33 AM
    Prodigy90 points
    Hi Susan, here is what you have requested Q = 1; FS = 48000; F = 15000; Dbgain = 12; Algorithm implemented on my side: Coefs TAS FORMAT 5.23 b0 1.560424 0x00C7BBF9 b1 0.62148112 0x004F8CB1 b2 0.063587599 0x000823A3 a1 0.62148112 0x004F8CB1 a2 0.62401152 0X004FDF9C PPS b0 2.74028110504150390625 0x15EC188 b1 0.3185632228851318359 0x028C6AE b2 -1.907835483551025390625 0xF0BCC0C a1 -0.3185632228851318359375 0xFD73952 a2 0.16755402088165283203125 0x0157269 Q = 1; FS = 48000; F = 15000; Dbgain = 6; Algorithm implemented on my side: Coefs TAS FORMAT 5.23 b0 1.2452688 0x009F64F8 b1 0.57675135 0x0049D2FD b2 0.26185787 0x0021848E a1 0.57675135 0x0049D2FD a2 0.50712687 0X0040E988 PPS b0 1.5120116472244262695 0x0C18999 b1 0.37162458896636962890625 0x02F9165 b2 -0.5409095287322998046875 0xFBAC37A a1 -0.37162458896636962890625 0xFD06E9B a2 0.028897762298583984375 0x003B2EC Best Regards

    Hector, Bunker

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • susan xu
    Posted by susan xu
    on Nov 14 2011 10:51 AM
    Verified Answer
    Verified by Hector Bunker
    Expert3030 points

    Hector,

    I looked at your numbers.  I guess I may have failed to remind you, for all the "a" coefficients, you need to negate the number, then send to TAS.  For example, from your results: where  a1=0.62148112 , then you need to send a1=-0.62148112  to TAS, that is 0xFFB0734F.

    Please let me know  if it didn't solve your problem.

    Susan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Hector Bunker
    Posted by Hector Bunker
    on Nov 24 2011 10:13 AM
    Verified Answer
    Verified by Hector Bunker
    Prodigy90 points
    Hi Susan, Have tested your recommendation, the system is working, thank you for the help. Regards

    Hector, Bunker

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Don Dapkus
    Posted by Don Dapkus
    on Dec 10 2011 08:38 AM
    Verified Answer
    Verified by Hector Bunker
    Guru101945 points

    Hi, Hector,

    Can you do me a favor, log into the forum and mark Susan's answer as "Answer Verified" so we know you're happy?

    -d2

    -----

    Don Dapkus

    Audio Applications Engineering Manager

    Dallas, TX USA

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
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