• 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 » TAS3204 LOG approximation is too imprecise?
Share
Audio Converters
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS
Check out
Analog Wire blog
  • $core_v2_blog.Current.Name

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

    Posted 1 day 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 2 days ago
    by Soufiane Bendaoud
    Have you ever wondered how engineers designed active filters...
  • $core_v2_blog.Current.Name

    Let’s take this driver out for a spin

    Posted 8 days ago
    by Soufiane Bendaoud
    Before I suggest a suitable op amp to drive an ADC, I look at...

Forums

TAS3204 LOG approximation is too imprecise?

This question is answered
David Alexandrou
Posted by David Alexandrou
on Mar 14 2012 20:27 PM
Intellectual370 points

Hey there, 

I have a rather complicated design that uses, among other things, a comparison of LOG functions on L and R input audio, that is turned into a  value used to scale the output audio on both channels.

The trouble is, when the two signals coming in are approaching a peak in the audio in the same direction at the same time, the numbers start to get smaller, and because the log approximation is only good to..I think it's 0.0125? increments, one of those values changes in quite a digital manner before the other, instead of a smooth increasing transition that would come if the log had more resolution. 

The sum total of this is that the audio output that is being moderated by these numbers jumps up and down in 0.3dB increments in places where it should just be a smooth transition - this happens on the upper/lower ~10% for most if not all peaks, for anywhere between 1 and ~15 samples at 48Khz, and is then quite audibly present in the output audio as a pop/crackle distortion in the center of the stereo. 

I considered using the reciprocal instead of log to create a divide function to achieve a similar result, but the reciprocal only works for values b/w 0.1 and 1, and seems to be quite useless for audio as a result.

I've verified that it's the low-precision logarithm that is responsible for my problem - I'm just wondering if anyone knows how to increase the resolution or create a more precise log function for the TAS3204. 

I'm not an expert in DSP by a very far cry, but this is a strange one to me.

Cheers

David.

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 Mar 15 2012 08:41 AM
    Expert3020 points

    David,

    I don't know the details about how your comparison works, but it is true that the precision of log() alog() in TAS3x is not in a great precision.  The way I used to do before is to scale the input to log() to certain range so it would work at it's optimum.  I know it's not easy to do norminalization in TAS3x, but it's doable.

    Also regarding the reciprocal component, you also need to scale the input to be in the range to make it useful.

    Susan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • David Alexandrou
    Posted by David Alexandrou
    on Mar 18 2012 21:52 PM
    Intellectual370 points

    Hi Susan,

    I can't normalise because I need to preserve the integrity of the original signal when I'm deriving the calculation I need.

    And the reciprocal, same reason - the point of using logs was to reduce the input signal to a well-confined range, making it easier to compare regardless of the difference in relative amplitude - but still maintain the same relationship between the inputs.

    Is there any way to manually perform a higher-precision log? Like I said, I don't know a great deal about the nuts and bolts of DSP.

    I don't mind if it uses a few more cycles.

    Cheers

    David.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • David Alexandrou
    Posted by David Alexandrou
    on Mar 18 2012 22:44 PM
    Intellectual370 points

    Sudden thought - does the log algorithm on the tas3204 do normalisation anyway, pre-calc?

    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 Mar 19 2012 06:02 AM
    Expert3020 points

    David,

    No, it doesn't do normalization before hand when doing log.  I understand that you need to preserve the original signal, the only way I can think of and I did before is shifting the signal and also preserve the shift factor and/or, also shift the other signal you want to compare with to the desired range, only for comparison purpose.  I don't know the details of your operation, if you give me more details what you want to do, I can see whether I could be a little more helpful.

    Susan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • David Alexandrou
    Posted by David Alexandrou
    on Mar 20 2012 22:05 PM
    Intellectual370 points

    I am a little hesitant to reveal the exact nature of it, it's a company design, I'm not sure how detailed I can get. 

    Actually if you can think of a way to normalize in real time, that might work for what I'm trying to do.

    Cheers

    David.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • David Alexandrou
    Posted by David Alexandrou
    on Mar 25 2012 20:28 PM
    Intellectual370 points

    Hey Susan, 

    Normalisation would be ok we've decided, just not sure how to go about it on the TAS3204 - do you have any suggestions / algorithms or components I can use to achieve this?

    Cheers

    ~David.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • David Alexandrou
    Posted by David Alexandrou
    on Mar 25 2012 21:40 PM
    Intellectual370 points

    The other option is, what is a good way to  way to relatively scale the audio to between 0.1 and 1 so that I can use the reciprocal function accurately.

    Cheers once more

    `David

    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 Mar 26 2012 09:42 AM
    Verified Answer
    Verified by Don Dapkus
    Expert3020 points

    David,

    I am sorry we don't any compoent that's doing this.  I did something like that for a customer a while ago, when knowing the range of the input value, so we would know how many iterations of shift and compare would need.  If you're talking about scaling one sample, then yes, we could do that with some cycle expanse, but to scale for a block of samples, it's really hard to do, though I wouldn't say impossible.

    I was doing something like this:

    when at the point of comparison, BR hold the value you want to scale, for example, you want to calculate, 1/val1, then val1 is in BR, and 1 would be val2, when you shift val1 to the range of 0.1~1, then val2 is shifted accordingly and you need to save it in every step, then use reciprocal function to calculate the ans = 1/val1_scaled, then multiply val2_scaled to get the result 1/val1 = val2_scaled * (1/val1_scaled).

    First of all, we need to decide whether the signal is too big or too small, then decide to shift down or shift up, also, you could decide how many bits to shift in 1 iteration, 1 bit being the most precise of course, some in some situation, you could shift upto 4 bits at a time. depends on what you want to scale, how wide the number range is.

    I've attached a sample code, I need to modify the code to fit your senario, so not sure it would compile, and also it's only part of the situation, need to add when signal is small as well

    Hope this helps.

    Susan

    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