Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9038701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:33:04+00:00 2026-06-16T09:33:04+00:00

I have samples which come from ffmpeg, very often it is 16 bit samples

  • 0

I have samples which come from ffmpeg, very often it is 16 bit samples (short type), i have used iir band pass filter with dbGain as described here, after filtering i sometimes got a short type overflow and result of it is some noise when calculated sample value go out from 32767/-32767, Is any way to escape audio pcm sample clipping. May be exists any approaches?

I have googled but not found any worked example?

UPDATE

When i cast transfer function calculation result to integer and check overflow then noise still occurs::

int result = A1 * ((int) Rx) + A2 * ((int) Rxx) + A3 * ((int) Rxxx)
                    - B1 * ((int) Ryy) - B2 * ((int) Ryyy);
if (result > 32767)
    result = 32767;
if (result < -32700)
    result = -32700;
y = (short) result;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:33:05+00:00Added an answer on June 16, 2026 at 9:33 am

    16-bit PCM samples will have to be in range [-32768..+32767]. If you apply math (biquad filter in your case) onto input signal, the output is not guaranteed to stay within the range, which is the inevitable outcome here in case you are applying positive gain.

    Since hitting range boundaries is a natural side effect with this kind of processing, you are supposed to take care of it using one of the approaches (the list is not supposed to be full):

    • make sure your input signal is quiet enough and/or shift values right by a few bits to provide headroom for big values on the output
    • use higher bitness for output signal, such as 24-bit PCM
    • use floating point PCM for output signal to precision loss on going outside of PCM sample range
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an IRecord which contains an ICollection of Samples. The ICollection looks like
I have a method, which uses random samples to approximate a calculation. This method
I have a bit of xml file named Sample.xml which is shown below <?xml
Ok, here is my situation, which has come to this... dramatic pause... I have
I am trying to build the OpenCV samples which come with the source package
I have a sample.xhtml file which has few lines of javascript. This javascript will
I have a sample xml file which looks like the one below: <Root> <SubOne>
I have made a sample application which constructs a filter graph to capture audio
I have the following sample code which doesn't seem to want to run. import
I have the sample console application which is supposed to be executed in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.