Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noise Shaping #8

Open
phoboslab opened this issue Feb 7, 2023 · 3 comments
Open

Noise Shaping #8

phoboslab opened this issue Feb 7, 2023 · 3 comments

Comments

@phoboslab
Copy link
Owner

phoboslab commented Feb 7, 2023

I've added some very simple noise shaping to the encoder (to the noise_shaping branch). This does not change the decoder or the data format. The noise shaping should help to move quantization noise into the higher, less audible frequencies.

Here's a comparison page with all samples with and without noise shaping: https://phoboslab.org/files/qoa-samples/noiseshaping.html

The difference for some sample is night & day. Listen to 32_triangles-triangle_roll_stereo at 00:43 or 35_glockenspiel_arpegio_melodious_phrase_stereo at 00:39.

However, this noise shaping has an adverse effect for some other samples. I tried to contain it by only applying most of the shaping when our prediction is "bad" anyway. But still, I feel that some samples sound more "crunchy" now. Listen to 21_trumpet_arpegio_melodious_phrase_stereo right at the beginning for instance. Vocals in julien_baker_sprained_ankle and others also seem to have lost a bit of "smoothness".

Maybe someone with better ears (and/or equipment :D) can take a listen? What's the usual strategy here, to adaptively correct for quantization noise?

@mattdesl
Copy link
Contributor

mattdesl commented Feb 7, 2023

Maybe something that could be optional or configurable? Some of the audio files I’m thinking of using QOA for have a lot of noise to begin with that I would like to keep more or less intact, almost treating it like data rather than audible signal. But perhaps I misunderstand what this shaping does.

I can’t hear the difference in your example page with my cheapo headphones but in Audacity comparing files with Invert it becomes more noticeable. Will need to do some more tests.

@phoboslab
Copy link
Owner Author

This should only affect the quantization noise that is added by the encoder; it won't remove any noise that is present in the source. But yes, making it optional is certainly the right idea!

@p0nce
Copy link

p0nce commented Apr 16, 2023

audio-formats has TDPF (courtesy of MIT-licensed Airwindows, tuned and modified by me to fit WAV) dithering in its QOA encoder now: https://github.com/AuburnSounds/audio-formats/blob/master/source/audioformats/qoa.d#L724
It was tuned for WAV. imo It's more important to get dithering levels right rather than get the best dithering. I will finetune the dither level for QOA encoding. (EDIT: errr, disabled for now, it sounds worse than without dithering)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants