Jan Stary
2024-Aug-07 08:34 UTC
[opus] Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
On Aug 07 10:08:43, petrparizek2000 at yahoo.com wrote:> > What sine sweep exactly? > > An exponential sweep. It started slightly below 24 Hz and ended almost at 24 > kHz. And it was 50 seconds long. > > > How did you obtain it, > > I used Angelo Farina's "Aurora" modules. One of them is called "Generate > sine sweep".Can you please make that sound file available? It is hard to tell without having anything. (50s of sines shouldn't be large.)> > and how exactly did you encode and decode it? > > 1) Opusenc --bitrate 12 --downmix-mono Sweep50.wav Sweep50.opus > 2) Opusdec --float Sweep50.opus Sweep50out.wav
Petr Pařízek
2024-Aug-07 11:09 UTC
[opus] Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
> Can you please make that sound file available?> It is hard to tell without having anything.> (50s of sines shouldn't be large.)> >> Okay, the specific sine sweep that I used was this one. Originally, I >> was testing the "mid" and the "side" channel, which is why the first >> occurrence is in mono and the second is in inverse mono. To test the >> low bitrates, I had to use "--downmix-mono" when running Opusenc, >> which obviously makes the second sweep vanish. >> >> In this particular example, except for the very beginning, I >> deliberately altered the instantaneous amplitude proportionally to >> sqrt(freq), which makes the overall frequency spectrum flat even >> though the frequency is rising exponentially (not linearly). To do >> that, I actually convolved two different sine sweeps, each 25 seconds >> long, whose combined frequency spectrum is flat (as another Farina's >> module can generate the corresponding inverse signal). >> >> This is the link (there's a Download button on the webpage): >> https://1drv.ms/u/s!Ap_EgwEX00SDhH04THc07uQY2ojv?e=0Ab8Bf >> >> Petr >> >> >>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/opus/attachments/20240807/89c3fe85/attachment-0001.htm>
Petr Pařízek
2024-Aug-07 20:04 UTC
[opus] Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
> Why are you using a stereo file> containing the same sweep in both channels > and then downmixing to mono? When I first tried encoding at a higher bitrate, I needed to test the different behavior of the "mid" (l+r) and "side" (l-r) channels. That's why I made the first sweep identical on both the left and the right channel (i.e. "side" is silent) while the second sweep is inverted on the right channel and the left channel is the same again (i.e. "mid" is silent). > Also, why are you repeating the sweep twice in every channel? In the first case the two channels go in equal polarities while in the second case the two channels go in opposite polarities. > Also also, the file you linked to is Sweep50FlatMidSide.wav > as opposed to Sweep50.wav - is it really the same file? Yes, it's the same data. > Why are you using floats for the decoded file? Floating-point values are not limited to the range (-1,+1). If the compression accidentally makes the signal too loud, floating-point output doesn't clip the high value to -1 or +1. > The encoded opus file is 48kHz, > so how would the output wav be resampled from 16kHz? > What are those "clear signs" exactly? The things that I can hear while listening at 1/2 or even 1/4 of the original playback rate. Where the frequency reaches 8 kHz, suddenly it starts going down, not up. Also, when the original frequency is getting closer and closer to 8 kHz from the bottom, another frequency appears softly, is getting louder and is getting closer and closer to 8 kHz from the top(!) until the two finally meet at 8 kHz. The original frequency then quickly disappears while the unwanted new frequency is never completely filtered out, keeps falling and falling and at the exact time spot where the original frequency would reach 16 kHz, the undesired frequency goes down to zero. > The intermediate opus file already contains > only the first of the two repeating sweeps. > After around 50s, there is silence. > The resulting wav file too then, obviously. That's because originally the second sweep was in inverse mono. Therefore, after the mixdown, the sweep got actually subtracted from itself. > As far as I can tell (see the attached spectrograms), > the sound dies out around the point the freq reaches 12kHz. You're probably talking about the other frequency that came in, the one I called the undesired or unwanted frequency. The spectrogram is one thing, but switching to 1/2 or 1/4 or the playback rate and pressing Play is another. Especially, when you have the option to synchonize the uncompressed and the compressed version. > Also see the transcript below. Okay, I've read that. Seems the encoder and the decoder on your side behave the same way they do on my side. > What makes you think a sampling frequency of 16 kHz > is involved anywhere in the signal path? First, the fact that the original frequency and the undesired frequency actually meet at 8 kHz. Next, the fact that the undesired frequency is falling, not rising. Finally, the fact that first the undesired frequency comes in pretty quickly and then the original frequency disappears very quickly; so at one point, they're both there (and this point happens to be at 8 kHz). > What makes you think there is any downsampling involved? The fact that frequencies higher than 20 kHz are not filtered out but are rather replaced with frequencies higher than 4 kHz. Petr
Petr Pařízek
2024-Aug-08 12:26 UTC
[opus] Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
I wrote: > First, the fact that the original frequency and the undesired frequency actually meet at 8 kHz. > Next, the fact that the undesired frequency is falling, > not rising. Finally, the fact that first the undesired frequency comes in pretty quickly and then > the original frequency disappears very quickly; so at > one point, they're both there (and this point happens to be at 8 kHz). So, one more observation in Opusenc. If I either set the bitrate lower than 12 or if I set the "--expect-loss" switch to anything other than 0 and keep the bitrate at 12, the additional noise (occupying the frequencies up to 12 kHz) actually disappears completely! This makes the phenomenon I described yesterday even more noticeable. Petr
Petr Pařízek
2024-Aug-09 13:21 UTC
[opus] Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
> To be clear: did you mean the opus output of opusenc> or the wav output of opusdec? I meant during the decoding. There's one significant difference between how Opusdec deals with resampling and how, let's say, MP3 decoders usually deal with resampling. If I make an MP3 at a very low bitrate and if the encoder decides (because it's too low) to internally resample my audio before starting encoding, the decoder usually converts the MP3 to PCM at the effective lower sample rate chosen by the encoder, not at the original sample rate. Opus files can store the information about the original sample rate. Therefore, if I choose a very low bitrate and if Opusenc decides (because it's too low) to resample my audio before starting encoding, Opusdec looks into the Opus file and reads: "Aha, the original sample rate was 48 kHz, not 16." So even though the effective sample rate of the encoded data might be something like 16 kHz, Opusdec actually resamples it to 48 kHz. > Ah, so you _hear_ when the frequency reaches 8k exactly? Yes. When I turn the playback rate down to 12 kHz, the original 8 kHz is changed to 2 kHz, which makes the pitch clearly recognizable. And now that I've discovered what happens if I set either something like "--expect-loss 60" or "--bitrate 10" (see my last message), then it's much easier. > I am talking about the original sweep. The original sweep stops pretty close to 24 kHz. > Exactly. The spectrogram shows you the frequencies present in the signal. > Pressing Play relies on Golden Ears (TM). Since I aimed for a degree in music composition, it was in my best interest to learn to hear even the tiniest details. The only drawback is that nowadays my hearing stops somewhere around 16 kHz and I can still clearly remember the days when I was able to hear things up to 20 kHz. Petr
Apparently Analagous Threads
- Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
- Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
- Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
- Opus Tools -- low bitrates, new features in 1.5, "expect-loss"
- Opus Tools -- low bitrates