Author Topic: PC source with DRC capabilities  (Read 6444 times)

Offline ozmillsy

  • Hero Member
  • *****
  • Posts: 2167
  • Liked: 245
Re: PC source with DRC capabilities
« Reply #40 on: June 24, 2015, 09:36:52 PM »
Of course there are antinodes, note I said "typical corrections" ;)
Absolutely,  and we agree that requiring boost is 'typical' for most rooms. 

Quote
It's entirely possible to linearise amplitude responses below unity.
Goes without saying,   and the question is how far down are we taking it?    Acknowledging that if we start with a 16 bit file, and if we end with a 16 bit file,   then it doesnt matter what the tools are doing in between - there will be a loss of resolution,  and/or dynamic range (if we employ limiters to prevent clips).

Quote
It's possible to run a -ve gain adjustment prior to filtering to provide some effective headroom pre-linearisation,
Not just possible, its mandatory if you want to avoid clips,  if acknowledging that boost is typically required.

Quote
it's possible to pass data in higher bit depths. BruteFIR is nicely flexible; it all-ows pre gain adjustment (I run not a lot as I've a bit of work on signal levels), it'll pass through - and process in 32-bit depth (another 16 bits aren't necessary, but it's easier on the CPU).

What matters is what bit depth you start and end with.   Upsampling into larger address range is all well and good, if you are going to leave it in large address range and play it back at the higher sampling rate.   
If we are going to dither back down to 16bit,  then upsampling doesnt help us avoid resolution loss.   
16bit doesnt actually give us alot of room to move.   Give ourselves 6db of headroom, and we're down to 15 bits max range,  low level info in the data starts to disappear into the noise floor.

Quote
It's helpful that the Amanero takes a 32-bit input.
Yeah,  but our dacs are 16bit. 

Quote
Kinda mindful that there are practical limits to amplitude response correction,
[snip]
So we end up with broadly flat (or whatever the target is) response in the linearised signal with some dips where the system response was excessively low.
I'd hope we're not only mindful,  but we are checking whether our resulting files contain clips.   How much adjustment are you limiting yourself to?    And how close to target curve are you able to get?

Quote
From a psychoacoustic perspective we probably put too little importance on phase response correction in multichannel signals - it's something that can't be experienced in an EQ (either in spectral resolution or accuracy). It's audibly awesome.
There's not alot of EQ solutions that do apply phase filters as part of equalisation, Dirac does, and I'm getting good results with it.      But,,,,the most comprehensive way to attain coherency, is to do per driver level phase and FR equalisation.     The results can be very very good.   

I tend to think that DRC pretty much mandates high resolution dacs.   Then again,,,,, the pros could well outweigh the cons.

« Last Edit: June 24, 2015, 09:46:17 PM by ozmillsy »
It's all about the music,, not the equipment.

Offline RMP

  • Newbie
  • *
  • Posts: 26
  • Liked: 16
Re: PC source with DRC capabilities
« Reply #41 on: June 24, 2015, 10:26:39 PM »
I don't think we're disagreeing anywhere!

Maintaining resolution in bit depth means expanding the address space, doing some math, being intelligent about what's packed back into the address space available into the DAC. The Amanero requires a 32-bit input, however yes, the last 16 are truncated into the TDA.

And I do get what you're suggesting about 16 bits being limiting when against large amplitude response. though the tradeoff 16 to 15 or even 14 bits can be practically small (music tastes, background noise... I'm not going to doubt that in an ideal listening scenario + a nice glass of red that they don't matter). There's not quantitative measure to compare loss in SNR against linearisation effects... the question really is 'does it sound better'? Depends on the listener, depends on the install. A bit like suggesting that I have 24-bit DACs, though I like the sound of this 16-bit item a good bit more, and even more when it's corrected. Some 24-bit material (I have some 2L stuff) on the right DAC gives a really impressive 'black', and 24 bits is probably overkill enough to sacrifice 1 or 2 bits to linearisation against what my ears can actually hear... though again... I like the compromise I have now much more. As you suggest, pros vs cons.

You can get around the headroom space argument (e.g. clipping) simply by limiting amplitude gain in linearisation. Fixes the peaks, keeps the troughs. The rest is about finding a happy medium... there are no silver bullets. An interesting experiment might be to write a filter that corrects phase response only, and leaves amplitude response alone. I'd suggest it's possible given the right software... though frankly it's been a while since uni and it's possibly a task for someone else and a copy of MATLAB or Octave.

I'd stress again that it's important to know where to go mild on the filter.

DIRAC is a development of DRC; it does some nice things in terms of taking practical measurements for multiple listening locations rather than applying theoretical assumptions, though at the listening position the results should be no different.

Doing is per driver would be awesome - (more talented) people have using the same solution I've employed, and their configuration scripts look pretty bloody awesome compared to mine. Here's an earlier version without any attenuation thrown in - this simply convolves a file 'test.pcm' to one called 'out.pcm' (the final config runs realtime to system devices). Getting a 32-bit PCM file in the right format is pretty straightforward, you'd need to use something like SoX with "-t f32" for format parameters. It's also possible to change conversion formats internally. You can see the way it's laid out, it's pretty easy to expand this beyond two drivers and do a great deal with it... "filter-l.pcm" and "filter-r.pcm" are what's generated with DRC. This is very little modified from the default DRC config file.

(In posting it here I'm hoping someone will throw rocks at it!)

## DEFAULT GENERAL SETTINGS ##

float_bits: 64;             # internal floating point precision
sampling_rate: 44100;       # sampling rate in Hz of audio interfaces
filter_length: 4096,16;       # length of filters
#config_file: "~/.brutefir_config"; # standard location of main config file, it's here (which is default) but doesn't seem to like this NOT being commented out
overflow_warnings: true;    # echo warnings to stderr if overflow occurs
show_progress: true;        # echo filtering progress to stderr
max_dither_table_size: 0;   # maximum size in bytes of precalculated dither
allow_poll_mode: false;     # allow use of input poll mode
modules_path: ".";          # extra path where to find BruteFIR modules
monitor_rate: false;        # monitor sample rate
powersave: false;           # pause filtering when input is zero
lock_memory: true;          # try to lock memory if realtime prio is set
sdf_length: -1;             # subsample filter half length in samples
convolver_config: "~/.brutefir_debug"; # location of convolver config file

## Filter definition ##

coeff "drc_l" {
       filename: "filter-l.pcm";
       format: "FLOAT_LE";     # file format
       attenuation: 0.0;   # attenuation in dB
       blocks: -1;         # how long in blocks
       skip: 0;            # how many bytes to skip
       shared_mem: false;  # allocate in shared memory
};

coeff "drc_r" {
       filename: "filter-r.pcm";
       format: "FLOAT_LE";     # file format
       attenuation: 0.0;   # attenuation in dB
       blocks: -1;         # how long in blocks
       skip: 0;            # how many bytes to skip
       shared_mem: false;  # allocate in shared memory
};

## INPUT DEFAULTS ##

input "l_in", "r_in" {
device: "file" {path: "test.pcm"; };
sample: "FLOAT_LE";
channels: 2;
};

output "l_out", "r_out" {
device: "file" {path: "out.pcm"; };
sample: "FLOAT_LE";
channels: 2;
delay: 0,0;
dither: false;
};

## FILTER DEFAULTS ##

filter "l_filter" {
      from_inputs: "l_in";
      to_outputs: "l_out";
      process: 0;        # process index to run in (-1 means auto)
      coeff: "drc_l";          # -1 means "copy"
      delay: 0;           # predelay, in blocks
      crossfade: false;   # crossfade when coefficient is changed
};

filter "r_filter" {
      from_inputs: "r_in";
      to_outputs: "r_out";
      process: 0;        # process index to run in (-1 means auto)
      coeff: "drc_r";
      delay: 0;           # predelay, in blocks
      crossfade: false;   # crossfade when coefficient is changed
};

Offline ozmillsy

  • Hero Member
  • *****
  • Posts: 2167
  • Liked: 245
Re: PC source with DRC capabilities
« Reply #42 on: July 04, 2015, 09:04:46 AM »
I don't think we're disagreeing anywhere!
Not sure what there is to disagree about.    You've said yourself,  we make choices based on compromise.     I am still interested to see the specifics of what you're actually doing.

Quote
And I do get what you're suggesting about 16 bits being limiting when against large amplitude response. though the tradeoff 16 to 15 or even 14 bits can be practically small (music tastes, background noise... I'm not going to doubt that in an ideal listening scenario + a nice glass of red that they don't matter).

Ever used a digital volume control that bit stripped, and compared it to an analog volume control?    The degradation in sound due to loss of resolution with the DVC is shocking, and these losses shouldnt be understated.  I dont believe we are on the same page WRT the practical losses associated with 16bit vs 14bit.  We could argue the analog VC is influencing our perceptions (making it sound nice), but the interesting thing is what happens to the sound when you knock off volume on the DVC,  it becomes coarse. 

Quote
There's not quantitative measure to compare loss in SNR against linearisation effects... the question really is 'does it sound better'? Depends on the listener, depends on the install.

Depends how you compare,  we can easily fool ourselves with a flawed approach to validating the changes in sound/perceptions.

Quote
A bit like suggesting that I have 24-bit DACs, though I like the sound of this 16-bit item a good bit more, and even more when it's corrected. Some 24-bit material (I have some 2L stuff) on the right DAC gives a really impressive 'black', and 24 bits is probably overkill enough to sacrifice 1 or 2 bits to linearisation against what my ears can actually hear... though again... I like the compromise I have now much more. As you suggest, pros vs cons.
Yes,   but, let me throw a wild thought out there.    Perhaps digital equalization is a lazy mans tool,  to fix the flaws in a system and room ??   
It's a question, not statement.  I dont mean to ask it in an inflamatory way.   
Some will tell you, that it's impossible to fix room issues without EQ.   I'm not convinced about that at all, it's just easier to EQ.   

Are we still agreeing?   8)     

Perhaps the pros of setting up a system in the traditional way (the hard way), using manual methods to tame room/system issues,  far and away outweigh the cons of relying on digital equalization?       I ask this question, having experimented with both (and acknowledging that digital EQ in the 16bit space does have compromises).

 1 of the fantastic things about the Killerdac, is it allows me to easily make any number of changes (to the dac) to tailor the sound.  I've run my Kdac in 4 different homes/rooms now,   each time I have moved,   I have had to retune my 2ch hifi system around the new room.  Retune can mean any number of changes,   but can and has included tweaking the source (the dac).   

It's not just a great sounding dac,  it's a flexible one,  that can be bent to suit what your system/room needs.   This is the real beauty and strength of it.  Now we could say, yeah but we could do the same to other dacs.  Not really, they are not typically built in a way where the user expects to make changes.  It's bloody difficult to work on most dacs.

Quote
You can get around the headroom space argument (e.g. clipping) simply by limiting amplitude gain in linearisation. Fixes the peaks, keeps the troughs.

Is that what you are doing?    Not all that interested to discuss what is possible,   I'm more interested to discuss your process, and what equalisation modifications you are actually trying.   It's still unclear.   Your config file doesnt tell me.

Lets say you are limiting.   This doesnt mean everything is fixed.   Limiting just helps avoid digital clipping.   e.g. If your room requires a 6db boost at 200hz,  and the limiting prevents your equalization tool giving you 6db boost at 200hz, because the material has loud music in that range,  then you are still faced with a room issue (i.e. the practicality is, you still have a dip in the room response at 200hz).

A potentially better approach, is to figure out why there is a 200hz room response dip in the first place?   Repositioning speakers, or applying room treatments to minimise reflections, are techniques to tame room nodes.

Quote
An interesting experiment might be to write a filter that corrects phase response only, and leaves amplitude response alone.
Why?     A phase filter will fix anomalies introduced by amplitude changes,  when changing the amplitude of some frequencies, but not others.   
i.e.  an amplitude change only at 100hz,  will impact the phase accuracy of the frequencies around 100hz that havent had (the same) amplitude change.

Make no amplitude changes,  the phase filter has nothing to do.

Tools are good,  provided we have a good understanding of why we are using them.
« Last Edit: July 04, 2015, 10:22:21 PM by ozmillsy »
It's all about the music,, not the equipment.

Offline RMP

  • Newbie
  • *
  • Posts: 26
  • Liked: 16
Re: PC source with DRC capabilities
« Reply #43 on: July 13, 2015, 04:47:34 PM »
Ever used a digital volume control that bit stripped, and compared it to an analog volume control?    The degradation in sound due to loss of resolution with the DVC is shocking, and these losses shouldnt be understated.  I dont believe we are on the same page WRT the practical losses associated with 16bit vs 14bit.  We could argue the analog VC is influencing our perceptions (making it sound nice), but the interesting thing is what happens to the sound when you knock off volume on the DVC,  it becomes coarse. 

Yep. Have used both. No doubt a good analogue control is better. Don't have the luxury given the way the system is used, unfortunately. I'm left, at present, with a digital control - though I wouldn't call what it does pure bit-stripping. If purely bit-stripping then yes, things will get coarse very quickly.

Yes,   but, let me throw a wild thought out there.    Perhaps digital equalization is a lazy mans tool,  to fix the flaws in a system and room ??   
It's a question, not statement.  I dont mean to ask it in an inflamatory way.   
Some will tell you, that it's impossible to fix room issues without EQ.   I'm not convinced about that at all, it's just easier to EQ.   

Are we still agreeing?   8)

That's fact and not a wild thought - though for most of us not building anechoic chambers to listen in, it's reality. We're due for renovation here soon however I am still one member in a home that suits more than one, and I often don't get the deciding vote! From a pure physics perspective I'd contend that it'd be very difficult to fully correct the entire frequency range digitally, and it's very difficult to get flat response low-down through room engineering (in most homes)... though this really depends on your target. Is 'flat' what's sought?

I'll admit to my target response starting out kinda flat and having had some tweaking since. Tastes differ here. Usual accuracy vs musicality debates etc.

Perhaps the pros of setting up a system in the traditional way (the hard way), using manual methods to tame room/system issues,  far and away outweigh the cons of relying on digital equalization?       I ask this question, having experimented with both (and acknowledging that digital EQ in the 16bit space does have compromises).

I take a different look at it - one complements the other, and though you certainly could use digital methods to alleviate the need to do any work traditionally, you'd be lucky if your corrections (in amplitude response particularly) weren't obtuse enough to blow your headroom. I started with digital methods here after spending a few weeks on placement, orientation and room condition. There's of course more that can be done, though we're a reno away from some of it.

1 of the fantastic things about the Killerdac, is it allows me to easily make any number of changes (to the dac) to tailor the sound.  I've run my Kdac in 4 different homes/rooms now,   each time I have moved,   I have had to retune my 2ch hifi system around the new room.  Retune can mean any number of changes,   but can and has included tweaking the source (the dac).   

It's not just a great sounding dac,  it's a flexible one,  that can be bent to suit what your system/room needs.   This is the real beauty and strength of it.  Now we could say, yeah but we could do the same to other dacs.  Not really, they are not typically built in a way where the user expects to make changes.  It's bloody difficult to work on most dacs.

Agreed; component changes will affect frequency response (and other factors). For now though I'm not intending to work on mine (I have other problems to solve, other areas where there are more immediate gains).

Is that what you are doing?    Not all that interested to discuss what is possible,   I'm more interested to discuss your process, and what equalisation modifications you are actually trying.   It's still unclear.   Your config file doesnt tell me.

In part yes, though I'm linearly dropping some amplitude first - gives a little more room for correction.

I'd stress that this is the config file for the convolving engine, not the filter generation.

Lets say you are limiting.   This doesnt mean everything is fixed.   Limiting just helps avoid digital clipping.   e.g. If your room requires a 6db boost at 200hz,  and the limiting prevents your equalization tool giving you 6db boost at 200hz, because the material has loud music in that range,  then you are still faced with a room issue (i.e. the practicality is, you still have a dip in the room response at 200hz).

A potentially better approach, is to figure out why there is a 200hz room response dip in the first place?   Repositioning speakers, or applying room treatments to minimise reflections, are techniques to tame room nodes.

Agreed, though two things here: (1) as mentioned this is why there's an amplitude reduction upstream and (2) it's not solely about amplitude response - the aforementioned dip comes with a phase component, two in fact, and there's a significant advantage in their alignment alone. Something a traditional EQ can't often do.

I'm aware of my room modes - right now there's little I can do. Some physical restrictions, some technical restrictions, mostly wife restrictions. It'll come. It won't be perfect when done, and that's what the digital system corrects. I don't believe you can do it all digitally, or that you should.

Why?     A phase filter will fix anomalies introduced by amplitude changes,  when changing the amplitude of some frequencies, but not others.   
i.e.  an amplitude change only at 100hz,  will impact the phase accuracy of the frequencies around 100hz that havent had (the same) amplitude change.

Make no amplitude changes,  the phase filter has nothing to do.

It's possible to create a digital filter for phase only, or with a phase correction only at one frequency. It'll look like a series of complex numbers where the real components are all unity (1) and the imaginaries are whatever the correction is designed to be. In a discrete Fourier transform sense, these are convolved independently as a vector component.

I'd simply be interested to hear the digital phase correction independent of the amplitude correction, because, as you point out, in an psychoacoustic sense the two are not easily separated.

Tools are good,  provided we have a good understanding of why we are using them.

Indeed so.