View Full Version : Measuring audio noise levels with and without ALC


Tramm Hudson
June 16th, 2009, 07:18 PM
I have some audio samples that I've recorded with the Magic Lantern firmware using a JuicedLink CX231 and a mix of microphones with the 5D Mark II's ALC turned off. Unlike the Beachtek DXA5D "pilot tone", my firmware is turning the AGC off at the AK4646 chip and is also turning off the potentially noisy input gain stage (MGAIN2-0 bits in the datasheet). I have also turned off the high-pass and low-pass filters in the firmware, but am not certain if it matters.

I'd like to have a way to quantify how much the results are improved with these changes and am looking for suggestions on test conditions and software to measure the results. Elsewhere, Jon Fairhurst reported a -42 dB noise floor using a pilot tone. I'd like to know how my setup compares.

Any ideas?

Jon Fairhurst
June 16th, 2009, 09:42 PM
The simple way to test this is to play back the audio in most any editor and watch the meters during silence. In SoundForge 9 you can capture a noise print and see exactly what the frequency spectrum is.

With AGC on, I just assume that the input signal can go full scale, so you can just look at the typical level of the meters during silence.

If you turn down the gain too far manually, it's possible that no matter how hot a signal you put in, you can't go full scale. That could give an overly optimistic noise reading. You might see -80dB levels during silence, but have a peak limit of only -30dB. In that case you have 50dB of dynamic range, rather than 80.

I'd recommend turning down the 5D gain control to, say, 20%, and then crank the juicedLink up high and record yourself speaking very close to the mic. Play back the recording and ensure that your signal clips. If so, turn down the 5D gain and repeat. For fast turn around, assuming that you can adjust things live, make an adjustment, say "this is a gain of 20 percent, blah, blah, blah, and here are a few seconds of silence...", and then adjust and repeat.

Now that you have found the optimum gain, connect a dummy connector to the 5D with the signal wires grounded. Record a few second of this, play it back and note the noise level. That will tell us the absolute best case of the 5D.

This might not be the minimum system noise though. It might be that you have to crank the juicedLink full bore to get those levels, and now the juicedLink noise could become dominant. If that's the case, more measurements are needed.

That initial number is helpful though. If you were to connect a CD player with the right pad to the 5D at this level, you could potentially record it with the noise that low. On the other hand, you might overdrive the input amp at that level and distort like hell.

Anyway, in the next round of tests, you would turn up the gain on the 5D a bit, and test the juicedLink at a variety of levels, each time leaving a bit of time of silence. At some point, you'll find the minimum noise level at which the voice is undistorted. You'll need to do the test in a quiet environment. During silence, you might hold a box of foam over or in front of the mic. Leave the mic on a stand. If you handle it, you'll get low frequency handling noise. Again, a dummy connector can be used to remove mic self-noise and ambient noise.

For reference, with a MicroTrackII, I found that I needed to set the gain at 50% (indicated) to allow full scale recording. I didn't do a dummy connector test. With a Rode NT1-A, I needed to set the juicedLink to M with the gain pot just over half way. The noise was around -70dB even with a computer running in the background. I could easily get full signal levels without audible distortion. If we can get the juicedLInk and 5D to that level, we'll really have something!

Tramm Hudson
June 16th, 2009, 10:11 PM
If we can get the juicedLInk and 5D to that level, we'll really have something!
Also very encouraging is that the spec sheet for the AK4646 shows how to put it into loop-through mode, with the output after digitization and processing being fed directly to the digital output stage. Since I am now bypassing all of Canon's code for writing to the audio device, I believe I can put it into this mode. Tomorrow when I find my adapter cable somewhere in my lab I'll be able to test this.

Since you have so much experience testing audio levels, I've sent you some sample audio files and "instructions" on how to make your own tests with your own camera. Thanks for the extensive writeup and good luck!

Jon Fairhurst
June 16th, 2009, 11:59 PM
Thanks Tramm,

My first impressions of the audio files is that you've passed the proof of concept stage. We can get lower noise with your firmware than we can with a pilot tone. I'll need to dig in before I will know how good the results will be.

My expectation is that, while nobody will be throwing away their SoundDevices 744T recorders, the 5D2 will record adequate sound for many users when coupled with a good preamp.

Chris Barcellos
June 17th, 2009, 12:20 AM
Jon: What level of floor were you seeing ?

Jon Fairhurst
June 17th, 2009, 10:57 AM
Jon: What level of floor were you seeing ?
Tramm sent an audio file, but there were no periods of true silence. If I were to guess, I'd say that we will get better than 60dB SNR. Tonight I should be able to get some real numbers - at least at one or two fixed gain levels.

One thing that is encouraging is that in the quiet moments, I didn't really hear much hiss. In a couple of quiet moments there were breaths, in a longer period there was cooking and A/C. That didn't let me get numbers, but the quality of these subtle sounds was good.

Dan Chung
June 17th, 2009, 01:14 PM
Thanks Tramm,

My first impressions of the audio files is that you've passed the proof of concept stage. We can get lower noise with your firmware than we can with a pilot tone.

Jon, that's great news. When you say pilot tone are you comparing to the DXA5D or other methods. I'd previously thought that feeding 1khz at high levels was already forcing zero gain and a low s/n ratio, if the firmware is able to best this by turning off the input gain stage then we may not be far off the quality of a separate recorder after all.

Thanks

Dan

Jon Fairhurst
June 17th, 2009, 03:35 PM
Jon, that's great news. When you say pilot tone are you comparing to the DXA5D or other methods. I'd previously thought that feeding 1khz at high levels was already forcing zero gain and a low s/n ratio, if the firmware is able to best this by turning off the input gain stage then we may not be far off the quality of a separate recorder after all. Dan, I've tested with my own high-frequency signal, analyzed Chris' audio capture with a high-frequency signal, and tested some audio from vimeo that was done with the DXA5D. In all cases, the result was about 42 dB of dynamic range.

After a quick test of audio supplied by Tramm, my guess is that we could hit 60dB or more with firmware gain control. I get 70dB or so with a Rode NT1-A/juicedLink CS231/Microtrack II with a computer running in the background. I'll know more specifics about the Magic Lantern solution tonight...

One note: Noise reduction was very successful on Chris' clip. However, in my experience, when you add broadband hiss to environmental sounds like cars and HVAC, noise reduction falls apart really quickly. Given that, you might use the DXA5D into the 5D indoors when you can turn off the AC. When recording outdoors, or when you can't get the mic really close to the subject, I'd break out the separate recorder, just to be safe.

I use the NR in SoundForge 9 and in GoldWave (cheap and very good!) on the PC. Apple's Soundtrack also has nice NR.

Tramm Hudson
June 17th, 2009, 08:09 PM
Also very encouraging is that the spec sheet for the AK4646 shows how to put it into loop-through mode, with the output after digitization and processing being fed directly to the digital output stage. Since I am now bypassing all of Canon's code for writing to the audio device, I believe I can put it into this mode. Tomorrow when I find my adapter cable somewhere in my lab I'll be able to test this.
"Good news everyone!"

I have loop-through mode working, so live audio monitoring via the A/V jack works! And, since my firmware over-rides Canon's hotplug_task(), plugging in a connector to the A/V jack does not switch to composite video mode.

There doesn't appear to be any obvious hum in the audio when I do this, so my guess is that the video circuit is what causes it.

Chris Barcellos
June 17th, 2009, 08:21 PM
More great news Tramm.

I know you are a busy guy, but out of curiousity, when you disable the AV out, does that also disable HDMI out ?

Tramm Hudson
June 17th, 2009, 08:33 PM
when you disable the AV out, does that also disable HDMI out ?
Yes it does. By disabling the hotplug_task() it disables the A/V jack, the HDMI plug and the USB port. It would be possible to re-implement the task as part of the Magic lantern firmware (like I have done with the gui_main_task() to re-route button presses), but hasn't been a priority yet.

The other major problem with the HDMI output is the mode switch when recording starts. I haven't even started to look into that since I don't have an HDMI field monitor. There isn't any reason that I can think of for it to make that switch.

Chris Barcellos
June 17th, 2009, 08:47 PM
Jon, that's great news. When you say pilot tone are you comparing to the DXA5D or other methods. I'd previously thought that feeding 1khz at high levels was already forcing zero gain and a low s/n ratio, if the firmware is able to best this by turning off the input gain stage then we may not be far off the quality of a separate recorder after all.

Thanks

Dan

Dan, you are one of the few I know that has the Beachtek. Wondering what kind of floor you are working with on their unit. A sample in a quiet house in a stuff clothes closet would be interesting. Be sure to record silence and voice. And be sure tone is only going to one track.

Jon Fairhurst
June 18th, 2009, 12:45 AM
I don't have a full report yet, but the audio tests are REALLY promising. The noise floor is lower than I expected.

One problem is that there is some low frequency noise, which is possibly just a DC offset that moves around a bit. This is present on the pilot tone clips as well. This LF junk pushes the meters far above where they should be. At worst, we will want to add a subsonic filter or LF shelf in post.

The good news is that the pilot tone method isn't as bad as I thought. The better news is that with the gain fixed in firmware, the noise is significantly lower still.

Tomorrow I have another commitment, but by the weekend, I should be able to present some screen captures, numbers, and audio clips.

The bottom line is that fixed gain is possible in firmware, and the hardware can deliver the goods.

Chris Barcellos
June 18th, 2009, 01:55 AM
Jon: Thanks for that encouraging news. I had some feeling that the sound we were getting with pilot tone was promising, ie, the sound itself seemed real clean in the audible range. I had thought it was bleed from the tone side, but sounds like you found another source.

Jon Fairhurst
June 18th, 2009, 10:35 AM
Jon: Thanks for that encouraging news. I had some feeling that the sound we were getting with pilot tone was promising, ie, the sound itself seemed real clean in the audible range. I had thought it was bleed from the tone side, but sounds like you found another source.

With the noise plots, there are four areas:
1) DC/Low Frequencies: Both the pilot tone and manual gain tests have LF problems. This can be remedied in post. I can reduce the resting level of the meters by over 20 dB with a subsonic filter.

2) Pass band: The pilot tone method has noise throughout. The gain reduction method has almost none. The difference is 20 dB or more.

3) High Frequencies: On the pilot tone method, you can see the noise drop to almost nothing somewhere around 16 kHz. I presume that this is the anti-aliasing filter. It's hard to see that drop off with the manual gain method, as the noise is already near that level.

4) The pilot tone: Yes, there's some bleed at the frequency of choice. That doesn't apply with the fixed gain situation.

For anybody recording into the 5D from an external source, apply EQ with a low frequency shelf at -Inf. That should calm your meters so they more accurately reflect the noise of the system.

Tramm Hudson
June 18th, 2009, 10:48 AM
For anybody recording into the 5D from an external source, apply EQ with a low frequency shelf at -Inf. That should calm your meters so they more accurately reflect the noise of the system.
The AK4646 has a digital 5-band EQ that might be usable for this -- the frequency, bandwidth and gain are all selectable for each of the bands. I believe they are all initialized to 0 dB gain and disabled by default.

I might not be setting the HPF and LPF correctly, either. My code was writing all zeros to the coefficients, but it looks like the correct thing to do is to disable the HPF, LPF, FIL3, EQ and GN bits in the digital filter select register (0x11). We may need to make some more trials this weekend to see if we're missing something.

Chris Barcellos
June 18th, 2009, 10:59 AM
With the noise plots, there are four areas:
1) DC/Low Frequencies: Both the pilot tone and manual gain tests have LF problems. This can be remedied in post. I can reduce the resting level of the meters by over 20 dB with a subsonic filter.

2) Pass band: The pilot tone method has noise throughout. The gain reduction method has almost none. The difference is 20 dB or more.

3) High Frequencies: On the pilot tone method, you can see the noise drop to almost nothing somewhere around 16 kHz. I presume that this is the anti-aliasing filter. It's hard to see that drop off with the manual gain method, as the noise is already near that level.

4) The pilot tone: Yes, there's some bleed at the frequency of choice. That doesn't apply with the fixed gain situation.

For anybody recording into the 5D from an external source, apply EQ with a low frequency shelf at -Inf. That should calm your meters so they more accurately reflect the noise of the system.

Jon:

Are you saying the camera filters out any thing at 16 kz and above, so with my tone at that arbitrary 15,400 that I had originally landed on, if I push it up to about 16,000 or a bit more, I might lose what I had been working at the somewhat lower frequency ?

Chris Barcellos
June 18th, 2009, 11:03 AM
The AK4646 has a digital 5-band EQ that might be usable for this -- the frequency, bandwidth and gain are all selectable for each of the bands. I believe they are all initialized to 0 dB gain and disabled by default.

I might not be setting the HPF and LPF correctly, either. My code was writing all zeros to the coefficients, but it looks like the correct thing to do is to disable the HPF, LPF, FIL3, EQ and GN bits in the digital filter select register (0x11). We may need to make some more trials this weekend to see if we're missing something.

As Arte Johnson said on Laugh-In, very interesting.

Jon Fairhurst
June 18th, 2009, 04:34 PM
Are you saying the camera filters out any thing at 16 kz and above, so with my tone at that arbitrary 15,400 that I had originally landed on, if I push it up to about 16,000 or a bit more, I might lose what I had been working at the somewhat lower frequency ?

Hi Chris,

I tried a 16kHz tone, and I had to really crank the levels to push the ALC down. If the pilot tone is cut out by the filter, it won't drive the levels down at all.

I'm thinking that a mid frequency tone is best. It will have less crosstalk, and it will definitely not get cut off by the LPF.

Such an approach might make the 5D okay for audio, but Magic Lantern can definitely push the noise down further. Of course, in either case, with the gain pushed down, a hot signal - either from a hot mic or good active preamp - is needed.

Jon Fairhurst
June 18th, 2009, 04:40 PM
The AK4646 has a digital 5-band EQ that might be usable for this -- the frequency, bandwidth and gain are all selectable for each of the bands. I believe they are all initialized to 0 dB gain and disabled by default.

If it's quick, you might try -Inf for the gain and 20 Hz or lower for the frequency with a bandwidth that would include DC.

That said, this is a minor irritant that can be handled in post. I'd put it way low on the priority list.

I might not be setting the HPF and LPF correctly, either. My code was writing all zeros to the coefficients, but it looks like the correct thing to do is to disable the HPF, LPF, FIL3, EQ and GN bits in the digital filter select register (0x11). We may need to make some more trials this weekend to see if we're missing something.

I would definitely enable the LPF. Assuming that's what I'm seeing in the noise plots for the standard firmware (16kHz cutoff), I can easily verify if it's enabled or not.

Jon Fairhurst
June 18th, 2009, 04:44 PM
I had time for one quick test tonight. The LPF is not currently enabled - there's no 16 kHz cutoff.

Gotta run...

Chris Barcellos
June 19th, 2009, 01:22 AM
Okay, I admit I am no sound tech. School me.

LPF , low pass filter. only lets lower frequezies than setting pass, and hpf (high pass) only lets higher frequencies pass than setting. Have I got that right ?

And does this mean 16khz is pushing the envelope of the system in general ?

Jon Fairhurst
June 19th, 2009, 12:48 PM
Hi Chris,

A LPF is needed before the analog to digital conversion. The sampling rate on the 5D2 is 44.1 kHz. Such a digital system can't carry any information beyond 22.05 kHz. If you provide an input frequency above that (the Nyquist frequency), it will alias.

A great example of aliasing is when helicopter blades look like they're going backwards. Any frequency beyond the Nyquist limit gets reflected down into the audible frequencies - an input near 44 kHz could sound like a low frequency rumble!

The HPF, on the other hand, is for removing rumble due to handling noise and wind buffeting.

Bill Davis
June 19th, 2009, 01:07 PM
The AK4646 has a digital 5-band EQ that might be usable for this -- the frequency, bandwidth and gain are all selectable for each of the bands. I believe they are all initialized to 0 dB gain and disabled by default.

I might not be setting the HPF and LPF correctly, either. My code was writing all zeros to the coefficients, but it looks like the correct thing to do is to disable the HPF, LPF, FIL3, EQ and GN bits in the digital filter select register (0x11). We may need to make some more trials this weekend to see if we're missing something.



Tramm,

When you get a Beta version done, I've got a custom built VO booth that's about as close to an anechoic chamber as you'll get outside of an audio lab - along with a Neumann TLM 103 with a 70-80 db self noise rating that could provide a good "real world" test.

That signal chain fed into my Mk5 d ii should be dead quiet if you can actually defeat the dreaded AGC via code.

Plus I can easily videotape the test for you for posting the results on-line.

So let me know if I can help. (The biggest advantage of owning this studio is that I don't have to charge myself to use it!)

This would be great for all of us - although it would likely mean a huge flood of used H4n's on ebay!

Good luck with your development efforts!

Matthew Roddy
June 19th, 2009, 02:09 PM
Tramm,

(The biggest advantage of owning this studio is that I don't have to charge myself to use it!)


I'd say you charge yourself to use it and make a small fortune.
...

I'm looking forward to the test results.

Tramm Hudson
June 19th, 2009, 05:45 PM
The LPF is not currently enabled - there's no 16 kHz cutoff.
Is it on in the stock firmware? My recent beta was supposed to enable it, but I think that the bits in the digital filter select 1 register were not configured correctly.

If you have more time for testing this weekend, perhaps we can coordinate some more rapid fire testing to see if we can get these settings hammered out. I'm hoping that we can get these configured with reasonable defaults so that I can spend more time on figuring out how to create menus and read/write commands to the lens.

Tramm Hudson
June 20th, 2009, 12:57 PM
The LPF is not currently enabled - there's no 16 kHz cutoff.
From the spec sheet, the default parameters for the HPF as a wind-cut filter at 150 Hz @ 44.1 kHz (F1A=0x1FA9, F1B=0x20AD) and the LPF is not enabled by default.

Canon's windcut filter changes the parameters to F1A/B=0x1FB5 and 0x2096 for the HPF and the LPF at F2A/B = 0x0ED4 and 0x3DA9. Inverting the function on page 34 of the spec sheet is left as an exercise to the reader.

Do you have a suggested set of frequency cutoffs that should be programmed in for the tests?

Jon Fairhurst
June 20th, 2009, 04:46 PM
Do you have a suggested set of frequency cutoffs that should be programmed in for the tests?

For the HPF, it would be nice to get rid of the DC offset. I'll download the spec sheet and do my best to calculate the best values available. Right now, though, I'm about to turn off the PCs and do some noise floor tests...