HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: Moguta on 2008-04-27 00:09:03

Title: Removing noise from 8-bit audio
Post by: Moguta on 2008-04-27 00:09:03
I'd like to try to remove the high quantization noise from some 8-bit audio I've acquired, even if it means converting it to 16-bit or something.  Normal noise-filter algorithms won't work because the noise only exists when the audio signal is active, meaning there is no section of the music with only the noise & so a noise profile cannot be made.

Does anyone have any suggestions?  Here's a sample of one of the files I'm looking to de-noise:
http://ourworld.cs.com/YWingCDG/theme00cut.flac (http://ourworld.cs.com/YWingCDG/theme00cut.flac)
Title: Removing noise from 8-bit audio
Post by: pdq on 2008-04-27 00:16:55
I'd like to try to remove the high quantization noise from some 8-bit audio I've acquired, even if it means converting it to 16-bit or something.  Normal noise-filter algorithms won't work because the noise only exists when the audio signal is active, meaning there is no section of the music with only the noise & so a noise profile cannot be made.

Does anyone have any suggestions?  Here's a sample of one of the files I'm looking to de-noise:
http://ourworld.cs.com/YWingCDG/theme00cut.flac (http://ourworld.cs.com/YWingCDG/theme00cut.flac)

Apart from low-pass filtering I'm not sure there is much that you can do.
Title: Removing noise from 8-bit audio
Post by: Dynamic on 2008-04-27 00:39:13
Normal spectral noise subtraction algorithms can still work surprisingly well when creating noise profiles derived from non-silent sections of source material, especially if the profile section is long enough and doesn't contain tones that sustain for too great a proportion of the profile section. The noise itself is essentially "statistically stationary" (http://en.wikipedia.org/wiki/Stationary_process) for the duration of the noise profile selection, so providing the desired signal is not statistically stationary enough to be important in the average, you can still get fairly decent results if you don't apply the effect too strongly.

The alternative, if it's purely down to a conversion, would be to create a known signal at 16-bit or more and render it to 8-bit in a way comparable to the original to generate the noisy signal then convert back to 16-bit and subtract from it the original known signal to generate a profile of pure 8-bit truncation/dither noise. If this happens to match the noise in the original sufficiently well, it could allow decent noise reduction. A circumstance where this might be possible is where you still own your 8-bit card but can sample its output on a newer 16-bit or better card. If you play a known 16-bit source through the 8-bit card, you can play a known 16-bit source via the 8-bit card and sample it, then subtract the original from the 8-bit (if you can time-align adequately) to obtain a pretty pure noise profile.
Title: Removing noise from 8-bit audio
Post by: lvqcl on 2008-04-27 00:48:03
I'd like to try to remove the high quantization noise from some 8-bit audio I've acquired, even if it means converting it to 16-bit or something.  Normal noise-filter algorithms won't work because the noise only exists when the audio signal is active, meaning there is no section of the music with only the noise & so a noise profile cannot be made.


You can generate 16-bit wav with silence and convert it to 8-bit using rectangular or triangular dither. This white noise can match your needs very well.
Title: Removing noise from 8-bit audio
Post by: Slipstreem on 2008-04-27 01:04:14
My knowledge regarding the inner workings of noise-filtering algorithms is absolutely zero, but I just threw your sample at Audacity (http://audacity.sourceforge.net/) and ran the "Noise Removal..." option feeding it the first 1.5 seconds as the reference and using the lowest setting and it certainly removes the vast majority of the noise. Goodness knows what else it's removing as I've never heard the original source material, but it's kind of listenable for a 22kHz 8-bit sample.

Cheers, Slipstreem. 
Title: Removing noise from 8-bit audio
Post by: Moguta on 2008-04-27 06:47:34
Thanks for the help!  I did just what you said, Dynamic, about subtracting a 16bit->8bit file from the original 16bit to get my noise profile, and it works pretty good! 
Title: Removing noise from 8-bit audio
Post by: Dynamic on 2008-04-27 23:24:51
Goodness knows what else it's removing as I've never heard the original source material, but it's kind of listenable for a 22kHz 8-bit sample. :D


Some of the noise reduction apps let you keep the noise you would have removed instead of keeping the de-noised version, so it gives you some idea of what has been removed and whether it sounds too much like stuff you'd like to keep (or too loud in comparison to the original). I think the old CoolEdit96 did, so I expect CE2000 or Adobe Audition would do the same.

I'd suggest to Moguta that you try more than one method of generating the noise profile to see which seems to work best. Also some NR apps work better than others.
Title: Re: Removing noise from 8-bit audio
Post by: gernot66 on 2020-08-12 01:38:39
In despite of that this is a very old thread i will post something here (to start a new topic with the same content won't make much sense).

I work since a while with 8bit samples for a sort of DOS (DOSBox) environment for my DOS games (some useless stuff like sfx for batch wrappers for the games) and i made some experiences, especially when it comes to down-sampling to 8bit (most of the above mentions are good, especially to export a silent .wav as 8bit sample and to import it as noise sample to clean a 8bit sample from the static noise, keep in mind that the sample frequency must fit already at export to get the best possible result, while this is meant for upsampling).

To remove the static noise of an 8bit sample you can force the silent parts to be absolutely silent if you use a hex-editor and change all 0x7F in the sample to 0x80 this will remove the static noise but it will also destroy the file in some manner, often it will result in a heavy distortion to the sample since not all 0x7F are "dead silence". It can help to edit only long passages of silence like the start or end of the sample, or if you search for long intra silence parts. The method isn't the best sometimes the result is very good - sometimes very bad (i will attach some examples).

BUT
there must be a method to do this in a more intelligent manner, as fine example take the SFX of "Streets of SimCity", all SFX of the game are 8bit  @ 22kHz and they are completely silent without the side-effect of the crackle my above mentioned method leaves. How they achieved this i have no idea and this would be my question...

How did MAXIS reached completely silent 8bit samples?

MAXIS example SFX ("garage.wav" a quite large piece of music with noticeable silent parts):
X
If you would re-export the wav as 8bit it will contain again all the static noise an 8bit sample usually has.

Example SFX "Beep01":
X
This is a very short and very simple example, it was easy to denoise the simple "beep" sound using the above mentioned method of changing all 0x7F to 0x80. Bus as you can here it still leaves a little bit of noise in the ending of the SFX, this is rooted in that not only the silent parts will fluctuate between values, the static noise is in the whole sound.

If it's a more complex or noisy sound (or music) it won't turn out so well ("The Imp's Song (excerpt)" - DOOM, GM on Munt using gm@mt32.syx):
X
The folder contains the "normal" version which i use and a "denoised" version to show the difference or how the artefacts will sound, it depends a lot on the volume, silent parts will have a higher noise level and the removing of the static noise in the mentioned "brutal" manner will leave a crackle sound (it's maybe not the best example, but find the proper one out of 500 samples).
Best noticeable it is when you blend a signal out.
Maybe this as better example how the crackle will sound and that under circumstances it is better to leave the static noise as it is, again it's an excerpt of a DOOM midi and meant to be looped ("Suspense (excerpt)" GM using "Fatboy" soundfont):
X

(if you like me see no image for the zip files click on the uppercase "X")

Personally i guess it should be possible to remove the static noise from the silent parts with a routine, if you would check the file for instances of 0x7F 0x80 in any combination and with a given length, i.e 8 bytes you should match only the silent parts and leave the rest unaltered. Still this will lead to extreme changes from "noisy sound" to "dead silence" that's why i'm not sure how MAXIS reached this for their SFX.
Title: Re: Removing noise from 8-bit audio
Post by: Octocontrabass on 2020-08-12 06:11:45
there must be a method to do this in a more intelligent manner
Try turning off dithering when you export audio to 8-bit samples.
Title: Re: Removing noise from 8-bit audio
Post by: gernot66 on 2020-08-12 10:29:41
Thanks a lot Octocontrabass that was the solution i was looking for, interesting that no one ever before mentioned it.
(now i can return to start and resample all my sfx - never mind  ::) )