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: sampling rate (choice, matching,...) (Read 5998 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

sampling rate (choice, matching,...)

    Version 6.1 of QuickTime 6 Pro has two new setting-options, including one for sampling rate, and I'm wondering:

    MATCHING:
    When converting a WAV/AIFF file into AAC, should the sample rate for encoding be equal to the sampling rate of the file?  For example, if the AIFF is at 32000 kHz, should the encoding also be done at 32000 kHz?  If not, will there be a loss of quality due to the mismatch?  Or will it waste bitrate? (if for example, a 32000-AIFF is encoded into a 44100-AAC, will it just be wasteful since nothing above 32000 would be in the original file, anyway)  And if a 44100 AIFF-file will be encoded at 32000, would it be better to originally record the AIFF at 32000?
    by the way, I'm not really sure what "encoding at 32000 kHz" means, so maybe these are silly questions.  If so, please educate me.   :<)

    SELECTION:
    I've read that if you want frequencies up to 16000 Hz, you should use 32000 Hz sampling; and if you want 22050 Hz then use 44100 Hz sampling, and so on.  Is this a good general rule of thumb?
    For recording from CDs, 44100 seems the obvious choice, since this is what's on the CD.  For recording from DAT, it would be 48000.  But most of my recording (and converting to AAC) will be from cassette tapes (with or without Dolby) and from FM radio.  Since (I think, but I could be wrong) there isn't a lot happening above 16000 Hz for either cassettes or FM, would it be wasteful to use 44100 for these, instead of 32000?  Or would it actually be BETTER at 32000 because it might lead to less tape-hiss?  Or, especially for voice recordings (of lectures, interviews,...) would a sampling rate that is even lower be better, at maybe 24000 or 22050?
    For encoding at high bitrates (like 160 kbps or above) it probably doesn't matter much, since plenty of information can be encoded) so using 44100 for any source (CD, tape, FM,...) would be OK, but what about low bitrates (like the 32 kbps-mono, equivalent to 64 kbps stereo, that I'll probably use for most of my voice-recordings)?  For lower bitrates like 32-mono, would encoding at 32000 (or even 24000 or 22050) instead of 44100 be better, since this would let the encoder focus its limited processing power on the low and medium frequencies where (especially for voice) most of the important frequencies are?

Mike

sampling rate (choice, matching,...)

Reply #1
Quote
For example, if the AIFF is at 32000 kHz, should the encoding also be done at 32000 kHz?  If not, will there be a loss of quality due to the mismatch?  Or will it waste bitrate? (if for example, a 32000-AIFF is encoded into a 44100-AAC, will it just be wasteful since nothing above 32000 would be in the original file, anyway) 

Right. Upsampling is always useless, quality and space-wise. It should only be used for compability with players that support only a certain sample rate. (E.G: if you want to burn a 32kHz file to an audio CD, upsample it to 44100 first, or there'll be errors)

Quote
For recording from CDs, 44100 seems the obvious choice, since this is what's on the CD.  For recording from DAT, it would be 48000.  But most of my recording (and converting to AAC) will be from cassette tapes (with or without Dolby) and from FM radio.  Since (I think, but I could be wrong) there isn't a lot happening above 16000 Hz for either cassettes or FM, would it be wasteful to use 44100 for these, instead of 32000?  Or would it actually be BETTER at 32000 because it might lead to less tape-hiss?  Or, especially for voice recordings (of lectures, interviews,...) would a sampling rate that is even lower be better, at maybe 24000 or 22050?


The best way to find out the best sample rate for these recordings is testing it yourself. Record from high to low sample rates, and stop when you notice the sound starts getting bad.

And yes, voice recordings usually don't require high frequencies. Maybe even 16000 would be OK.

Quote
(like the 32 kbps-mono, equivalent to 64 kbps stereo that I'll probably use for most of my voice-recordings)


32 kbps mono isn't equivalent to 64 kbps stereo, due to stereo redundancy coding. To get a mono quality similar to 64kbps stereo, you would need to try 48 kbps, or even 56.

Quote
For lower bitrates like 32-mono, would encoding at 32000 (or even 24000 or 22050) instead of 44100 be better, since this would let the encoder focus its limited processing power on the low and medium frequencies where (especially for voice) most of the important frequencies are?


Yes. For voice, frequencies higher than 22050 would just be a waste of space.

Regards;

Roberto.

sampling rate (choice, matching,...)

Reply #2
Quote
Right. Upsampling is always useless, quality and space-wise. It should only be used for compability with players that support only a certain sample rate. (E.G: if you want to burn a 32kHz file to an audio CD, upsample it to 44100 first, or there'll be errors)

That's true, unless your DAC is bad at upsampling so that the upsampling process should be done in software.

sampling rate (choice, matching,...)

Reply #3
Quote
I've read that if you want frequencies up to 16000 Hz, you should use 32000 Hz sampling; and if you want 22050 Hz then use 44100 Hz sampling, and so on.  Is this a good general rule of thumb?

Yes, and as far as I know QuickTime 6 Pro already follows this rule automatically, e.g. a 96 kbps encoding will have a cutoff at 15 or 16 kHz and a resampling frequency of 32 kHz (you could try it out yourself if it's not obvious from the QuickTime settings). You should only change their default settings for the sample rate if you really know why you do this. As long as there's no way to change the cutoff frequency for a given bitrate, too, this option is not very useful, because these three values (bitrate, cutoff and sample frequency) should always match in order to obtain the best results.
ZZee ya, Hans-Jürgen
BLUEZZ BASTARDZZ - "That lil' ol' ZZ Top cover band from Hamburg..."
INDIGO ROCKS - "Down home rockin' blues. Tasty as strudel."

sampling rate (choice, matching,...)

Reply #4
Hans says,
[Yes, and as far as I know QuickTime 6 Pro already follows this rule automatically, e.g. a 96 kbps encoding will have a cutoff at 15 or 16 kHz and a resampling frequency of 32 kHz (you could try it out yourself if it's not obvious from the QuickTime settings).]

    In Version 6.1 of QT6-Pro, there are settings for resampling frequency but no settings for a cutoff. (in 6.0 everything except bitrate and stereo/mono was default)  It seems smart for them to do what you sugest, but it's difficult to know since Apple doesn't provide much information about the details of their AAC encoding.  Or maybe I just don't know where to looik.
    So far I've been using a 32000 Hz sampling rate to make AIF/WAV files to encode into AAC, since I'm encoding from cassette tapes and FM radio, and for these there isn't much (except tape hiss?) above 16000 Hz.  At settings of 160 kbps and higher (for stereo, or 80 kbps and above for mono) there is no setting for 32000 resampling when encoding into AAC.  I'll be recording most of my taped music into 160 or 192, so for this would it be better (since the encoding will be done at 44.1 KHz) to also sample the AIFF/WAV at 44.1, or to make the AIFF at 32 and then (since 32 isn't an option in QT6) encode at 44.1?

    And a question based on my lack of knowledge: Are there any advantages or disadvantages to sampling and encoding at different rates?  For example, if musical notes of almost the same frequency combine, there can be strange effects: with 440 Hz and 445 Hz, there is a "beat wave" due to their difference of 5 Hz.  And two close notes, such as A and A#, sound horrible together, producing lots of dissonance!  With sampling and encoding both at 32 KHz (or both at 44.1 KHz) is there any danger of something like this occurring?  If they aren't quite "in phase" (or if they're not both at EXACTLY 32000 so they're going in-phase and out-of-phase) would this produce dissonant artifacts?  Or is this a silly question?

Mike

sampling rate (choice, matching,...)

Reply #5
Roberto says,
"32 kbps mono isn't equivalent to 64 kbps stereo, due to stereo redundancy coding."

    Is this because AAC uses something analogous to the "joint stereo" used in MP3 encoding?  In some pages about converting analog (LPs, tapes,...) to digital, they warn against using joint stereo because it can cause strange artifacts if the phasing (in the L and R channels) is different by a little bit.  This might be more likely to be problem if the tape-recording and tape-playing are done on different tape decks, which is true for most of my tapes.  In further reading, I read that this WAS a problem in early MP3 encoders, but in recent improved encoders (like LAME) the joint stereo is better and there should be no problem.  (there also are two different types of joint stereo in MP3, with one basically being OK if it's done well, and the other more likely to cause problems)
    Is there any possibility that the "joint stereo" used by AAC might cause problems due to phase-differences (L vs R) when making AAC-files from tapes?


Roberto also says,
[For voice, frequencies higher than 22050 would just be a waste of space.]

    This seems logical.  But I'm finding that, for me, the most NOTICABLE artifacts occur with voices, not music.  For example, with voices (but not music) I notice an "echo chamber" metallic/watery sound in AACs made at low bitrates. (I can hear this clearly at 96 kbps with stereo, and even a little bit at 128.) When I listen to low-bitrate AACs (like 64-mono or 32-mono, or 96-stereo) the thing I notice the most is the difference (compared with the original) in voice quality, not music quality.  Why?  Is this because human voices are so much more familiar, and I have more expectations about how they should sound, and the loss of quality is more obvious?  Or is something else causing this?
    Would this "echo" (metallic? watery?) sound be due to a loss of high frequencies, or too much high frequencies, or time-phase distortions, or what?  (it occurs when recording from FM and also tapes; I'm converting the analog into AIFF and then encoding this into AAC)  To minimize it, are there any good strategies, besides just increasing the bitrate?

Mike

sampling rate (choice, matching,...)

Reply #6
Quote
In Version 6.1 of QT6-Pro, there are settings for resampling frequency but no settings for a cutoff. (in 6.0 everything except bitrate and stereo/mono was default)  It seems smart for them to do what you sugest, but it's difficult to know since Apple doesn't provide much information about the details of their AAC encoding.  Or maybe I just don't know where to looik.

The fact that resampling is only available for lower bitrates in your QT 6.1 version shows that they have coupled it with the bitrate (and probably cutoff frequency as well). The disadvantage of the Apple approach (i.e. hiding everything important from their users) in this case would afford that you have to look at the resulting MP4 files in a spectrum analyzer like e.g. CoolEdit has and try to guess where they placed the cutoff. In PsyTEL the DOS box showed you the chosen value that was also fixed to a certain bitrate, by the way.

Quote
I'll be recording most of my taped music into 160 or 192, so for this would it be better (since the encoding will be done at 44.1 KHz) to also sample the AIFF/WAV at 44.1, or to make the AIFF at 32 and then (since 32 isn't an option in QT6) encode at 44.1?


Just leave it as it is, 44.1 kHz for the original recording and the same for the encoding. Like Roberto already wrote, upsampling normally makes no sense while encoding a file. To downsample an original file (e.g. from 44.1 to 32 kHz) before the encoding with an external resampling tool could make sense if the encoder doesn't have an internal resampling option (like FAAC or QT 6.0), and you want to use a lower sample rate and bitrate for the encoded file.

Quote
And two close notes, such as A and A#, sound horrible together, producing lots of dissonance!  With sampling and encoding both at 32 KHz (or both at 44.1 KHz) is there any danger of something like this occurring?


So you seem to be a musician, too?    Don't worry, this won't happen, in fact the result of downsampling for lower bitrates and cutoffs is quite the opposite: better resolution of high frequencies, because the encoder doesn't have to waste bits for a much too high sample rate that doesn't match the cutoff frequency. I could hear this while testing PsyTEL AAC some months ago.

If you'd like to know more about analog-to-digital conversion etc., you could e.g. have a look at the Wiki pages on Audiocoding.com that deal with these questions.
ZZee ya, Hans-Jürgen
BLUEZZ BASTARDZZ - "That lil' ol' ZZ Top cover band from Hamburg..."
INDIGO ROCKS - "Down home rockin' blues. Tasty as strudel."

sampling rate (choice, matching,...)

Reply #7
Quote
Quote
...most of my recording (and converting to AAC) will be from cassette tapes (with or without Dolby) and from FM radio.  Since (I think, but I could be wrong) there isn't a lot happening above 16000 Hz for either cassettes or FM, would it be wasteful to use 44100 for these, instead of 32000?  Or would it actually be BETTER at 32000 because it might lead to less tape-hiss?  Or, especially for voice recordings (of lectures, interviews,...) would a sampling rate that is even lower be better, at maybe 24000 or 22050?
...voice recordings usually don't require high frequencies. Maybe even 16000 would be OK.

For voice, frequencies higher than 22050 would just be a waste of space.
I'm about to start archiving a bunch of old lectures from cassette to WAV (16-bit, mono) to FLAC.

Is there any foreseeable drawback to recording from cassette to the 22050 sample rate, as opposed to 44100? 
 
I'd hate to get a year or two down the line and find some reason to have recorded at 44100.

Any info would really be appreciated.

TIA,

~esa