Welcome, Guest
Username: Password: Remember me

NOTE: This is a "Community" forum. Please be mindful that community members are here to help as part of a community effort. We therefore appreciate your effort in keeping this forum a happy place!

If you have a specific issue (e.g. hardware, failure) and want help from our support team, please use our tech support portal (Support menu - > Contact Us).
Thanks a lot of your help in making a better community.

TOPIC:

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48111

  • Tony_J
  • Tony_J's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 223
  • Thank you received: 88
There have been many and various references to this subject over the past few months, and not enough clarity provided by @devteam, so I have been conducting some experiments that will hopefully shed some light on the issue. Some past discussions on this subject can be seen here (and elsewhere):

www.minidsp.com/forum/dirac-series-suppo...nting-clipping#46176

The problem:
While there is a paper in the online documentation that discusses the importance of gain structure external to the miniDSP, there is little discussion of the equivalent issue in the digital domain, i.e., from when the DDRC receives an input signal through to when it outputs that signal via its DAC(s), and what little discussion there is is incomplete. In particular, there is no indication of how much (if any) headroom there is internally to the DDRC-24 - the various level controls and PEQ settings allow the user to specify a boost of up to 12dB on the level controls on the output channels or up to 16dB in a PEQ setting, but there is no indication of whether applying such a boost is handled by headroom in the DDRC firmware or not. Also, while there is a nice flow chart in the DDRC manual in section 1.2 "How the DDRC-24 Works" that shows the various elements and the order of processing, there is no indication of where in the flow the DDRC's Master Volume control is applied, or where the digital meters in the Dirac Inputs display and the four output channels are applied.

The reason this all becomes interesting is that Dirac can (and does) generate filters that can apply a boost to some frequencies, in order to meet the demands of the target curve used. It is also possible for the user to add PEQ filters (and output channel level settings) in the output sections that generate a level boost. Therefore, if we are to avoid the possibility of clipping of the output signals, it is important to know how the DDRC-24 treats its signals internally. Obviously, this can only ultimately be determined by looking closely at the processor's code, but you can get a fair idea of what is going on by conducting tests. In particular, I was keen to validate what I had read elsewhere in this forum (no idea now which thread) that suggested that the internal floating point maths used in the DDRC is able to manage a "headroom" of the order of +100dB, and I wanted to check this out.

In the thread I linked to above, I made the following statements that I wanted to re-visit and confirm:

- If the signal applied to the analogue inputs exceeds 4v or 2v RMS, then the ADC will clip.
- Internally, there is no heardoom issue for practical purposes (I read elsewhere in the forum that the headroom is at least 100 dB internally, because the hardware uses 32 bit arithmetic).
- If any filter elements that are applied in the digital domain can result in any part of the digital signal being boosted above 0dB, then it is essential to apply a corresponding overall level cut before outputting to the DAC, otherwise the resultant analog signal will exhibit clipping (i.e., any part of the waveform that cannot be represented in 24 bits is truncated to 24 bits).

It would also be helpful to the user to understand that the meters in the plugin show the level *after* any analogue signal has been through the ADC (in the case of the meters on the inputs) and *immediately before* the signal is output to the DAC (in the case of the meters on the outputs), and therefore, if you see the output levels peaking in the positive dB range, then you haven't applied enough of a cut.


The first of these is straightforward, and should be obvious; if you apply an analogue signal to the RCA input of the DDRC-24 and its voltage exceeds the maximum input voltage, then the ADC will clip the input waveform; what was (for example) a nice single-tone sine wave will have its tops and bottoms chopped off at a level corresponding to the max input voltage that the ADC can represent in 24 bits. Nothing magical there, and really no different to overloading the input of any preamp/power amp; don't do that.

The last point, about the location of the meters in the chain of elements shown in section 1.2 is also easy to confirm for the meters shown in the output channels; change any of the settings that could result in a level change at the output, including Master Volume, and the corresponding level meter changes. So it is a reasonable assertion to make that these meters show the signal levels that are being applied to the channel's DAC. I haven't got a suitable signal generator to hand, so I can't prove it conclusively, but I'm still pretty sure that the meters shown in Dirac Inputs are showing the levels before any processing in the DDRC (and it would make little sense for it to be otherwise) - i.e., for analogue inputs, they show the level that is being seen by the input to the ADC. With USB/Toslink inputs, this cannot exceed 0dB, but in the analogue input case, it can.

To test out the other points, relating to headroom, I switched off the Dirac filters and applied a 0dB signal to the USB input, using REW as a signal generator (turn the USB output on the PC up to max, then using the "Generator" tab, crank the output up to 0dB). I used a 250 Hz signal so it fell nicely in the range of the mid/bass output channel. I set all level controls downstream of the Dirac section to bypass or 0dB - Master Volume at 0dB, output channel levels at 0dB, and all PEQ filters bypassed. The input level meters showed a nice full-scale 0dB level, as did the output channel, and a quick check with a 'scope on the analogue outputs showed that I was still getting a nice clean sine wave, with no clipping. So far so good - as you might hope, you can pass a 0dB signal through the system and it doesn't clip.

Next I added a PEQ filter at 250 Hz, to give a 16dB boost. Not surprisingly, this results in the level meter for the output channel to go well into the red. On the 'scope, the analogue output now shows clipping, as you would expect, as the digital level exceeds what the DAC can deal with - the output is now more like a square wave. However, if you then apply a corresponding Master Volume cut of 16dB, then the output meter drops back to 0dB, and the clean sine wave output is restored. The same applies if you change the level control on the output channel to give a 16dB cut.

I then added 5 more PEQ filters, one at a time, all for 16dB boost at 250 Hz, and as these PEQ filters are additive, I was able to show that you could boost the (internal) level by 16, 32, 48, 64, 80, and 96 dB, and as long as you applied the corresponding level cut using Master Volume (or by changing the output channel level), the output level is restored to 0dB and the analogue output signal does not show any clipping.

My conclusion from this is that the DDRC-24's processor can indeed internally represent signal levels greater than 0dB, and at least as high as +96 dB, and that as long as the maximum level you actually apply to the DAC is no higher than 0dB, all will be well. In other words, these tests have validated the second and third bullets in the post I quoted above.

Of course, it is still the case that you only know for certain what level changes you have made by means of the output channel level controls and the PEQ filters, so you are still in the dark when it comes to exactly what Dirac has done in constructing its filter set, and how much boost those filters apply to the signal. However, I have realised that there is a way you can figure this out, using REW as a signal generator (or any other variable frequency signal source for that matter) - start at a very low frequency, observe the output level, increase the frequency,...etc., to show where there is boost being applied. The Generator in REW has a convenient 1/3 octave up/down button that helps with this - a quick scan of my favourite Dirac filter set showed a maximum boost of about 8dB over the 10 Hz to 20 kH range. You can also use Generator's "sweep" setting, with the max number of samples, to make a slow sweep across the frequency range, which is rather more accurate.

So, if I make sure that Master Volume never exceeds -8dB, then everything will be just fine. In practice, with my current system, if I were to run it with a 0dB input signal and Master Volume at -8, my ears would be bleeding, so that is unlikely to be an issue, but this could be very important information if you are running at maximum levels through the DDRC-24 and use a downstream analogue volume control - in that configuration you absolutely have to ensure that any headroom used internally within the DDRC-24 is compensated for by an overall cut before the signal reaches the DAC.
The following user(s) said Thank You: Wanderer, HansVanEijsden, Dunn, Ultrasonic, janwest, mikeburnsnz, Tw99, tallbeardedone

Please Log in or Create an account to join the conversation.

Last edit: by Tony_J. Reason: The meters are peak meters.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48120

  • Tony_J
  • Tony_J's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 223
  • Thank you received: 88
One thing that I didn't cover in the above is where I believe the Master Volume fits into the structure. I haven't figured out a way of determining that by testing, but my assumption is that it is located immediately before the meters in the output channels - at least, if I were designing the system, that's where I would put them. However, given that the internal representation has at least 96 dB of headroom, I don't think it much matters where the MV lives - the overall effect will be the same.

So my amended version of the block diagram in 1.2 of the manual would look like this (maybe @devteam would care to validate?):


Attachments:
The following user(s) said Thank You: Wanderer, janwest, mikeburnsnz, Tw99

Please Log in or Create an account to join the conversation.

Last edit: by Tony_J. Reason: The meters are peak meters.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48126

  • Ultrasonic
  • Ultrasonic's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 2887
  • Thank you received: 616
Interesting experiments Tony - thanks for investigating and taking the time to share this :) .

I'll just mention one complication which I think is important for anyone wanting to make use of this information. Given that music consists of multiple frequencies at once I unfortunately don't think the maximum boost applied can be guaranteed to tell us the 'safety margin' to apply to avoid clipping (as in not exceeding -8 dB on the master volume if a maximum boost of 8 dB is applied). For the sake of argument, suppose we had a signal consisting just of two different frequencies which when summed gave a resultant waveform with peaks at 0 dB. Now consider a Dirac filter that boosts one frequency by 8 dB and the other by 5 dB. I think the sum would then have peaks at +13 dB and so a master volume limit of - 8 dB wouldn't prevent clipping. Unless I'm missing something? Edited for stupidity on my part!

Of course, it is still the case that you only know for certain what level changes you have made by means of the output channel level controls and the PEQ filters, so you are still in the dark when it comes to exactly what Dirac has done in constructing its filter set, and how much boost those filters apply to the signal.


There is actually I think a quick way to see this using a microphone, which is to make a measurement with and without Dirac applied and divide one by the other in REW. I've done this and it works well I think.

Please Log in or Create an account to join the conversation.

Last edit: by Ultrasonic.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48127

  • Tony_J
  • Tony_J's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 223
  • Thank you received: 88

Interesting experiments Tony - thanks for investigating and taking the time to share this :) .

I'll just mention one complication which I think is important for anyone wanting to make use of this information. Given that music consists of multiple frequencies at once I unfortunately don't think the maximum boost applied can be guaranteed to tell us the 'safety margin' to apply to avoid clipping (as in not exceeding -8 dB on the master volume if a maximum boost of 8 dB is applied). For the sake of argument, suppose we had a signal consisting just of two different frequencies which when summed gave a resultant waveform with peaks at 0 dB. Now consider a Dirac filter that boosts one frequency by 8 dB and the other by 5 dB. I think the sum would then have peaks at +13 dB and so a master volume limit of - 8 dB wouldn't prevent clipping. Unless I'm missing something?


I think you are missing something. I'm sure you would agree that if, instead of Dirac boosting one by 8dB and the other by 5dB, you simply applied a blanket 8dB boost across the frequency range, the result would not be a 16dB boost for the two combined frequencies. So there's no reason why, if you then *reduced* the boost on one of them by 3dB, the combined boost would suddenly be 13dB instead of 8 dB.

Please Log in or Create an account to join the conversation.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48134

  • john.reekie
  • john.reekie's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 3778
  • Thank you received: 1594
Right. If the sum is 0 dB, then the individual components cannot also individually be at 0 dB.
With that said, Dirac Live is (or could be) also changing the phase relationships between the components.

Please Log in or Create an account to join the conversation.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48137

  • Ultrasonic
  • Ultrasonic's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 2887
  • Thank you received: 616
Yes, I was being thick! An attenuation to a waveform will attenuate all of the frequency components making it up, obviously. Shouldn't post tired...

I realised my mistake lying in bed last night actually but wasn't going to get up to correct it. I also thought of the phase issue that John has mentioned which I think does give a reason to want a bit more headroom than the maximum boost suggests. In that the way Dirac adjusts phases could lead to to some higher peaks even if frequency component amplitudes are unchanged. What a sensible margin above the maximum boost may be I'm not sure though...
The following user(s) said Thank You: Tony_J

Please Log in or Create an account to join the conversation.

Last edit: by Ultrasonic.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48141

  • Tony_J
  • Tony_J's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 223
  • Thank you received: 88
The point about phase changes is a good one - not at all clear to me how much that changes the game though.

As I said in the OP, this only really becomes an issue if you are trying to operate with minimal/no attenuation through the digital domain, and are relying solely on volume controls downstream of the DDRC. If you are feeding an attenuated signal into the DDRC and/or using Master Volume to control the levels, there is obviously going to be a good amount of headroom to play with anyway. Also, the particular set of filters DDRC has defined, coupled with the nature of the programme material you feed it, will have a significant effect - I only became aware of the problem because I had been operating with 0dB input levels, no attenuation in DDRC, and a downstream analogue volume control and one particular Yello track showed very nasty clipping on Malia's vocals when she hit the high notes. Just didn't notice it on anything else I played!
The following user(s) said Thank You: Wanderer

Please Log in or Create an account to join the conversation.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48142

  • Ultrasonic
  • Ultrasonic's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 2887
  • Thank you received: 616

As I said in the OP, this only really becomes an issue if you are trying to operate with minimal/no attenuation through the digital domain, and are relying solely on volume controls downstream of the DDRC. If you are feeding an attenuated signal into the DDRC and/or using Master Volume to control the levels, there is obviously going to be a good amount of headroom to play with anyway. Also, the particular set of filters DDRC has defined, coupled with the nature of the programme material you feed it, will have a significant effect - I only became aware of the problem because I had been operating with 0dB input levels, no attenuation in DDRC, and a downstream analogue volume control and one particular Yello track showed very nasty clipping on Malia's vocals when she hit the high notes. Just didn't notice it on anything else I played!


I haven't hit an obvious problem myself either. For TV signal I often do run the master volume at 0 dB but that's because the input (digital) signal level seems so low.

Where I do just need to be cautious is the complications I have in the mix from trying to combine audio and movie playback, using a mix of both balanced and unbalanced inputs to my subwoofer which invovles some signal boosting in one of my miniDSPs (can't remember which!). There is also an argument for me to remove the in-line (analogue) attenuators I use on my power amp inputs, although I think this might make the music vs movie discrepancy worse. I ought to investigate...

Please Log in or Create an account to join the conversation.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48197

  • Tony_J
  • Tony_J's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 223
  • Thank you received: 88

There is actually I think a quick way to see this using a microphone, which is to make a measurement with and without Dirac applied and divide one by the other in REW. I've done this and it works well I think.


I've tried that and compared with my method of looking at the output meters, and the REW measurements consistently overestimated the amount of boost by up to 2dB. The REW plots also gave all sorts of "interesting" readings above 6KHz that were obviously just plain wrong. Good enough to get an idea of what is going on, but for my money, you are better looking at the meters in the plugin.

Please Log in or Create an account to join the conversation.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48222

  • Ultrasonic
  • Ultrasonic's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 2887
  • Thank you received: 616

There is actually I think a quick way to see this using a microphone, which is to make a measurement with and without Dirac applied and divide one by the other in REW. I've done this and it works well I think.


I've tried that and compared with my method of looking at the output meters, and the REW measurements consistently overestimated the amount of boost by up to 2dB. The REW plots also gave all sorts of "interesting" readings above 6KHz that were obviously just plain wrong. Good enough to get an idea of what is going on, but for my money, you are better looking at the meters in the plugin.


We've discussed this more elsewhere but for the audience here I'll summarise that below 200 Hz I think the measurement method I described is probably the more accurate method and is certainly a considerably quicker and easier way to visualise what the Dirac filter is doing. At high frequencies, particularly in the kHz range, I would go with @TonyJ's approach.

Please Log in or Create an account to join the conversation.

Last edit: by Ultrasonic.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48283

  • Wanderer
  • Wanderer's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 62
  • Thank you received: 39
Hello,
@Ultrasonic I think it is more convenient and accurate to record the output signal directly from the miniDSP device's connectors and analyze the recorded data in an audio editor for clipping/distortion/etc. One needs an ADC if the signal is analogue. When using a microphone, you also capture possibly non-linear room response and phase interaction between speakers which is altered if left- and right-channel filters are different.

@Tony_J Thank you for posting your observations. Here is a nice sine generator program I usually use to test audio, in case you were looking for one.

sinegen.en.lo4d.com/windows

HTH

Please Log in or Create an account to join the conversation.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48284

  • Ultrasonic
  • Ultrasonic's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 2887
  • Thank you received: 616

@Ultrasonic I think it is more convenient and accurate to record the output signal directly from the miniDSP device's connectors and analyze the recorded data in an audio editor for clipping/distortion/etc. One needs an ADC if the signal is analogue. When using a microphone, you also capture possibly non-linear room response and phase interaction between speakers which is altered if left- and right-channel filters are different.


I would suggest that the most convenient method for the overwhelming majority is to use a microphone, since everyone using Dirac owns one whilst hardly anyone will have a way of accurately measuring the output :) . I don't but I agree this would be more accurate though. Note that this isn't what Tony did by the way but rather relied on reading off dB levels in the plugin, which only have 1 dB resolution.

Non-linearity of room or actually speaker response would be a limitation of the measurement approach but I wonder how significant this may actually be? Do you have any knowledge of this? Possibly I'm underestimating this but I didn't think this would be a major factor over the dynamic range we're considering here. Dirac corrections being effective relies on this actually.

I'm a bit confused by your comment about left and right filters being different being an issue, in that I'd make a separate pair of measurements for each speaker (one with and one without Dirac).

Based on the few tests I've done I strongly suspect that Dirac applies a maximum boost of 10 dB and so rather than measuring everyone could probably just work with this figure unless this much headroom posed them a real issue. Possibly with a further margin of a few dB for phase effects.

I should perhaps share an example of the sort of result I can get using the measurement method over the bass region (below). As I said above is does start to break down at higher frequencies, and I should add that I would leave the room for the measurements to remove your position as a variable affecting the results.

Please Log in or Create an account to join the conversation.

Last edit: by Ultrasonic.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48292

  • Tony_J
  • Tony_J's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 223
  • Thank you received: 88
Had another look at this having unearthed my Picoscope and fired it up. With the REW Generator set to 0dB output and the USB output on max and the Dirac filters switched off, you get a nice 0dB input signal to the miniDSP which (as you would expect) translates into a 0dB output as shown on the miniDSP output channel meters, and a ~2V RMS output signal on the RCA output. I say ~2V RMS, because it was actually a shade over 2V, and varied with frequency by a small amount. As it was unclear whether the variation was an artefact of the miniDSP's output circuitry or non-linearity in the 'scope's analogue measurement, I decided that the simplest way to get an accurate measurement was to measure the output voltage on the 'scope (it has tools for displaying peak/RMS voltage) with the Dirac filters switched off, then switch the filters on and adjust the REW output down until the output voltage returns to the level measured without the filters. The number of dB's of cut needed tells you how much boost Dirac is applying at that frequency. I went through this process for each selected frequency to make sure that any measured difference in the 0dB level was eliminated.

You could equally adjust the level slider on the miniDSP output channel, rather than the REW output level, to achieve the same result - and if you were at a frequency where Dirac applies a cut rather than a boost, you could then use boost on the slider to match the output voltages - same principle. Similarly, instead of a 'scope, a decent digital multimeter on the output should work just as well.

The results (see below) aren't a lot different from my earlier measurements - I've omitted the outliers at 11.3 Hz and in the 7K range because they are problematic. There's still a discrepancy between my measured values and the ones achieved using the REW "divide" method. Given that (I think) the measurement approach I used basically eliminated any external variables, such as the absolute accuracy of the 'scope, or in the case of REW, the effect of speaker/room/mic interactions, I think that the measurements I ended up with are pretty much as accurate as you can expect, and certainly good enough for the purpose.

It seems to be the case that the number displayed in the output channel meter on the miniDSP is rounded down from the values I found by this method of measurement, so these displayed values can be up to 1dB below the actual value. So, the "quick and dirty" way to figure out the maximum boost that Dirac applies is to run a slow sweep, using the REW generator to give 0dB into the miniDSP, observe the readings on the output channels to see where the peaks are and how big they are, and add 1dB to the biggest peak.
Attachments:

Please Log in or Create an account to join the conversation.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48293

  • Wanderer
  • Wanderer's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 62
  • Thank you received: 39
@Ultrasonic
Good points. I agree about convenience, was just thinking from personal perspective there. I don't have specific knowledge about room non-linearity, but guess you are right that it should be a minor factor when the dynamic range is small. (Although, even ±10 dB is actually a huge variation if you convert it from dB to linear scale.)

I'm a bit confused by your comment about left and right filters being different being an issue, in that I'd make a separate pair of measurements for each speaker (one with and one without Dirac).

The response based on combined L+R measurements may have nothing in common with individual channel filters. For example, if you apply an all-pass filter to one channel, amplitude response is unchanged for L and R, but changes for their sum L+R. That is why I think separate measurements for each channel are necessary to determine gain correctly.

Back on topic: @Tony_J In the diagram in post #2, "RMS meter" should be replaced with "Peak meter" I think (clipping at 0 dB at sine wave means it is a peak value).

Please Log in or Create an account to join the conversation.

Last edit: by Wanderer.

DDRC-24 gain structure and internal headroom 3 years 4 months ago #48294

  • Tony_J
  • Tony_J's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Posts: 223
  • Thank you received: 88

@Ultrasonic
Good points. I agree about convenience, was just thinking from personal perspective there. I don't have specific knowledge about room non-linearity, but guess you are right that it should be a minor factor when the dynamic range is small. (Although, even ±10 dB is actually a huge variation if you convert it from dB to linear scale.)

I'm a bit confused by your comment about left and right filters being different being an issue, in that I'd make a separate pair of measurements for each speaker (one with and one without Dirac).

The response based on combined L+R measurements may have nothing in common with individual channel filters. For example, if you apply an all-pass filter to one channel, amplitude response is unchanged for L and R, but changes for their sum L+R. That is why I think separate measurements for each channel are necessary to determine gain correctly.

Back on topic: @Tony_J In the diagram in post #2, "RMS meter" should be replaced with "Peak meter" I think (clipping at 0 dB at sine wave means it is a peak value).


That's a fair point - on reflection, they do indeed seem to be peak meters. I recall in a different discussion about the meters and how they operate, @devteam suggested they were RMS meters, hence my labels, but I agree, this appears to be incorrect.

On the convenience issue, I think it is a case of six of one and half a dozen of the other. My original approach (do a sweep and spot the peaks/values on the DDRC peak meters) is actually pretty easy and quick to do, and my subsequent more critical measurements seem to validate that approach as long as you then round up the biggest peak value (see my most recent post above). To me, that is much easier and less prone to misinterpretation than doing two sweeps in REW and dividing one by the other, and then worrying about which parts of the resultant curve you need to ignore because of measurement artefacts. It also works for the whole of the audio range.

Please Log in or Create an account to join the conversation.

Last edit: by Tony_J.
Moderators: devteam