Jump to content
Kvalsvoll

The Bass EQ for Movies Thread

Recommended Posts

That looks like a terrific tool, can potentially save many steps in my BEQ process.  I will have to check it out.  Individual channels can have individual corrections?

JSS

Share this post


Link to post
Share on other sites
28 minutes ago, maxmercy said:

That looks like a terrific tool, can potentially save many steps in my BEQ process.  I will have to check it out.  Individual channels can have individual corrections?

JSS

atm there is one filter which is applied to all loaded signals, extending this so you can map different filters to different signals (channels) is high on the list of things to do. It needs to come after being able to load/save filter sets & some tweaking to the way graphs are created though.

  • Like 1

Share this post


Link to post
Share on other sites
On 8/24/2018 at 3:33 PM, 3ll3d00d said:

FWIW I decided to knock up an little ui to make experimenting with BEQ easier (so it can extract audio using ffmpeg & show the results of adding assorted filters, comparing tracks) hence it removes the need to faff around with speclab). An early release (windows only atm as I'm away from my linux boxes) is available at https://github.com/3ll3d00d/beqdesigner/releases/tag/0.0.1-alpha.2

Here's a pick to illustrate https://imgur.com/a/KgfaxOJ

This is still a fairly early build (and the exe is a bit massive) but it seems to be usable so thought I'd share it. The readme at github has some of the things left to do and some bugs. One thing not mentioned there is being able to apply different filter sets to different signals. 

EDIT: I replaced the exe with something that should display errors if you start it from a console (as someone on avs reported it didn't work for them)

EDIT2: possible workaround in https://www.avsforum.com/forum/113-subwoofers-bass-transducers/2995212-bass-eq-fil-turd-movies.html#post56692822

This is excellent, of course I need to test it.

But before I waste my time - does it work on linux, should work if ffmpeg is the engine for signal processing, and the ui is python/qt. The media computer is linux, it is just more convenient to use that one.

Share this post


Link to post
Share on other sites
1 hour ago, Kvalsvoll said:

This is excellent, of course I need to test it.

But before I waste my time - does it work on linux, should work if ffmpeg is the engine for signal processing, and the ui is python/qt. The media computer is linux, it is just more convenient to use that one.

Does not run on linux - on my system, for now. Which means there is some work to get it up and running, perhaps I will look into it later. Because the idea of this app is great, it can actually end up as a completely automated bass-eq for any movie at click of a button.

  • Like 1

Share this post


Link to post
Share on other sites
40 minutes ago, Kvalsvoll said:

Does not run on linux - on my system, for now. Which means there is some work to get it up and running, perhaps I will look into it later. Because the idea of this app is great, it can actually end up as a completely automated bass-eq for any movie at click of a button.

git clone git@github.com:3ll3d00d/beqdesigner.git
cd beqdesigner
git checkout 0.0.2-beta.2

python3 -m venv beq
. beq/bin/activate
pip install numpy colorcet scipy qtpy qtawesome pyqt5 matplotlib ffmpeg-python soundfile resampy
cd src/main/python

# you also need ffmpeg and libsndfile1 installed, e.g.
sudo apt install ffmpeg libsndfile1 

then open mpl.py in a text editor and change the following

change

for k, v in cc.cm_n.items():

to

for k, v in cc.cm.items():

(this is due to some lib having an older version in pypi vs conda, it is fixed in next release)

then

python3 app.py

and you should find it fires up

I'll get round to packaging it properly for linux soon enough

next release will properly support pre BM BEQ btw, will publish that tomorrow hopefully

I run Debian Testing here and it seems ok, haven't tested it extensively though so let me know if problems, will get round to testing it properly on linux at some point. The same approach has also been used on the mac too btw.

  • Like 2

Share this post


Link to post
Share on other sites

There's a new release up at https://github.com/3ll3d00d/beqdesigner/releases/tag/0.0.2-beta.3 which should be sufficient for BEQ pre BM in that it can extract multichannel wavs and link multiple signals together against the same filter. This means you can do something like 

* extract an 8 channel wav from a 7.1 film

* load all 8 signals in BEQ (they will be named xyz_FL xyz_FR and so on after the channel layout)

* link FL, FR, FC together under 1 filter, LFE on another and the surrounds on another

* tweak each filter independently

* save the result to a shareable (gzipped json) format that anyone else can load

* save pngs and/or graph the difference between signals

This should work on linux without the hack above as I removed the offending library. I haven't had a chance to test this yet though.

  • Like 1

Share this post


Link to post
Share on other sites
On 9/8/2018 at 10:30 PM, Kvalsvoll said:

Excellent, @3ll3d00d, will try this now.

 

Does not run on my system, so I test it on windows instead, no problem.

Focus on improving functionality of the beqdesigner instead of trying to support running on a system that very few actually has.

It is not that the app can not run on ubuntu linux, it has to do with the effort that is needed to make it work.

Now, there is a problem with my windows app - add signal does not work, the graph does not show all signals, and the last release does not create the xys_fl, .., signals. Extract audio works and creates a .wav, but this wav can not be loaded afterwards.

Share this post


Link to post
Share on other sites

Can you be more specific about steps to reproduce? as it seems fine here and for some other users (not to say there can't be bugs of course  😀 )

Share this post


Link to post
Share on other sites
1 hour ago, 3ll3d00d said:

Can you be more specific about steps to reproduce? as it seems fine here and for some other users (not to say there can't be bugs of course  😀 )

Seems to work now, but I do not see the individual 8 signals.

Extract Audio, then Create Signals, and I get a graph with peak and avg. I can then create filters, and the graph shows filtered response. 

As it is now, this is a great tool for creating beq for dsp. And it helps creating a remastered sound track because it is much faster and easier to find the right filters.

Share this post


Link to post
Share on other sites

So I see that BEQ has suddenly taken off on AVSForum, which appears to have partly inspired @3ll3d00d's designer software.  These are very positive developments.

However, I'm a bit disappointed to see that the BEQs posted to AVSForum are intended to be applied to all channels, and there appears to be little if any post-BEQ QC performed.  Instead, most of these seem to involve EQing the PvA to flat and calling it enough.  I even see people arguing that the quality of a BEQ should be judged "objectively" by how smooth or flat the resulting PvA is.  Ugh!  I fear many of these BEQs may be doing more harm than good to the track.

As we know very well here, a PvA is not a reliable predictor of perceived tonal balance on a track.  It's certainly informative, but is nowhere near definitive.  There's really no way to know how something sounds without listening to it on a good "reference" system and making a subjective judgment.  Undoubtedly, this is complicated by the facts that personal preferences vary and that it is not yet known how to calibrate different bass systems to sound exactly the same, but I don't know of a better way to deal with the problem.  It's probably perfectly OK if there are multiple BEQs out there.  Different people will have different insight and of course will hear different things.

FWIW, I have a pretty aggressive house curve on my system which arises from my novel calibration approach based on the concept of apparent power.  Curiously however, my approach leads me to a curve that tops out around 20 Hz and is somewhat diminished (by a few dB) below there.  Furthermore, I've noticed that soundtracks I like also frequently have a bit less ULF than 20-40 Hz bass.  They don't have a steep shelf or HPF but often they don't push levels below 20-40 Hz that much.  I think @maxmercy gets this right by looking at each channel and trying to ascertain what filter/filters were used rather than just making the PvA look pretty and listening to the final result.  I believe it makes all the difference.

All the same, it might not matter much for most people, especially those using Crowsons.  I doubt very many bass systems out there are particularly balanced, including those with very high output capability.  If one's sound already leans heavily in certain directions (such as ULF over mid-bass or vibration over acoustic) then the nuances of better quality BEQ quality may be mostly missed.  The ability to send a lot more content to the Crowsons may be "good enough" for most people.

P.S.  I expect to evaluate @maxmercy's "Ready Player One" BEQ hopefully this weekend.  It looks like one I will enjoy.  :)

Share this post


Link to post
Share on other sites
4 hours ago, Kvalsvoll said:

Seems to work now, but I do not see the individual 8 signals

if you uncheck the "mix to mono" checkbox and click extract then once it finishes, the button should change to "Create Signals" and the field at the bottom will be enabled. Put something in here and click "create signals".

https://imgur.com/a/uoOh3Hr

It should then automatically close the dialog and add each channel as a separate signal using the channel names (taken from https://trac.ffmpeg.org/wiki/AudioChannelManipulation#Layouts)

https://imgur.com/a/y7GGUU2

If this doesn't happen then feel free to log something with appropriate steps to reproduce/pics/supporting files over at https://github.com/3ll3d00d/beqdesigner/issues

similarly if you think of any interesting features then do also feel free to suggest them, I'll probably work on this for a little while longer at least.

Share this post


Link to post
Share on other sites
1 hour ago, 3ll3d00d said:

if you uncheck the "mix to mono" checkbox and click extract then once it finishes, the button should change to "Create Signals" and the field at the bottom will be enabled. Put something in here and click "create signals".

https://imgur.com/a/uoOh3Hr

It should then automatically close the dialog and add each channel as a separate signal using the channel names (taken from https://trac.ffmpeg.org/wiki/AudioChannelManipulation#Layouts)

https://imgur.com/a/y7GGUU2

If this doesn't happen then feel free to log something with appropriate steps to reproduce/pics/supporting files over at https://github.com/3ll3d00d/beqdesigner/issues

similarly if you think of any interesting features then do also feel free to suggest them, I'll probably work on this for a little while longer at least.

Unchecked the mono-button, and it works, great.

Still unable to Add signal, but that is not really necessary now.

Some cosmetics - graph display gets corrupted by legend, too few colors on graph signals.

Workflow - how you use the app - is very important, so that users easily understand how to use it. Now you must know that you start with Tools - Extract. When you know that, the rest is quite intuitive.

Functionality - nest step could be to implement signal processing to apply the filters to the sound track. Then re-mux the beq filtered back into the .mkv.

Most people will use hardware dsp on the bass system, so this would be of no use. And most people do not have access to the movie as a file, which effectively prevents them from using this app in the first place. This is something that this app obviously can not solve.

Share this post


Link to post
Share on other sites

@SME, the interest for bass-eq is very, very low considering the huge impact on sound experience. One reason for that is that very few people actually has a sound system capable of reproducing full range with decent capacity and quality.

One purpose of this thread was to create awareness, so that the producers deliver better, unfiltered sound in their movies. No bass-eq necessary. Only a few movies deliver that, even today it is rare to see a new release with full frequency range intact. The reason why is that they are clueless - they have no idea that anything is missing in their sound track. No producer would allow a filtered movie to be released if they knew their product could deliver a much better and more involving experience.

Most people play the bd and have no option to change the sound track, the only option is to use eq in a dsp somewhere in the chain, and since all decent bass systems has a dsp, it is convenient to implement bass-eq on the bass-system. The drawback is that you can not do individual filtering of the channels. But compared to no bass-eq, this is a good and very useable alternative. I prefer to do individual corrections, because it is better, @maxmercy is very clear on this, he is the true bass-eq purist among us.

  • Like 1

Share this post


Link to post
Share on other sites

One advice on bass-eq:

Bass-eq is not about correcting the frequency response of a movie sound track so that the spectral distribution becomes flat. Bass-eq is about lifting up the filtered ulf so that the level is restored back to what it was before filtering.

This can only be done by guessing how the spectrum should look like, and apply appropriate filters. There will be peaks and dips and deviations from a flat curve, depends on what sounds  are present in the sound track, and how they are made.

So a bass-eq correction should not look like the eq one could do on a bass-system, where peaks are cut down and frequency ranges with too high or too low level is corrected.

Though on some movies there can be improvements by cutting a few dB in the 30-40hz range, and to decide what works best, you have to listen to it and correct accordingly.

( @SME also speaks about this in his post above.)

Edited by Kvalsvoll

Share this post


Link to post
Share on other sites
6 hours ago, Kvalsvoll said:

Still unable to Add signal, but that is not really necessary now.

I don't know what this could be, you can go to Help > Show Logs (or press Ctrl+L), put it in debug and then repeat the activity to see if that tells you anything else

https://imgur.com/a/oTqQ0VF

6 hours ago, Kvalsvoll said:

Some cosmetics - graph display gets corrupted by legend, too few colors on graph signals.

I'm not sure what to do about the colour scheme, I've used the speclab style so far simply because it is what people are familiar with but this doesn't work for many signals (not enough shades and they're too close together). 

Note the controls in the bottom right of the main window let you turn the legend off if you prefer and choose which signals and/or filters are actually displayed.

https://imgur.com/a/4iSEnZZ

6 hours ago, Kvalsvoll said:

Functionality - nest step could be to implement signal processing to apply the filters to the sound track. Then re-mux the beq filtered back into the .mkv.

Interesting idea, noted in https://github.com/3ll3d00d/beqdesigner/issues/38

Share this post


Link to post
Share on other sites

@3ll3d00d, signal processing and remux would require some effort. First, all tracks must be extracted at original sample rate, then apply signal processing for the filters, and finish by muxing the new beq remaster track together with the original .mkv. Extract and remux is not difficult, you already use ffmpeg to extract, perhaps look at mkvtoolnix for the remux. Signal processing I am not sure of, would start to look at ffmpeg to see what functionality is available, also search for open-source projects.

Graph files of movies would be very beneficial for most users, as they will not have access to the movie as a .mkv file, but  could still use the beqdesigner if graph files are available. This also prevent problems with copyright issues, which would be an issue if it was necessary to make the sound track file available.

Lots of movies have already been analyzed, and if the graphs were accessible in some kind of library, people could find them there, and use beqdesigner with no need to extract audio files. 

Share this post


Link to post
Share on other sites

Forgive me if this doesn't make sense as I haven't looked at the  code yet, but ...

Isn't signal processing already done?  How else does one preview the effect of applying filters?

Otherwise, it's pretty easy.  The main issue is that pure Python code for biquad processing will be very slow without help from an external library or module.  I have about 40 lines of C code (including ".h" header) which does the job and can be loaded in a Python program using cffi.  The "hard" part is the housekeeping required to ensure the C module gets built or distributed as needed for different platforms.

1 hour ago, Kvalsvoll said:

Graph files of movies would be very beneficial for most users, as they will not have access to the movie as a .mkv file, but  could still use the beqdesigner if graph files are available. This also prevent problems with copyright issues, which would be an issue if it was necessary to make the sound track file available.

Lots of movies have already been analyzed, and if the graphs were accessible in some kind of library, people could find them there, and use beqdesigner with no need to extract audio files.

Technically, this only works if the EQ is the same on all channels.  Even then, there's no way to know for certain whether the EQs will cause a signal that's worse than the usual worst-case scenario (i.e. full-scale on one channel or all channels simultaneously), which may cause many systems to clip downstream.  Also note that distributing graphs for each channel separately does not allow for different EQ on different channels because of phase effects.

Edit: I see that the frequency response of the biquad is calculated using scipy.signal.freqz() which evaluates the transfer function of a biquad filter but is not suitable for actually applying the filter to a stream.

... With that in mind, the beqdesigner probably does not handle filters on separate channels correctly because, related to my note above, the only way to compute the combined PvA is by actually applying filters to each stream, summing the outputs, and applying the PvA analysis to the result.  That's because the phases won't necessarily match between channels at any given time.  This is actually a big problem because to do it "right", the entire soundtrack essentially has to be reprocessed each time an adjustment is made to the EQ for a channel.  I think a re-analysis must also be performed to compute peak levels on each channel and for the combination to check for clipping potential.  I believe these re-analyses are among the most time consuming part of @maxmercy's current process.

Share this post


Link to post
Share on other sites

@SME, the graph files would be used by those who do not have the .mkv file, and thus have no intention of doing eq on individual channels. Or by someone like me, when I just want to watch a movie using the bass-system dsp to do a simpler bass-eq, not wanting to spend hours to do the remaster process. For this, the bass-managed graph will do just fine, and when applying proper eq in dsp on the bass-system there will not be problems with internal clipping.

@3ll3d00d, ffmpeg can do the necessary signal processing, filters are available. I just took a brief look into what is in there, and I believe ffmpeg also can handle the remux.

The process of applying the filters to the .mkv should be automated, so that you run this as a command after creating all filters and adjustments. This will take some time, because all channels must be extracted, processed and then put together into one new track, at full sample rate, which is then at last remuxed into the original .mkv so that you end up with an additional bass-eq track. Using flac encoding is a good idea here, saves space and bandwidth.

This can be done.

Share this post


Link to post
Share on other sites
2 hours ago, Kvalsvoll said:

@SME, the graph files would be used by those who do not have the .mkv file, and thus have no intention of doing eq on individual channels. Or by someone like me, when I just want to watch a movie using the bass-system dsp to do a simpler bass-eq, not wanting to spend hours to do the remaster process. For this, the bass-managed graph will do just fine, and when applying proper eq in dsp on the bass-system there will not be problems with internal clipping.

What you describe could be done by import/export of raw PvA data, which should be quite easy to implement.  We'd also need a place on-line to host exported data so that people could enjoy the benefits you describe.

At the same time, processing is still necessary in order to support key features including headroom/clipping analysis and independent channel BEQ.  It does appear that ffmpeg supports generic biquads, so that is an option.  However because processing is needed for "internal use" in addition to the use case of processing .mkvs, using ffmpeg may be a bit clumsy.  I don't know the program well enough to say for sure.

What I do know is that one probably wants the processing to support streaming, and it should be as fast as possible including using multiple CPU cores.  I would suggest a simple multi-process architecture using UNIX sockets, but this thing has to run on Windows.  :( As such, code to support the Windowsy methods for inter-process communication would have to be written as well.

If there is interest, I'm willing to contribute my C/Python code to do stream processing of biquads along with a simple makefile for builds on UNIX.  For Windows, someone else will have to step in, and whoever builds the Windows binary release will have to have a Windows C compiler tool-chain.  If asked, I would write code for the multi-process streaming processor using UNIX sockets as well, but I don't think it would work on Windows.  ;)

Edit: Actually, I think I could make a version that'll run multi-core just using the standard Python multi-threading support.  It should work fine cross-platform.

Share this post


Link to post
Share on other sites

There seems to be some confusion about what the app actually is at this point in time so let me clarify.

It's an interactive *per channel* minimum phase filter designer with the tools required to quickly and easily work with either mono bass managed tracks or multichannel tracks, i.e. designing pre or post BM BEQ filters.

Interactive means it must be quick hence the filter view is based on the transfer functions. Obviously this wouldn't work if we were trying to combine channels but we're not (except when extracting the source track which is pre filter) so this is fine. 

A post filter clipping check is something I am aware of and had logged it at https://github.com/3ll3d00d/beqdesigner/issues/19 a while ago. This isn't hard to implement (both sox and ffmpeg can apply biquads) so it's just a question of time and desire to implement the feature. One could also implement this in python using scipy or there are other python libs (with an underlying C impl, e.g. http://ajaxsoundstudio.com/pyodoc/) that could also be used if scipy is too slow. Having said that I would have thought that would be something that happens relatively infrequently as a final check so working with existing cli tools seems fine to me and would be quick and easy to implement.

@Kvalsvoll the bit I don't get is why you want to remux that back into the original track. If you're playing an mkv then you're already on a computer that can do the filtering in real time so why would you want to alter the source itself? 

Share this post


Link to post
Share on other sites
1 hour ago, 3ll3d00d said:

There seems to be some confusion about what the app actually is at this point in time so let me clarify.

It's an interactive *per channel* minimum phase filter designer with the tools required to quickly and easily work with either mono bass managed tracks or multichannel tracks, i.e. designing pre or post BM BEQ filters.

Interactive means it must be quick hence the filter view is based on the transfer functions. Obviously this wouldn't work if we were trying to combine channels but we're not (except when extracting the source track which is pre filter) so this is fine.

So AIUI, if one is doing a multichannel BEQ there's currently no way to generate a graph showing the bass-managed result.  Doing so requires re-analyzing the track, just like calculating headroom limitations.  One can of course make some assumptions and calculate an estimate of the bass-managed result, but it won't match the real thing which requires a longer run.

1 hour ago, 3ll3d00d said:

A post filter clipping check is something I am aware of and had logged it at https://github.com/3ll3d00d/beqdesigner/issues/19 a while ago. This isn't hard to implement (both sox and ffmpeg can apply biquads) so it's just a question of time and desire to implement the feature. One could also implement this in python using scipy or there are other python libs (with an underlying C impl, e.g. http://ajaxsoundstudio.com/pyodoc/) that could also be used if scipy is too slow. Having said that I would have thought that would be something that happens relatively infrequently as a final check so working with existing cli tools seems fine to me and would be quick and easy to implement.

I didn't see anything suitable for streamed processing with biquads in scipy.signal but I may have not looked closely enough.  If you're already requiring ffmpeg for extraction, then it makes sense to try it for processing.  Hopefully it does the job well.

Share this post


Link to post
Share on other sites
4 hours ago, SME said:

if one is doing a multichannel BEQ there's currently no way to generate a graph showing the bass-managed result

That is correct, it will get added at some point though.

Share this post


Link to post
Share on other sites
12 hours ago, 3ll3d00d said:

...

@Kvalsvoll the bit I don't get is why you want to remux that back into the original track. If you're playing an mkv then you're already on a computer that can do the filtering in real time so why would you want to alter the source itself? 

There is no dsp available on the computer. But that is possible to fix, this is a linux machine running ubuntu and kodi, it would be difficult to implement at the time it was built, but there may be options available now.

If filtering is done real-time during playback there is no need to do any processing on the soundtrack.

This does however require some sort of analysis to ensure no clipping.

Share this post


Link to post
Share on other sites

Another issue that may be a lot more challenging to address is proper support for the lower-end MiniDSP devices, the 2x4 and 2x4 balanced, which use 56-bit fixed point processing instead of floating point.  This causes errors due to precision loss below 20-30 Hz, which become worse with decreasing frequency.  These errors can be substantial even when using the MiniDSP in the mode that is optimized for low frequencies, without which any kind of ULF EQ is pretty much useless.  I got bit by this problem pretty hard back when I used a MiniDSP 2x4 for in-room sub EQ.  The errors are not small.

Even with a floating point implementation, the precision of the floats may matter.  (I haven't thoroughly tested it.)  Processing the audio in 32-bit float format should be good enough, but the biquad coefficients and temporary variables may need to be double precision for sufficient ULF accuracy.  My implementation does this.  I don't know if the floating point MiniDSP units represent the biquad coefficients and temp variables as 64-bit or not.  Likewise, I don't know how much precision the fixed point MiniDSP units use to represent the biquad coefficients.  These are details that may need to ascertained by reverse engineering in order make tools like beqdesigner as accurate as possible.

What about DSP built into amps?  It's the same story there too, and each device may behave differently.  (This is probably part of the reason many amps don't allow filters below 20 Hz.)

These issues don't just affect beqdesigner but affect implementation of the BEQs posted in this thread too.  It's just that the independent channel BEQs are designed to be implemented upstream of bass-management, which limits the devices that can be used to apply them to devices that probably have at least 32-bit float precision.

Along these lines, it would probably be good to investigate ffmpeg to understand how it will process biquads.  I took a look just now.  It appears that the internal implementation supports 16-bit and 32-bit integers along with 32-bit and 64-bit float with coefficients always being represented using 64-bit float.   The integer formats don't offer any headroom, and because each biquad is processed separately, clipping will occur immediately if any one biquad pushes the signal above full-scale, even if this excursion would have been canceled out by a later biquad.  As such, it is crucial that ffmpeg be used in such a way that it uses floating processing internally, and of course, the result will only be accurate for the highest precision floating point DSPs.

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×