The ability of a 44kHz audio file to create high tones

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

User avatar
el sjaako
Posts: 45
Joined: Sun Feb 11, 2007 3:52 pm UTC
Location: Netherlands
Contact:

The ability of a 44kHz audio file to create high tones

Postby el sjaako » Thu Jul 05, 2007 2:51 pm UTC

I'm really not sure where to post this, it fits in at least three categories. But I thought the answer (if there is one) would probably be math, so I put it here.

Audio files are supposed to be able to recreate all the frequencies in the human hearable range. This is mostly stated as 20 Hz - 20 kHz. Most consumer audio files, CD's etcetera are encoded at either 44.1 kHz or something around 41 kHz. In other words, creating a tone of 22.05 kHz (taking the first example) would be easy, just do maximum value, minimum value, maximum, etc.
The assumption, whenever I read about this is that it is thus also possible to create lower frequencies. But I can not imagine how you could make a 20 kHz tone.

Are audio files really not able to generate high tones? Is there a subtle or ingenious trick at work? Do I suffer from a gross misunderstanding of how audio files work? I'd really like to know!

User avatar
evilbeanfiend
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby evilbeanfiend » Thu Jul 05, 2007 3:00 pm UTC

there is an upper limit to the frequency you can have
http://slack.net/~ant/bl-synth/3.nyquist.html


mathematically no lower limit, though you may not always have a whole number of wavelengths within a given number of samples. also in a real system once you get to a sufficently low frequency you will probably find there is too much noise to do anything useful with the signal.

edit: attept at showing slower frequency

at nyquist we have

1,-1,1,-1,1,-1 etc

a little below we might have

1,-0.9,0.8,-0.7,0.6 etc.

note that there is a beat frequency between the wave frequency and the sampling frequency so the numbers are reducing at the moment but will go back up again at some point.
in ur beanz makin u eveel

aoanla
Posts: 108
Joined: Wed Jun 13, 2007 6:02 pm UTC

Postby aoanla » Thu Jul 05, 2007 3:10 pm UTC

However, bear in mind that the Nyquist frequency is the theoretical highest reconstructible frequency for a given sample rate for a sample of infinite duration.
Samples of less than infinite duration may not be reproducible accurately even below the Nyquist frequency, especially if we are close to it (and indeed, at the Nyquist frequency, you lose all phase information, while retaining frequency information).

User avatar
pete
Posts: 126
Joined: Thu Apr 19, 2007 2:32 pm UTC

Postby pete » Thu Jul 05, 2007 3:11 pm UTC

Have a look at this: http://en.wikipedia.org/wiki/PCM

Also: http://en.wikipedia.org/wiki/Audio_file_format

Apologies if I totally misunderstood your question.

User avatar
evilbeanfiend
Posts: 2650
Joined: Tue Mar 13, 2007 7:05 am UTC
Location: the old world

Postby evilbeanfiend » Thu Jul 05, 2007 3:12 pm UTC

probably what is confusing the OP is the sample frequency does not have to match the signal frequency
in ur beanz makin u eveel

User avatar
gmalivuk
GNU Terry Pratchett
Posts: 26820
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

Postby gmalivuk » Thu Jul 05, 2007 4:03 pm UTC

The thing is, you don't really need to worry much about 20kHz sounds when making the average CD. While we can hear sounds that high, they're perceived as much quieter than more midrange sounds, so would generally be irrelevant when you're recording and playing a normal song.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

User avatar
OmnipotentEntity
Posts: 102
Joined: Fri Sep 15, 2006 2:01 am UTC
Location: Duct taping the internet
Contact:

Postby OmnipotentEntity » Thu Jul 05, 2007 4:26 pm UTC

gmalivuk wrote:The thing is, you don't really need to worry much about 20kHz sounds when making the average CD. While we can hear sounds that high, they're perceived as much quieter than more midrange sounds, so would generally be irrelevant when you're recording and playing a normal song.


You can make a 20 kHz tone; however, because of the sampling you'll get a "beat" to the tone. The tone will progressively get louder and softer every so often. Like when instruments are slightly out of tune.
Last edited by OmnipotentEntity on Thu Jul 05, 2007 4:26 pm UTC, edited 1 time in total.
Build a man a fire and warm him for a day,
Set a man on fire and warm him for the rest of his life.

aguacate
Posts: 209
Joined: Fri Feb 16, 2007 10:29 pm UTC

Postby aguacate » Thu Jul 05, 2007 4:26 pm UTC

When you convert an analog signal to a digital signal you must sample the analog source. That's means that every so often you take a peek at where the analog wave is at and record that number. This is sort of like a strobe light in a pitch black room. If the light flashes really slow you can't tell what's going on between the flashes, but if you crank up the frequency of the flashes (that is, the sampling frequency - the 44.1KHz you mentioned) then it's easy to tell what's happening in the room. Even if there are gaps, your mind can fill in the rest. Now, you can imagine cranking up the frequency so high that it doesn't even look like a strobe light anymore. This is when your sampling frequency is higher than your perception.

Imagine someone is standing in front of the strobe light. They are waving their hand. They can either wave their hand really fast or really slow. Let's say the strobe light is flashing at a low frequency. When they wave their hand it looks smooth if they do it real slow, but if they wave fast, it looks choppy. Now increase the strobe light frequency to very high. Now if they move their hand fast or slow it doesn't matter - it looks smooth either way.


My question: How much higher above the signal frequency does the sample frequency need to be to preserve its wave characteristic? (note: I remember learning that at high frequencies we don't really perceive the wave characteristic anyway). Also, if you have a wave at the nyquist frequency, its phase needs to line up perfectly with the sampler, otherwise you will get a different amplitude. Does this affect the quality of recordings at 44.1KHz?
Image

User avatar
el sjaako
Posts: 45
Joined: Sun Feb 11, 2007 3:52 pm UTC
Location: Netherlands
Contact:

Postby el sjaako » Thu Jul 05, 2007 4:27 pm UTC

evilbeanfiend wrote:a little below we might have

1,-0.9,0.8,-0.7,0.6 etc.


My first thought when seeing that was "won't it just sound like a nyquist frequency signal combined with a 1/10th nyquest frequency signal" but then I figured out it wouldn't. So there is one answer I was looking for

aoamla, that's interesting. So in theory (doubtful in practise) there are aqtually sounds that would sound better at 96 kHz then 44.1. Very interesting...

pete, I looked around wikipedia (a little) but couln't find what I meant

evilbeanfiend, my problem was more that I couln't understand how the two could be different (at frequencies > .25 the sample frequency)

gmalivuk, don't worry, I'll be worrying about my playing for a long time before sound quality (at this level) will become of any importance at all. It was pure scientific curiosity.

edit:aguacate
Yes, I know how it works, but I was wondering why 44.1 kHz was a high enoug frequency. Now I do.

You can't hear the wave properties at such high frequencies because the properties are basicly the harmonics (even higher frequencies) that coincide with the lowest frequency wave. I think.

One way to make sure you get the nyquest frequencies properly is to record at a higher frequency and then let intelligent software convert it. That's one of the reasons why, even if you can't really hear the difference, it's smart to record at a higher sample rate.

User avatar
djn
Posts: 610
Joined: Mon May 07, 2007 1:33 pm UTC
Location: Oslo, Norway

Postby djn » Thu Jul 05, 2007 4:43 pm UTC

aguacate wrote:
Also, if you have a wave at the nyquist frequency, its phase needs to line up perfectly with the sampler, otherwise you will get a different amplitude. Does this affect the quality of recordings at 44.1KHz?



Not really. First of all, even if the 22.05KHz waves were left in, they would be inaudible to close to everybody. (Higher frequencies could give audible aliasing, though).
However, there are filters in the recording process that block frequencies above 20KHz. They have a bit of a slope, thus the extra headroom of 44.1 instead of 40 KHz.

User avatar
adlaiff6
Posts: 274
Joined: Fri Nov 10, 2006 6:08 am UTC
Location: Wouldn't you rather know how fast I'm going?
Contact:

Postby adlaiff6 » Fri Jul 06, 2007 8:16 am UTC

gmalivuk wrote:The thing is, you don't really need to worry much about 20kHz sounds when making the average CD. While we can hear sounds that high, they're perceived as much quieter than more midrange sounds, so would generally be irrelevant when you're recording and playing a normal song.

Actually, the highest frequencies are what help recreate the realism of things with the most complex of waveforms. This is why cymbals sound so shitty in digital audio. Sure, the tone is there, but they just don't "crash" the same way.
3.14159265... wrote:What about quantization? we DO live in a integer world?

crp wrote:oh, i thought you meant the entire funtion was f(n) = (-1)^n
i's like girls u crazy


Return to “Mathematics”

Who is online

Users browsing this forum: No registered users and 10 guests