Page 1 of 1

VS1053B: noise when playing MP2 audio

Posted: Tue 2024-07-23 10:53
by compuphase
We are using the VS1053B for audio decoding. One of our customers streams audio in MP2 format (MPEG-1 layer 2). We have enabled layer 1/2 support in the SCI_MODE register. We also use the most recent patches (version 2.9).

We have observed noise on top of the signal, when playing back MP2. We have observed this with both the stream created by our customer’s software and with MP2 files created with the Audacity program. The noise is absent when playing the stream or file back on a PC (using the VideoLAN player “VLC”). We are therefore convinced that the noise is not in the audio file/stream itself.

I created a file with 30 seconds of silence, and saved this in both MP2 and MP3 formats. The noise is present only when playing the MP2 file (on the VS1053B). The nature of the noise changes a bit depending on the bitrate with which the MP2 was encoded.

I recorded the output of our audio player when playing those “silence” files. The spectrum plots are below to illustrate the issue.

MP2
mp2_spectrum.png
mp2_spectrum.png (17.43 KiB) Viewed 1832 times
The issue that we are having, are the spikes at (in this example) 1.35 kHz, 2.7 kHz, 4.1 kHz, 5.5 kHz, and so on. These are at roughly -61 dB, rising well above the surrounding noise level of -80 dB. The frequencies where the spikes occur, depend on the bitrate with which the MP2 file is encoded.

MP3
mp3_spectrum.png
mp3_spectrum.png (19.09 KiB) Viewed 1832 times
The same data encoding in MP3 format shows a much cleaner spectrum. (Note that the graph has a different vertical scale than that for the MP2 file.) The spike at roughly 14 kHz is odd, but note that it is at -81 dB: much softer that the spikes in the MP2 graph (at -62 dB).

No audio
not_decoding_spectrum.png
not_decoding_spectrum.png (19.21 KiB) Viewed 1832 times
Also a spectrum plot of when our player was not decoding audio, for a “ground level” comparison (to show the noise from other sources, such as the analog back-end of our player, and possibly the noise of our capture device). The low frequency noise in all graphs is of no concern: listening tests have not reported this noise; it may not exist.

For completeness, I have attached the "silence" audio files.

Is there a work-around for this issue?

Re: VS1053B: noise when playing MP2 audio

Posted: Wed 2024-07-24 11:17
by pasi
Digital zero (or any constant offset) is not a steady signal in mp2's encoding, so this measurement is possible.

The noise seems to come from the limited calculation accuracy of the various gains and scalefactors and synthesis in the layer II decoding of the vs1053b. The frequencies are probably multiples of the layer II block sizes. Simulating the silence.mp2 with vs1053b ROM I get the max amplitude of -61.36dB, and octave gives frequencies of 1378Hz, 2756Hz, 4134Hz, etc.... Seems to match your measurements.

The Layer II decoder in vs1053b has improved the accuracy compared to vs1011e, but only the version in vs1063a performs the arithmetic fully in 32 bits. Simulating the silence.mp2 with vs1063a ROM I get the max amplitude of -71.22dB. The spectrum of the noise is uniform with no tones.

vs1063a also replaces the mp3 decoder with a version that is full-accuracy compliant.

To improve the layer II decoder of vs1053b, it would need to be completely replaced. Not impossible, but needs effort.

Re: VS1053B: noise when playing MP2 audio

Posted: Wed 2024-07-24 21:14
by compuphase
Thank you for the analysis. It makes sense now.

Migrating to the VS1063 may be an option for us (though, of course, I would have hoped for a software fix).
So thanks for also checking this on the VS1063.

Regards,
Thiadmer Riemersma