Jump to content


Photo

Oversampling compressed music


  • Please log in to reply
6 replies to this topic

#1 Master_Scythe

Master_Scythe

    Titan

  • Hero
  • 19,694 posts
  • Location:QLD

Posted 07 November 2016 - 11:05 AM

This is actually a topic I approached a good few years ago, on these very forums; but now I have a legitimate reason to learn the answer.

 

Lately I've been on a 90's kick, and I'm not really ashamed to say I enjoy a fair bit of "Cheese" from the past.

On that note, I have an MP3 copy of Eifel65's album. I tried to re-rip lossless, but the CD has degraded and spits errors like no tomorrow.

 

There is a very real problem; almost all the tracks (even on the original CD) have a high pitched whine at somewhere in the 12khz region; its 110% a production error.

It makes it unlistenable in any circumstance where a tweeter, or even a simple 2way speaker system exists.

 

I need to edit these tracks, throw a compressor over the 8khz to 16khz region, and hope it mellows the hell out.

 

Problem is, they're MP3. So they're already lossy.

 

I think they're 192kbps..... Which gives me quite a bit of wriggle room to 'upsample' the track when I export it again.

 

Using simple numbers to make a point;

Assuming 192kbps cuts 20 out of the 1000 possible 'subfrequencies' we can hear\feel.

Is it then safe to assume 256kbps would cut maybe 15 out of 1000 frequencies; and those "15" were probably ALREADY lost in the original 192kbps compression?

 

I know "re-compressing" to the same bitrate has a very real risk of losing more detail than was originally lost, because it tries to re-analyze the track and 'shrink it' but its already done, so its MORE agressive to do it's job.

 

Thoughts?


Wherever you go in life, watch out for Scythe, the tackling IT support guy.

"I don't care what race you are, not one f*cking bit, if you want to be seen as a good people, you go in there and you f*ck up the people who (unofficially) represent you in a negative light!"


#2 Rybags

Rybags

    Immortal

  • Super Hero
  • 34,290 posts

Posted 07 November 2016 - 11:33 AM

Counting on a re-encode to eliminate an unwanted frequency range is a bit of a roll of the dice.

 

I'd be decompressing to Wav, then use a proper processing tool to eliminate the unwanted squeal.

But still, you're kind of starting with a turd in the first place, possibly the original material used wasn't re-encoded properly as you generally don't get lots of unwanted noise at 192 kbps in MP3s.

 

In my experience for plain CBR, 192 is OK for TV stuff so long as you're not incredibly fussy, 224 preferable.  256 as a minimum for any music you actually care about.  So-called "upsampling" by encoding at a higher rate isn't exactly going to help much, a "proper" method to upsample would be use an editor or tool which employs a half decent interpolation method to e.g. increase it from 41 to 192 KHz.

 

Best route might be to just try and re-source the album as Wav or uncompressed Flac and use that as basis to re-encode to whatever you need.



#3 Master_Scythe

Master_Scythe

    Titan

  • Hero
  • 19,694 posts
  • Location:QLD

Posted 07 November 2016 - 11:58 AM

No, no, I don't intend on the re-encode to FIX my problems.

I intend to edit the existing MP3 in Audacity (which basically does uncompress to a WAV)

Run a compressor and a noise filter over it.

 

But that means when i'm done, I'll need to RE-compress again to mp3 (for compatibility).

Its pitched up 90's 'dance' music, so there's not a lot of fidelity to lose :P

 

CBR 128kbps is fine with modern LAME codec (old 128 was horrible), so I'm hoping it's getting smart enough to be 'gentle' on a re-encode if those frequencies are already 'lost'.

 

I've tried to re-source it, but really, most of those CD's are hard to find.

I don't use itunes.


Wherever you go in life, watch out for Scythe, the tackling IT support guy.

"I don't care what race you are, not one f*cking bit, if you want to be seen as a good people, you go in there and you f*ck up the people who (unofficially) represent you in a negative light!"


#4 Jeruselem

Jeruselem

    Guru

  • Atomican
  • 13,194 posts
  • Location:Not Trump-Land

Posted 07 November 2016 - 12:00 PM

Which album was it?


Cortana at your service


#5 Rybags

Rybags

    Immortal

  • Super Hero
  • 34,290 posts

Posted 07 November 2016 - 12:01 PM

Not sure 128 kbps will be much good.  AAC is the go-to audio codec for pairing with Mpeg-4 H.264 and H.255, and somewhat better quality than MP3 at a given bitrate.  Even with that I'd be using 160 kbps for music as a minimum.



#6 @~thehung

@~thehung

    Guru

  • Hero
  • 8,464 posts

Posted 11 November 2016 - 09:46 PM

This is actually a topic I approached a good few years ago, on these very forums; but now I have a legitimate reason to learn the answer.

 

Lately I've been on a 90's kick, and I'm not really ashamed to say I enjoy a fair bit of "Cheese" from the past.

On that note, I have an MP3 copy of Eifel65's album. I tried to re-rip lossless, but the CD has degraded and spits errors like no tomorrow.

 

There is a very real problem; almost all the tracks (even on the original CD) have a high pitched whine at somewhere in the 12khz region; its 110% a production error.

It makes it unlistenable in any circumstance where a tweeter, or even a simple 2way speaker system exists.

 

I need to edit these tracks, throw a compressor over the 8khz to 16khz region, and hope it mellows the hell out.

 

Problem is, they're MP3. So they're already lossy.

 

I think they're 192kbps..... Which gives me quite a bit of wriggle room to 'upsample' the track when I export it again.

 

'wiggle room'?  you can either improve the original or you cant, but you are free to re-encode to whatever bitrate you like.  if you mean that at 192 the original is apparently intact enough quality-wise to be worth the effort, sure, but your ears already told you that!
 

 

Using simple numbers to make a point;

Assuming 192kbps cuts 20 out of the 1000 possible 'subfrequencies' we can hear\feel.

Is it then safe to assume 256kbps would cut maybe 15 out of 1000 frequencies; and those "15" were probably ALREADY lost in the original 192kbps compression?

 

I know "re-compressing" to the same bitrate has a very real risk of losing more detail than was originally lost, because it tries to re-analyze the track and 'shrink it' but its already done, so its MORE agressive to do it's job.

 

Thoughts?

 

first, lets consider what would happen if you encoded a WAVE file to mp3 at two different quality levels — one at 256 kbps, and a smaller one at 192 kbps.  

would you suppose that in either case the encoder would begin by discarding bits of audio in exactly the same order?  in other words — as per your abstraction — would the first 15 of 20 cut at 192 kbps precisely match the 15 cut at 256?

not necessarily!

keep in mind that the encoder uses a psychoacoustic model.  its main job is to remove sounds that are so close in either time or pitch to nearby louder sounds that they are undetectable to the human ear anyway and won't be missed.  however, the full or partial removal of any sound introduces new sound/s (ie. noise) whose perceptibility must be weighed according to the uneven frequency response of our ears.  and being digital, its often a game of choosing the lesser evil between rounding a binary integer up or down, or in this case, between spending one less bit on a desired sound only to add a smidge too much noise, or comfortably keeping the noise low at the cost of using one too many bits.  

its a no-brainer to assume that every encoder begins by trimming away the predictable shit nobody can hear anyway — and all the better if theres a lot of it (many small cuts = low noise).  and this is why sufficiently high bitrate lossy compression can sound every bit as good as lossless.  

but beyond that, and as compression gets more severe, theres going to be a decision tree to evaluate alternatives that are qualitatively similar.  for argument's sake, lets suppose that in one section the encoder is scraping the bottom of the barrel to cut the last 7 bits needed to meet the target bitrate.  it has boiled its options down to either two 4-bit cuts in one frequency band or a single 7-bit cut in another, and it chooses the latter because it is preferred by the psychoacoustic model.  however, if the process were to be repeated with a slightly lower target bitrate, at this point the encoder might need to cut an additional bit, meaning that the single cut option would not be on the table.  the result: a more compressed file keeping some stuff that a less compressed file would have removed.

now, although i think differences like the above are inevitable, i am being very pedantic, and nobody would ever hear these differences in practice — so what is my point?  

my point is, your assumption is "safe" enough, although i noticed that the last part of your post almost contradicts it.  hopefully i have shown why recompressing to the same bitrate would be nowhere near as aggressive as you may imagine.  i bet they would be almost identical.  i mean, you wouldnt — and not just because you are probably using a different encoder.  but you really only need to bump it up a bit for safety.  

as for the song -- its unlikely that you will be able to surgically notch out the offending sound with a filter (although by all means try), so i think a multiband compressor is your best bet.   
 


Edited by @~thehung, 11 November 2016 - 09:48 PM.

no pung intended

#7 Master_Scythe

Master_Scythe

    Titan

  • Hero
  • 19,694 posts
  • Location:QLD

Posted 14 November 2016 - 09:39 AM

Ah, yes.

See that's my assumption.

Assuming the same track, and the same codec, I would have assumed at least very similar sub frequencies are cut away to achieve the file size.

 

And as such, by going 'up a bitrate' I wont get any clarity back, but I would hopefully not lose any additional detail.

 

Or so was my thinking.


Wherever you go in life, watch out for Scythe, the tackling IT support guy.

"I don't care what race you are, not one f*cking bit, if you want to be seen as a good people, you go in there and you f*ck up the people who (unofficially) represent you in a negative light!"





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users