HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: marco_mania on 2006-09-24 21:39:21

Title: amplitude range (floating point)
Post by: marco_mania on 2006-09-24 21:39:21
hello,

i use ov_read_float in my vorbis-player-project to get my pcm data.
i've noticed, that many of these floating point values are slightly out of the "official" amplitude range between -1.0f and 1.0f.
so why is that?
is it okay, just to clip it? JACK expect values *only* in range of -1 and 1.

thank you!

marco
Title: amplitude range (floating point)
Post by: benski on 2006-09-24 21:46:01
hello,

i use ov_read_float in my vorbis-player-project to get my pcm data.
i've noticed, that many of these floating point values are slightly out of the "official" amplitude range between -1.0f and 1.0f.
so why is that?
is it okay, just to clip it? JACK expect values *only* in range of -1 and 1.

thank you!

marco


Because the reverse transform generates transients that can peak higher than the original sound.  This is common for all transform codecs - I've seen as high as 1.5 before.  Most players are clipping this before outputting to the soundcard.  I've seen some code that will distort the audio (via tanh or similiar) in hopes that it will sound better than clipping, and I've also seen look-ahead limiting done.  These higher-than-1 peaks are one reason why ReplayGain is so popular around here
Title: amplitude range (floating point)
Post by: [JAZ] on 2006-09-25 15:35:38
JACK expect values *only* in range of -1 and 1.


Jack applies hardclipping when converting to the pcm output, at least on my experience.