Low frequency compressor

I'm a music lover and listen to different music. In the implementation of my project on ADAU1701, I often have TO turn the bass level. Is there a software option to make the bass level almost constant for different musical compositions? Ideally, it would be a solution that does not depend on the gain level of listening. More specifically... Classical music requires an additional +10 Db, while club music requires -10 dB. Regardless of the volume level. I suspect you need to use a compressor with a separate input for the envelope of the middle frequency spectrum. Thanks!

Parents
  • Sorry for my english... I am wondering if it is possible to make such a project in SigmaStudio.

  • 0
    •  Super User 
    on Oct 9, 2020 10:44 PM 1 month ago in reply to Sashkashka

         Hello,

         Yes it's quite possible to make a "bass regulator" in SigmaStudio.  The project pictured below shows two ways:

         Use ADI's Dynamic Bass block.  It's quite useful for managing the bass load to get the most from a given set of speakers.  It may not do exactly what you need, however.  To understand its many settings, see this Wiki article and search the forum for "dynamic bass."

         You could also set up a crossover to route just the low frequencies to a compressor.  If you include a divide block as shown, it will figure the ratio of the bass to other sounds.  Since the ratio doesn't change with volume, the effect varies with the program material and not its level as desired.  The crossover determines the bass frequency range affected.  The Effect Gain cuts strong bass while the Post Gain boosts weak bass.  In my tests this circuit boosted bass for 60s pop and cut it for club music.  Experiment until you get the desired effect.  If you come up with improvements, please share them!  

         The attached project runs on a ADAU1701MINIZ eval board; you can modify as needed to run on a SureDSP or similar board.

         Best regards,

         Bob

    Bass-Regulator.zip

  • Hello! The first version of the ADI's Dynamic Basscould not be configured properly. The effect was negligible. The second method is exactly what I imagined it to be! But my cognitive abilities were not enough to do this. I spent a lot of time calculating the correct setup for Your scheme. And calculated. The parameter at points A and C is a simple level control (see the app). The parameter at point B is the level of the horizontal line in the compressor. To get a symmetrical gain or decrease of the level by the value "x", you need to set a system of equations : A=-x, B=-2x, C=x. For the +/-10dB control range, A=-10dB, B=-20dB, C=10dB. In the calculation, it should work like this, but when I entered these parameters, I was surprised. Instead of a balanced control of low frequencies relative to medium+high, I got an excessively low level. After a long time selecting the setting experimentally, I came to the initial setting that You gave. What's the secret?) And even setting the multiplier to 0.8 (which corresponds to a value of -2 DB) perfectly balances the gain/attenuation. What I have now already suits me, thank you very much! But I want to go further and increase the range to +/-12 DB. Now the range is about +/-6dB. And this is enough to correct club music. But not enough to raise the bass level when listening to rock. I attach my project. Our slightly modified regulator on the "bass regulator" tab. If possible, share the math of the calculation. Thanks!

     Bass Regulator.zip

  • Today was another attempt to configure. And I will stop here, because the result suits me. Perhaps I didn't change anything and achieved the same setup as You. But there was no time to compare. I attached my modified project, in which club music with an increased low - frequency spectrum (Thomas Schumacher, Victor Ruiz - Apollo) sounds 6dB lower, rock (Finger Eleven - Paralyzer) 6dB higher, popular music (Kelly Clarkson - The Trouble With Love Is) 0dB-does not change and music that requires serious correction sounds 18dB higher! This is very convenient, because you can forget about the bass control knob. It would be possible to achieve a better setting if you learn to change the adjustment range. I couldn't do it, no matter how hard I tried. I hope that you will share your thoughts on this matter. In my project, the midpoint of the range is adjusted by the Gain3_3 element.

     Bass Regulator2.zip

  • 0
    •  Super User 
    on Oct 15, 2020 3:59 PM 1 month ago in reply to Sashkashka

         Glad it's working for you.  I like how you boosted the Divide Block's input.  The -1701 Divide block doesn't handle divisors less than 0.0625, so the gain beforehand increases the bass regulator's dynamic range.

         Best regards,

         Bob

  • Hello, Bob! Thank you for the link to the additional division algorithm and the reference to 0.0625. I want to note that I had in mind a different range of regulation. Not about the volume. I am not confused by the limit-24dB(0.0625) at which the regulation stops, because I listen to music almost always at the level of-10dB. I tried using a different algorithm with feedback, but there were small problems with the response speed when the volume was sharply reduced. But the main thing that did not suit this algorithm is that the control range has significantly narrowed from +/-6dB to +/-3dB. I am at a loss to guess why it is not possible to overcome the +/-6dB barrier, because mathematically you can even reach +/-20dB. I've tried using a bandpass filter instead of a highpass. The result was slightly different and additional configuration was required. So it's not a matter of spectral composition. Maybe it's the tempo and energy saturation of musical compositions? Analyzing the spectrum of the dance music file, we have 0dB of bass and 0dB of the main composition. In rock compositions, the bass is at the level of-25dB, when the main composition is still 0dB. The difference in bass level is 25dB, not 12dB (+/-6dB). I lack the knowledge to understand the question, but I want more bass when listening to rock and less in dance. 6dB is good, but not enough.

  • +1
    •  Super User 
    on Oct 22, 2020 4:47 PM 1 month ago in reply to Sashkashka

         Hello Sashkashka,

         I attempted to improve the bass regulator's operation with these mods:

    • The largest change is adding a Linear Interpolator, which allows you to tailor its response to various bass levels in music.  It replaces the fixed Effect Gain in the original design, which doesn't suit across the board.  You can adjust its table entries to your heart's content.
    • Added a 6 dB shelf boost at very low frequency, to make the circuit more sensitive to the "club bass" of dance music.
    • Lowered the crossover frequency to 90 Hz -- the original test was with computer speakers, which didn't reflect the circuit's actual operation as with headphones.  Of course since your design uses a subwoofer, you'll need to adapt as necessary.

         As you can see, in effect the Linear Interpolator provides a variable gain, with its differential gain (the slope of its curve) much higher than the original fixed gain.  This provides the desired effect range.

         Use the Real-Time Display to monitor its operation.  Be sure to set its Format control to "5" -- it's not saved with the project.  Here's some results I obtained with various types of music -- a reading below 0.1 (-20 dB) allows full bass boost.  About 0.3 the bass is unity gain, above that it cuts bass.

         Hope this works well for you.

         Best regards,

         Bob

    6355.Bass-Regulator.zip

Reply
  • +1
    •  Super User 
    on Oct 22, 2020 4:47 PM 1 month ago in reply to Sashkashka

         Hello Sashkashka,

         I attempted to improve the bass regulator's operation with these mods:

    • The largest change is adding a Linear Interpolator, which allows you to tailor its response to various bass levels in music.  It replaces the fixed Effect Gain in the original design, which doesn't suit across the board.  You can adjust its table entries to your heart's content.
    • Added a 6 dB shelf boost at very low frequency, to make the circuit more sensitive to the "club bass" of dance music.
    • Lowered the crossover frequency to 90 Hz -- the original test was with computer speakers, which didn't reflect the circuit's actual operation as with headphones.  Of course since your design uses a subwoofer, you'll need to adapt as necessary.

         As you can see, in effect the Linear Interpolator provides a variable gain, with its differential gain (the slope of its curve) much higher than the original fixed gain.  This provides the desired effect range.

         Use the Real-Time Display to monitor its operation.  Be sure to set its Format control to "5" -- it's not saved with the project.  Here's some results I obtained with various types of music -- a reading below 0.1 (-20 dB) allows full bass boost.  About 0.3 the bass is unity gain, above that it cuts bass.

         Hope this works well for you.

         Best regards,

         Bob

    6355.Bass-Regulator.zip

Children
  • Bob, you did a great job. How can I thank you? I will need to check the circuit for a while and maybe make some adjustments to my audio configuration. Don't close the topic until I answer, please. In the meantime, I'm impressed with the truly limitless capabilities of SigmaStudio and Yours as a professional.

  • Hello! I think I figured out the scheme and its settings. I tried a lot of configurations and came to the conclusion that it is necessary to abandon the adjustment in the negative. I left only the +16 dB adjustment in the standard logarithmic dependence without using a linear interpolator. Your linear interpolator table was good, but I wanted more effect when switching from club music to rock. The fact is that by clamping the control range through the table, I achieved that the initial difference of 6dB turned into 20dB. This worked well on the two selected songs. But there were big problems on other music, where in one piece the level jumped +/-10dB. It was impossible to listen.

    The dynamic range of the bass in a single piece can often exceed 6dB. It was decided to leave the standard dynamic range and smooth gain as the bass weakened. This is a balanced compromise solution. Important change: replaced the standard division algorithm with the one you shared in a different topic. I wrote earlier that it had problems with the speed of regulation. Now I have not observed these problems, and in addition, it gave twice as fast response to a sharp change in volume from-6dB to-50dB. In this case, the level on the compressor response line drops to 0 and slowly increases. As a result, the bass level increases by a maximum of 16 dB, even if the music does not have this gain. In the standard algorithm, this happens in 23 seconds.

    In a modified algorithm with feedback in 7 seconds.

    I am convinced that the task I have set cannot be solved more gracefully. I see this solution as extremely complex and beyond the capabilities of 1701. Because I was trying to teach the program to recognize music that is very similar in tempo and spectrum. Therefore, the RMS table also did not give the desired result to distinguish between rock and club music.

    However, a lot of work has been done. Valuable experience was gained. I thank You from the bottom of my heart for your support! I attach my program, in case someone needs it. Now it looks like this: MyProject+.zip

  • 0
    •  Super User 
    on Oct 30, 2020 2:18 AM 25 days ago in reply to Sashkashka

         Hello,

         Sorry I came up short on this one.  Though it's fun to see what we can coax out of a -1701 -- and some amazing things have been done -- hitting the limits is frustrating.  For example, a -1701 can make an awesome, no-fuss, no-adjustments de-esser.  Yet I've been through six iterations of a "plosive tamer" with none entirely satisfactory.  One design worked wonders om a test sample I had recorded, only to fall flat on its face with other voice samples.  My conclusion:  Get a better wind screen and be the end of it.

    Sometimes engineers can feel like this.  Just "Hang in there!"

         Best regards,

         Bob

  • Bob, you've done your job. And they showed an algorithm that does it right. Hit the bull's-eye the first time. The only problem is my specific taste, which is difficult to satisfy. By the way, I used Your de-Esser to disable the seat belt buzzer (Please forgive the moral aspect of this). Worked great! Thank you for everything!