dolbyb(1)

NAME
dolbyb, a Dolby B encoding and decoding program

SYNOPSIS
dolbyb [options] input_file output_file

DESCRIPTION
dolbyb is a program to decode and encode audio files applying or removing Dolby B noise reduction based on dolbybcsoftwaredecode which simulates the operation of a real Dolby B electronic circuit.

OPTIONS

-e  Encode to Dolby B instead of decoding.

-d  Decode a Dolby B-encoded audio file. This is the default action but the option flag is included for convenience and symmetry.

-p  Show a progress meter on stderr.

-uN Digital filtering only works well if the sample rate is well above the cutoff frequency of the filter. For Dolby B's sliding filter, that frequency can be well above 20kHz and this does not work well if the sample rate is only 44.1Khz. To get around this, it upsamples the audio to a higher rate when it passes through this filter. By default, the upsample rate is set so that the upper sample rate is at least 200Khz; upsampling can be switched off by using -u1.

-h  By default, the program only upsamples the audio when it needs to. If -h is given, this behaviour is changed so that upsampled audio is used throughout the program, which may give marginally better-quality results and will certainly take longer.

-tN This adjusts the gain when the audio is fed to the Dolby gain control circuits. When a tape deck is encoding or decoding a magnetic tape, it knows the signal level at the tape heads but with audio files the maximum signal level may not accurately represent the tape's maximum flux density (200nWb/m for cassette tapes), resulting in erroneous Dolby B decoding. The -t option adjusts the volume levels at which the sliding filter reacts to overcome this. Its default value is 0.0, which assumes that the maximum amplitude of the signal represents the maximum recording level on tape. See the section LEVEL ADJUSTMENT below.

-aN In decode mode, the program has to use trial and error to get the right output sample values. This parameter sets how accurate it needs to be before it is considered OK. A figure of 0.0 dB would mean an accuracy of about 1 sample value. The default is -5.0 dB, which is accurate to less than one sample value. A higher (less negative) value would be less accurate but it may make the decoding faster. A lower (more negative) value would be more accurate but may be slower.

-fN The program originally simulated an analog circuit for a Dolby B noise reducer. However, too much filtering in the side path was altering the phase of the side path audio, which caused problems when the side path was recombined with the main signal. Basically signals don't add together very well if there is too much difference in the phase. To fix this, there are now 4 filter modes with hopefully less of a phase change.

    -f1 is the original method.

    -f2 is a newer method that seems to work better than 1.

    -f3 is another rearrangement which in practice doesn't seem to be any better than 1.

    -f4 seems to work best, hence it is the default mode.

SOME DIGITIZING ADVICE
When digitizing, it is important to get the best possible audio from your tapes. Firstly, clean the tape heads frequently. Secondly, you should demagnetize the tape heads periodically, as they tend to accumulate magnetization over time and will strip the treble from any tape that passes over them. Lastly, adjust the tape head alignment by taking the front off the cassette deck so you can adjust the alignment with a small screw driver. Listening to the audio in mono makes alignment errors far more obvious, which makes alignment a lot easier.

BIAS AND EQ SETTINGS
More expensive tape decks have settings for Bias and EQ; the Bias setting is only really relevant when recording, so we don't need to worry about it on playback. The EQ setting however does make a difference and filters the audio at the recording and playback stages; there are different EQ settings for different types of tape: 120us for ferric tapes and 75us for chrome or metal tapes, and playing back with the wrong EQ setting will affect the sound.

LEVEL ADJUSTMENT
Dolby B is normally built in to a tape deck, so the audio level fed into the decode circuits would be approximately correct. However, if using this program, the audio must already have been extracted and digitized so this program has no way to determine the correct level for the decoding and some trial and error will be needed to find the correct level. I suggest using a section of audio as a trial, and using a batch file to try decoding the trial at several different levels to different output files and then see which version sounds best. For example, a batch file might look something like this:
    dolbyb -t0 Test.wav Out00.wav
    dolbyb -t5 Test.wav Out05.wav
    dolbyb -t10 Test.wav Out10.wav
    dolbyb -t15 Test.wav Out15.wav
    dolbyb -t20 Test.wav Out20.wav
To begin with, when you have little idea of what level to use, try a wide range of levels. If the result sounds muffled, the threshold is too low and if it seems to have too much treble, the threshold is too high. Once you know the approximate level, you can try more closely-spaced levels and listen carefully to find the best level possible. Logic would suggest listening to where tracks fade out, to see if the treble increases, but this method doesn't seem to work well and the best way seems to be to see how low the level can be set before the results sound dull and muffled, then choose a level a bit higher than this; you can just about hear the difference between results that differ in threshold setting by about 2 dB.

COPYRIGHT
Copyright 2025 Martin Guy based on Richard Evans' dolbybcsoftwaredecode. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

SEE ALSO
libdolbyb(3), https://codeberg.org/martinwguy/libdolbyb