Skip to main content

Notice

If you are using a Hotmail or Outlook email address, please change it now, as Microsoft is rejecting all email from our service outright.
Topic: Is there any way to use the aac format to cut off only frequencies above 20 KHz? (Read 848 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is there any way to use the aac format to cut off only frequencies above 20 KHz?

I've already tested several formats, but they either don't cut above 20 KHz or cut below 20 KHz, like 16 KHz. I know that Opus does that. But I would like aac like that, with only frequencies equal to or less than 20 KHz. So that you don't waste bits with frequencies above that, as they are inaudible. For example, the aac apple encoder maintains all of them. If I only use up to 20KHz, I can have more bits at the most audible frequencies (20 Khz or less). Is there any way to create aac files like that? ;D

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #1
No sane lossy encoder is spending any bits above 20khz unless you are doing something wrong. They may emit some noise above 20k, but that isn't costing you bitrate.

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #2
Its also not really true to say that Opus cuts at 16kHz.  Assuming you give it a sensible number of bits, it encodes using frequencies from 3(?) to 20,000 Hz.  However it does allocate bits based on frequency bands, once of which is near 16kHz and upwards.  That top band usually gets a pretty sparse allocation, simply because most people can't hear at all and the ones that can hear it barely notice what it sounds like.

For AAC, the FDK encoder will do what you want with certain settings.  Other encoders I'm not sure.

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #3
Well, most formats will gradually increase the lowpass when the bitrate is increased.

The Lame mp3 encoder is well documented and you can see the lowpass for each settings here:
http://wiki.hydrogenaud.io/index.php?title=LAME#Recommended_settings_details

Qaac -V 91 produces files with a lowpass around 19khz and -V100 around 20khz.


I think Opus (and ogg vorbis?) is an exception though, it encodes the full spectrum even at low/medium bitrates. And sbr/he-aac codecs as well. :)

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #4
No sane lossy encoder is spending any bits above 20khz unless you are doing something wrong. They may emit some noise above 20k, but that isn't costing you bitrate.

I wouldn't say that. Many encoders are keeping full spectrum contents (22.05 KHz) when —very— high bitrate is requested by user. I get this results with: iTunes (TVBR max), FDKAAC (VBR max), FHGAAC (VBR max & CBR max), NeroAAC (VBR max), Vorbis (VBR max), MPC (VBR max). The encoders are sane but maybe the users aren't ;).
Formats like WavPack lossy, OptimFrog DualStream, lossyWAV also maintains spectrum but we know these formats are different (and high bitrate only).

Opus behavior is indeed different: it never keeps content higher than 20 KHz. There's a frequency cut-off at 20 KHz even at 500 kbps on stereo tracks. But is it really a good choice?

@Arlong13 > as Mark7 said, if you lower the bitrate a lowpass will appear with these encoders. Then you'll save some space and keep perceptual quality at the same time.

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #5
500 kbps on stereo tracks is often not enough to losslessly encode 0..20 kHz range, and >20kHz range is not possible to hear, so it kind of makes sense to spend bits on the hearable range until it's completely useless. 
There's also such a thing as generational loss. Spending bits on hearable range theoretically can reduce generational loss. Spending bits on >20kHz range is just that... nobody will hear it anyway (assuming normal playback speed).
some ANC'd headphones + AutoEq-based impulse + Meier Crossfeed (30%)

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #6
500 kbps on stereo tracks is often not enough to losslessly encode 0..20 kHz range, and >20kHz range is not possible to hear, so it kind of makes sense to spend bits on the hearable range until it's completely useless. 
It makes some sense, yes.
On the other side, modern encoders start to become transparent at ~120 kbps (if not below). At ~200 kbps they should be fully transparent except maybe minor issues on very rare problem samples. At 250…300 kbps those minor issues are solved. So what's the point of using 250 additional kbps and still remove original frequencies? Making more transparent what already transparent is? There's also no audible benefit on it.
To be honest, I don't see many people using 512 kbps lossy encoding for Red Book content. And if such people exists, I'm pretty sure many of them will take a look on a spectral analysis. For me it makes more sense to keep 20…24KHz content at higher bitrate when transparency is already reached and secured than increasing quality below when nobody can hear it or simply see it.

Quote
There's also such a thing as generational loss. Spending bits on hearable range theoretically can reduce generational loss. Spending bits on >20kHz range is just that... nobody will hear it anyway (assuming normal playback speed).
Theoretically, yes.
I made long ago a re-coding test, and LAME MP3 was the worst basis for that task:
https://hydrogenaud.io/index.php?topic=32440.0
There was a debate about frame boudaries and quality while re-coding to MP3. For that reason I'm sure that other factors exists for maintaining quality on generational loss.

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #7
Quote
So that you don't waste bits with frequencies above that, as they are inaudible.
The main idea behind perceptual encoding (AAC & MP3, etc.) is to throw-away things you can't hear but it's a LOT more advanced than simply throwing-away the highest frequencies. 

The programmers have done a lot of testing and the default settings usually do the best job with most program material.

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #8
What I think is like opus works. Let's compare 320 kbps for example, If one file called A has this bitrate limited to 20 KHz and another file called B also 320 kbps limited for 22,5 KHz, the first file will have more audible quality, because the A file don't is spending bits above of 20 Khz. The opus is the file A, and the apple aac encoder is the file B. My question is: There is a way to encoder aac files into 320 kbps limited to 20 Khz? Sorry for the bad english, I'm not a native.

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #9
Let's compare 320 kbps for example, If one file called A has this bitrate limited to 20 KHz and another file called B also 320 kbps limited for 22,5 KHz, the first file will have more audible quality, because the A file don't is spending bits above of 20 Khz.

I doubt either encoder is spending any bits at all on frequencies above 20 kHz.

My question is: There is a way to encoder aac files into 320 kbps limited to 20 Khz? Sorry for the bad english, I'm not a native.

See if your encoder has a lowpass filter option.

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #10
What I think is like opus works. Let's compare 320 kbps for example, If one file called A has this bitrate limited to 20 KHz and another file called B also 320 kbps limited for 22,5 KHz, the first file will have more audible quality, because the A file don't is spending bits above of 20 Khz.
No, audible quality won't increase. At 320 kbps it's already transparent. A and B will sound the same.

Re: Is there any way to use the aac format to cut off only frequencies above 20 KHz?

Reply #11
What I think is like opus works. Let's compare 320 kbps for example, If one file called A has this bitrate limited to 20 KHz and another file called B also 320 kbps limited for 22,5 KHz, the first file will have more audible quality, because the A file don't is spending bits above of 20 Khz. The opus is the file A, and the apple aac encoder is the file B. My question is: There is a way to encoder aac files into 320 kbps limited to 20 Khz? Sorry for the bad english, I'm not a native.
I have a bit more time to answer.
Let's do the same comparison, but at 80 kbps with a imaginary modern lossy perceptual format we will call OPAAC format).
File A: 80 kbps opaac with lowpass at 16 KHz
File B: 80 kpbs opaac with lowpass at 22.05 KHz

File A is good but not transparent. It's quite easy to ABX on many samples.
File B is audibly worse: it spends extra bitrate on inaudible spectrum; it tries to maintain high frequency when possible which lead to ringing or other artifacts, etc…
So what happens? Opaac developer will set by default a lowpass to 16 KHz for 80 kbps encoders and will progressively increase the lowpass with bitrate/quality inflation.

There is no need to reinvent the wheel: many developers spent several years on tweaking their encoders. They are usually highly tuned. A basic approach like yours (no offense meant) is unlikely to work because if it would work it would already be implemented.
So if an encoder keeps the full frequency spectrum at a certain bitrate it's likely because a different bitrate allocation (focused on audible spectrum only) won't bring any audible improvement.

 
SimplePortal 1.0.0 RC1 © 2008-2020