usc-imi / aeo-light

AEO-Light 2 is a new generation of optical sound extraction software developed by the University of South Carolina in close cooperation with Tommy Aschenbach. The project is made possible by the generous support of the National Endowment for the Humanities.
Other
43 stars 11 forks source link

sampling numerical values wrapping instead of capping when saturated #29

Open meantux opened 4 years ago

meantux commented 4 years ago

Hello, I am encountering a situation where the wave data wraps instead of capping. I am trying to figure out a way to avoid this issue but there are no setting to scale down the soundwave. It does not matter that I choose 16bits or 24bits sampling, the wrapping occurs in exactly the same way for both. SaturationDistortion

To demonstrate my issue I am currently making available a zip file containing JPEGs of the scans (dpx files were too big) of a section of audio that is currently experiencing the issue. They will be available in the next 10 mins at this url: www.deniscarl.com/samples/saturationSample.zip (359MB)

These samples are taken from a 35mm film one hole at a time, using aeo-light at 24fps this makes an audio file that is at 1/4th of normal speed.

Screenshot from 2020-02-17 23-36-15

Even capping would be distortion, I really wonder why there isn't any "volume knob" somewhere in aeo-light software to avoid any saturation of the sort.

meantux commented 4 years ago

I (finally) found a workaround, I reduce the contrast of my output from black and white to light gray and dark gray. This acts as an effective volume control. I still thinks this is an issue (albeit a less urgent one for me) as there might be an important loss of dynamic range in this process.

taschenbach commented 4 years ago

I will double check to see if there is any rollover in the calculations, I believe they are properly clamped. With a stereo extraction of this track there will be distortions and clipping that was recorded into the original optical negative track. The example below would create the waveform problem shown in your example. The display of the waveform in aeo-light monitor is mono so those distortions will not be seen until it is extracted as stereo. For proper sound restoration I would extract as mono and stereo and remix where needed to remove the issues. Someone spent a lot of money to license and master the Dolby Digital track which by the looks of the analog optical and the fact that it is digital would be far superior.

bt
meantux commented 4 years ago

A- Yes there is distortion in the print but anything reading it shouldn't make it worse by clamping over the data, or worse, wrapping it. What's the deal of absolutely wanting to even get close to 0dB?

B- I would love to extract the dolby digital, I tried but I can't even figure out even the bits layout. where's the first bit? where's the direction (left right up down?)? Big or little endian? Do we keep the markers in the data stream or not? And I am assuming that the data just need a bit of cleaning to be passed into an AC3 library for decoding, which is not based on anything but a huntch. Here's a snapshot of a post I made on my project page on the subject: resized

meantux commented 4 years ago

And I have to add:

taschenbach commented 4 years ago

I'll check it out on windows. I have not been able to recreate on my Mac. We have film equipment here with Dolby Digital pickups to scan them. I have been working on a software version. It 512bytes per barcode. This is an example of the data. I highlighted one packet. srdexample

meantux commented 4 years ago

This dolby thing is off topic, I'm sending you an email hoping we can connect on this subject.

TomArrow commented 4 years ago

I also have this very same issue. I haven't read the code to know what causes it, but one workaround other than a volume slider would be a 32 bit floating point output for the output wav file. And obviously the wrapping around is terrible and destroys the audio completely.