Using Bass/Treble Equalizer

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
brunp
Posts: 24
Joined: Thu Apr 25, 2013 4:21 pm
Operating System: Please select

Using Bass/Treble Equalizer

Post by brunp » Tue Dec 24, 2013 2:19 pm

I am using the Bass/Treble equalizer code in my own project, but for some reason, when I use the bass/treble code, especially, the most recent
update, I am getting a lot of noise in the resulting audio. It is not just clipping, but severe noise. I think I am using the code properly.

I am trying to use the code and adapting it to C#.

Any suggestions.

Paul

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Using Bass/Treble Equalizer

Post by steve » Tue Dec 24, 2013 5:01 pm

Ensure that your track is 32 bit float format.
The track sample format can be changed if necessary in the track drop down menu: http://manual.audacityteam.org/o/man/tr ... _menu.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

brunp
Posts: 24
Joined: Thu Apr 25, 2013 4:21 pm
Operating System: Please select

Re: Using Bass/Treble Equalizer

Post by brunp » Mon Jan 13, 2014 4:14 pm

my audio samples running through the Bass/treble code is 32-bit float, so not sure what else I can do....

Paul

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Using Bass/Treble Equalizer

Post by steve » Mon Jan 13, 2014 6:31 pm

What settings are you using in "Bass and Treble"?
Could you post a short sample (just a few seconds, in WAV format, without "Bass and Treble" applied) of the audio that you are trying to process.
See here for how to attach an audio sample: http://forum.audacityteam.org/viewtopic ... 49&t=72887
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

brunp
Posts: 24
Joined: Thu Apr 25, 2013 4:21 pm
Operating System: Please select

Re: Using Bass/Treble Equalizer

Post by brunp » Tue Jan 14, 2014 3:30 pm

Here is an example audio file....you can see the difference. I used 0 as Treble. The odd thing is, when I don't include the PI calculation in calculating wTreble, I get no noise.

Paul
Attachments
AudioSampleOriginal.wav
Audio Sample Original
(192.45 KiB) Downloaded 90 times
AudioSampleWithBass12db.wav
Audio Sample with +12DB Adjustment
(249.57 KiB) Downloaded 74 times

brunp
Posts: 24
Joined: Thu Apr 25, 2013 4:21 pm
Operating System: Please select

Re: Using Bass/Treble Equalizer

Post by brunp » Tue Jan 14, 2014 3:40 pm

please note I don't use audacity directly, but the code from audacity for bass/treble and use it in a C# project, and use the C# equivalent for all the math libraries.

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Using Bass/Treble Equalizer

Post by steve » Tue Jan 14, 2014 6:27 pm

The problem is not with the Bass and Treble effect.
If you zoom in close on the audio sample processed by you C# code you will see that there are discontinuities in the waveform.
firsttrack001.png
firsttrack001.png (12.05 KiB) Viewed 3236 times
My guess is that your code is processing in blocks of 160 samples but not correctly preserving the old sample value from one block to the next.
I don't know C# so I'll be no help with your code, but hopefully that gives you a clue.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

brunp
Posts: 24
Joined: Thu Apr 25, 2013 4:21 pm
Operating System: Please select

Re: Using Bass/Treble Equalizer

Post by brunp » Tue Mar 25, 2014 5:40 pm

I finally got a chance to revisit this issue within our code-base and figured out the problem. However, it only occurs in our scenario
since we are playing back audio as we are changing the the bass/treble gains.

Within the bass/treble code, there is a call to compute the coefficients for bass/treble which is done in the NewTrackPass1 method.

I realized that this call is done before processing the audio, and in audacity, you perform the bass/treble effect in the entire wave file
as oppose to being able to adjust it on the fly. So, this is done once.

In my case, NAudio processes playback (in my case), in 320 byte chucks. So, every time NAudio performs a read of the audio, I would
be initializing the coefficients and performing bass/treble effect whenever NAudio performs a "read". I have since changed the logic
to only initialize the coefficients whenever there is a change. There is only slight static when I am in the process of changing the audio,
but when there are no dB changes, the audio playback doesn't exhibit the static in the sample WAVE file I have provided.

This is a huge improvement over what was previously in the code.

If there is anyone that needs some clarification, please let me know.
Paul

brunp
Posts: 24
Joined: Thu Apr 25, 2013 4:21 pm
Operating System: Please select

Re: Using Bass/Treble Equalizer

Post by brunp » Tue Mar 25, 2014 6:22 pm

I have actually been able to refine it even further and eliminate any distortion altogether during the actual db change of bass/treble.

Paul

Post Reply