Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Lossless with lowpass (Read 5996 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Lossless with lowpass

Is there an easy way to lowpass a wav file at a specific frequency, and then losslessly compress it? (Yes, I know it wouldn't be completely lossless.) And how much would that affect the file size?
If I'm not stupid, this could remove information that I can't hear, and that no lossy encoder would use anyway. If I also highpass, it would be like cropping an image, wouldn't it? 
How high frequencies can a wav file contain?

--

Lossless with lowpass

Reply #1
I believe waveform files can contain up to 22050 Hz frequencies. I'm not sure how much of an influence it would have on lossless compression. Your best bet is to try.

Lossless with lowpass

Reply #2
If your source is CD the wav file can have up 22050 Hz.  Otherwise it's half the samplerate according to the Nyquist Theorum.
Nero AAC 1.5.1.0: -q0.45

Lossless with lowpass

Reply #3
To my understanding, lowpassing shouldn't make much of a difference (since lossless compression is more math and information theory than psychoacoustics). You might get a few percent better ratio out of it (i.e. not worth it).

Lossless with lowpass

Reply #4
Have a look at this thread.

The lowpass filter would not reduce the lossless encoder's efficiency much. It might even be larger.
The object of mankind lies in its highest individuals.
One must have chaos in oneself to be able to give birth to a dancing star.

Lossless with lowpass

Reply #5
Quote
APE 3.99 High / original sample - 47.6 MB
APE 3.99 High / same sample with 20 KHz cutoff - 47.0 MB (1.4% gained)
APE 3.99 High / same sample with 16 KHz cutoff - 43.9 MB (8.4% gained)

FLAC 1.1.2 -8 / original sample - 49.2 MB
FLAC 1.1.2 -8 / same sample with 20 KHz cutoff - 49.0 MB (0.4% gained)
FLAC 1.1.2 -8 / same sample with 16 KHz cutoff - 47.3 MB (3.9% gained)
[a href="index.php?act=findpost&pid=285336"][{POST_SNAPBACK}][/a]


thanks, I guess the above is what I wanted to know. Not much use then, I wouldn't lowpass at 16 anyway..

--

Lossless with lowpass

Reply #6
I think it should be only good foe few percent gain in compression.

But I wouldn't choose to lose anything if i plan to go lossless.


Lossless with lowpass

Reply #7
Quote
Is there an easy way to lowpass a wav file at a specific frequency, and then losslessly compress it? (Yes, I know it wouldn't be completely lossless.) And how much would that affect the file size?
If I'm not stupid, this could remove information that I can't hear, and that no lossy encoder would use anyway. If I also highpass, it would be like cropping an image, wouldn't it? 
How high frequencies can a wav file contain?

--
[a href="index.php?act=findpost&pid=318931"][{POST_SNAPBACK}][/a]

You should try resampling to a lower bit-rate after low-pass filter.  You'll see a noticably smaller WAV file and a smaller compressed file.  If you do not resample, there will be some, but very little advantage when you compress to loseless.

Lossless with lowpass

Reply #8
To reiterate what woody just said, if you were to lowpass at 16kHz (which I know you already said that you wouldn't use, but you were just testing) you would probably want to resample to 32,000Hz since (given Nyquist) 16kHz is the highest possible frequency with a sample rate of 32kHz.

In any case, this kind of ruins the purpose of using lossless encoding to begin with, since the file that you are passing through the encoder has already become lossy after the lowpass.

Lossless with lowpass

Reply #9
Quote
Quote
APE 3.99 High / original sample - 47.6 MB
APE 3.99 High / same sample with 20 KHz cutoff - 47.0 MB (1.4% gained)
APE 3.99 High / same sample with 16 KHz cutoff - 43.9 MB (8.4% gained)

FLAC 1.1.2 -8 / original sample - 49.2 MB
FLAC 1.1.2 -8 / same sample with 20 KHz cutoff - 49.0 MB (0.4% gained)
FLAC 1.1.2 -8 / same sample with 16 KHz cutoff - 47.3 MB (3.9% gained)
[a href="index.php?act=findpost&pid=285336"][{POST_SNAPBACK}][/a]


thanks, I guess the above is what I wanted to know. Not much use then, I wouldn't lowpass at 16 anyway..

--
[a href="index.php?act=findpost&pid=319006"][{POST_SNAPBACK}][/a]


The reason those gains are so low is that CDs typically don't have a lot of high frequency content anyway, so lowpassing doesn't do a whole lot for you.  It mainly just helps with LAME because MP3 bloats when encoding above ~16KHz (IIRC).  ANd most of that bloat isn't high frequency content, but rather low frequency content that has to added because there is no scalefactor for high frequencies in MP3.

I think if you took a track that had white noise all the way up to 22KHz, you would see much more substantial gains from a 16KHz low pass.  However this isn't realistic for actual music.

Lossless with lowpass

Reply #10
Quote
To my understanding, lowpassing shouldn't make much of a difference (since lossless compression is more math and information theory than psychoacoustics). You might get a few percent better ratio out of it (i.e. not worth it).
[a href="index.php?act=findpost&pid=318956"][{POST_SNAPBACK}][/a]

We all seem to agree on that a lowpass won't be that usefull but I'd like to give a comment about the "math and information" thing: By removing an audio band you effectifly increase the predictability of the signal since the predictability (I'm thinking of LPC) is closely related to how the signal energy is spread in the time and frequency domain.

Sebi

Lossless with lowpass

Reply #11
IMO the real saving could be in a sample rate conversion AFTER the lowpass ( a good sample rate converter, like SSRC, will do that anyhow to avoid aliasing ), like going from 48 KHz to 32 KHz, and i swear this WILL have a huge impact on the lossless compressed file size, but same is true for the uncompressed of course.

With same sampling rate, the gain should be close to nothing ....

Lossless with lowpass

Reply #12
Thankfuly there are lossy codecs that help to mantain rather high quality and small files. I would rather compress to MP3 than resample to 32KHz  and I'm not the only one

Lossless with lowpass

Reply #13
Quote
Is there an easy way to lowpass a wav file at a specific frequency, and then losslessly compress it? (Yes, I know it wouldn't be completely lossless.) And how much would that affect the file size?
If I'm not stupid, this could remove information that I can't hear, and that no lossy encoder would use anyway. If I also highpass, it would be like cropping an image, wouldn't it? 
How high frequencies can a wav file contain?

--
[a href="index.php?act=findpost&pid=318931"][{POST_SNAPBACK}][/a]

It wouldn't be lossless at all