Skip to main content
Topic: Speex: Bad quality output (Read 4258 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Speex: Bad quality output

Hi everyone,

I'd appreciate some help getting some input as to why the Speex encodings I've created have so much background noise. Before I begin, let me just give you a bit of background as to how my system is setup, so that you may be able to point out flaws.

I'm using Windows XP, and to encode Speex files I'm using speexdrop V0.0.7 by John Edwards, based on LibSpeex 1.0. The options I'm using are:
Enable VBR: On
Complexity: 10
Frames/packet: 1
No downmixing or resampling.

The source file is: tuek-mono-32khz.flac (16MB), which is a 32KHz wave, mono, 16-bit, PCM file. The file I've linked to is a FLAC compressed wave, so that the download is smaller. The source file is a vocal, religious hymn, without any musical instruments.

I've created three Speex files from this using the above options:
tuek-mono-32khz-speex-q6.spx (1.2MB - encoded at Quality 6)
tuek-mono-32khz-speex-q8.spx (1.7MB - encoded at Quality 8)
tuek-mono-32khz-speex-q10.spx (2.0MB - encoded at Quality 10)

All of these files have a very large amount of background noise, and don't sound good at all (so I didn't bother creating any at lower quality levels). When I encode them to Vorbis or MP3 they sound fine.

Here is some info as to how I arrived at the tuek-mono-32khz.flac file I mentioned above. Originally I began with the wave equivalent of tuek-stereo-44khz.flac, which is a 44KHz, stereo, 16-bit PCM wave file. First, I downmixed this to mono using sox, with the command sox input.wav -c 1 output.wav. Then I downsampled the mono wave from 44KHz to 32KHz using the Shibatch ssrc sample rate conversion tool. I ran the command ssrc --rate 32000 input.wav output.wav. I then fed this into speexdrop to get the resultant files.

For what its worth, here is a Vorbis file created at q-1 from a 22KHz mono wave file (downmixed and resampled in a similar way as above), that was created using odddropXD:
tuek-mono-22khz-vorbis-q(-1).ogg (1.1MB)

I'd appreciate it if someone has any ideas if I'm doing anything wrong, or if this is a limitation of the codec itself.

Thanks for your help.

Speex: Bad quality output

Reply #1
Well, I've encoded as you did, with the same results (no surprise there!!). This is probably a limitation in the codec since it is optimised for the spoken word rather than for chanting/singing. I also encoded your flac file, without resampling, at 'quality -1' in oggdropXPd which produced a file of 1.5Mb and a level of quality that I couldn't readily distinguish from the original!!

Unless you have a good reason to want to use speex, I would use oggvorbis in this instance.
My compiles and utilities are at

Speex: Bad quality output

Reply #2
I would agree with John, but it makes little sense to me that even in the silent sections the distortion is so large!

Speex: Bad quality output

Reply #3
Actually, it seems like what you found is mostly a limitation of the ultra-wideband mode. Just try encoding at 16 kHz and the noise will go away (or listen you current .spx with speexdec --force-wb).

Speex: Bad quality output

Reply #4
Thanks guys.

I tried jmvalin's suggestion to decode with the --force-wb switch, and the noise did indeed go away. It sounds fine. FYI, I've encoded some files at 16KHz, all of which sound pretty good:

Source: tuek-mono-16khz.flac (8.7MB)

tuek-mono-16khz-speex-q3.spx (655KB - Q3)
tuek-mono-16khz-speex-q6.spx (1.1MB - Q6)
tuek-mono-16khz-speex-q8.spx (1.5MB - Q8)
tuek-mono-16khz-speex-q10.spx (1.9MB - Q10)
(all done using the same setup as before)

I'll just stay away from using uwb for these type of files, and stick to wb.

Thanks again.

Speex: Bad quality output

Reply #5
Is this ultrawideband limitation/bug likely to go away in future releases of Speex, or is this going to be more or less of a permanent problem now that the Speex bit-stream is frozen?

Speex: Bad quality output

Reply #6
Is this ultrawideband limitation/bug likely to go away in future releases of Speex, or is this going to be more or less of a permanent problem now that the Speex bit-stream is frozen?

Well, consider ultra-wideband as some patch over wideband (that's the reason it only adds 1.8 kbps). I don't think it'll ever work perfectly. However, I think it's possible to improve it (without changing the bit-stream) so that the extreme noise you've seen doesn't happen anymore.

SimplePortal 1.0.0 RC1 © 2008-2018