FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Physics » Acoustics
how your ears work
Post new topic   Reply to topic Page 2 of 6 [82 Posts] View previous topic :: View next topic
Goto page:  Previous  1, 2, 3, 4, 5, 6 Next
Author Message
stickyfox@gmail.com
science forum beginner


Joined: 23 Oct 2005
Posts: 10

PostPosted: Wed Oct 26, 2005 8:22 pm    Post subject: Re: how your ears work Reply with quote

I believe the document I linked earlier explains why taking away one
set of receptors does not eliminate a single band of frequencies. It
also explains how the model predicts a number of auditory phenomena
that have been demonstrated in listening experiments, and which are
simple enough for you to try yourself. It has been a few months since I
looked at it.

I guess my earlier post suggests that "this cell is for G sharp, and
this one is for D flat, and so on," but I don't think this is the case.
The audible spectrum is sort of "folded" by the structure of the
cochlea, and it still requires a brain to turn nerve stimuli into a
perception of sound. Missing one or two key points in the math can lead
to an assumption that if you took away all the cells in one region, a
range of frequencies would be eliminated. IIRC, though, eliminating a
few cells would leave a "gap" in the band of stimuli produced by one
particular frequency, which the brain would fill in. Some frequencies
wouldn't be affected at all. You could only eliminate all perception
above a particular frequency, and only by destroying a fairly large
region of cells. In such a case it would be difficult to argue which
damage resulted in which hearing loss.

If you could link us to the studies you're referring to, I'd really be
interested in reading them.
Back to top
J Ketutsalo
science forum beginner


Joined: 26 Oct 2005
Posts: 6

PostPosted: Wed Oct 26, 2005 9:22 pm    Post subject: Re: how your ears work Reply with quote

Chel van Gennip wrote:
Quote:

Well, I think we can be sure the brain is not interpreting signals at a
25us level. So there must be at least one, maybe more mappings from sound
patterns before perception. The first mapping has to be at the mechanical
level, as the speed of nerve cells is not in the us range.

I wouldn't call it a mapping, but the transformation of the mechanical
movement to neural impulses in the cochlea does this sort of a thing. It
is a fact that different frequencies excite the basilar membrane (in
cochlea) at different positions. However the tuning is not very sharp,
so a single sinusoidal does always cause a range of neurons to fire. The
neurons can fire at most about every 1 ms, so the neural data going to
the brain is limited to roughly < 1 kHz at the lowest level.

Quote:
There are some indications that one of the mappings is frequency related:
e.g. the sensitivity band of the ear and the changes when people get
older, and the existence of "band deafness".

There are several areas on the pathway from the auditory nerve to the
cortex where the sound is being processed. Many but not all are
tonotopically mapped (from lower to higher frequencies or the other way
around). However, these mappings do not necessarily mean that low
frequency neurons are firing less frequently at higher levels in the
brain. The mappings can also change somewhat and they have indeed been
shown to change due to, for example, hearing damage.

What is this conversation doing in the piano and synth groups?
Back to top
S.O.D.D.I.
science forum beginner


Joined: 19 Aug 2005
Posts: 6

PostPosted: Wed Oct 26, 2005 10:05 pm    Post subject: Re: how your ears work Reply with quote

J Ketutsalo wrote:
Quote:
What is this conversation doing in the piano and synth groups?

I dunno about the piano group, but sound perception (and anomalies) are
very interesting to this synthesist.
Back to top
maestro@ultrapiano.com
science forum Guru Wannabe


Joined: 23 Oct 2005
Posts: 145

PostPosted: Thu Oct 27, 2005 12:45 am    Post subject: Re: how your ears work Reply with quote

S.O.D.D.I. wrote:
Quote:
J Ketutsalo wrote:
What is this conversation doing in the piano and synth groups?

I dunno about the piano group, but sound perception (and anomalies) are
very interesting to this synthesist.

It was something to do with the statement about 25ths of seconds in the
thread "special effects from pianos":

http://groups.google.co.uk/group/rec.music.compose/msg/4f965c3c2b89ae5?hl=en

"On a normal piano, the maximum repeat rate of an individual note is
about ten per second, but If a piano note could be repeated at the rate
of about 25 notes per second, the result would be a single continuous
tone."

Did you know that if you split up a sound into 25ths of a second and
then play each 25th of a second backwards consecutively, it sounds the
same as the original? (other from any clickiness caused by the joins).


It occurred to me that that might from the basis for a DSP data
compression algorithm - if you play each 25th of a second forwards and
backwards at the same time, the resultant signal is symmetrical, so you
only need to store half the signal! Isn't it amazing what clever ears
we have - no matter what is fed into them, forwards, backwards
inside-out or upside-down, our brains can always make some sense of it!
- or is that because we are basically stupid?
Back to top
Matthew Fields
science forum Guru Wannabe


Joined: 26 Oct 2005
Posts: 200

PostPosted: Thu Oct 27, 2005 1:37 am    Post subject: Re: how your ears work Reply with quote

In article <1130373939.164331.24050@g14g2000cwa.googlegroups.com>,
<StpNrrs@aol.com> wrote:
Quote:
S.O.D.D.I. wrote:
J Ketutsalo wrote:
What is this conversation doing in the piano and synth groups?

I dunno about the piano group, but sound perception (and anomalies) are
very interesting to this synthesist.

It was something to do with the statement about 25ths of seconds in the
thread "special effects from pianos":

http://groups.google.co.uk/group/rec.music.compose/msg/4f965c3c2b89ae5?hl=en

"On a normal piano, the maximum repeat rate of an individual note is
about ten per second, but If a piano note could be repeated at the rate
of about 25 notes per second, the result would be a single continuous
tone."

Did you know that if you split up a sound into 25ths of a second and
then play each 25th of a second backwards consecutively, it sounds the
same as the original? (other from any clickiness caused by the joins).


It occurred to me that that might from the basis for a DSP data
compression algorithm - if you play each 25th of a second forwards and
backwards at the same time, the resultant signal is symmetrical, so you
only need to store half the signal! Isn't it amazing what clever ears
we have - no matter what is fed into them, forwards, backwards
inside-out or upside-down, our brains can always make some sense of it!
- or is that because we are basically stupid?

This is already built into MP3. What's more interesting is that back
in the dark ages of computers, a fellow called Iannis Xenakis proposed
making entirely new sounds by splicing together segments of roughly
this length, and then another much younger fellow (about my age) by
the name of Xavier Serra realized that by taking segments this length
and overlapping them... or taking similar but overlapping segments of
an original sound and reducing the amount of overlap, he could speed
up or slow down a sound without changing its pitch. He quickly
discovered the use of something called Hamming's Window which
eliminated most of the white noise of the splicing clicks. These
algorithms were widely published and are built into many DSP systems
today, including many you may be familiar with.



--
Matthew H. Fields http://www.umich.edu/~fields
Music: Splendor in Sound
To be great, do better and better. Don't wait for talent: no such thing.
Brights have a naturalistic world-view. http://www.the-brights.net/
Back to top
HellPope Huey
science forum beginner


Joined: 27 Oct 2005
Posts: 2

PostPosted: Thu Oct 27, 2005 2:21 am    Post subject: Re: how your ears work Reply with quote

J Ketutsalo wrote:

Quote:
What is this conversation doing in the piano and synth groups?

Reminding you that damage from continued exposure to high sound levels
can leave you unable to hear that high-pitched whine if your starter
goes out, never mind a third or more of the range of your music. Turn it
down, you rap punks.

--

HellPope Huey
Jerry Falwell is made of 80% hog jowels
and 20% Teflon.

A deluge of words and a drop of sense
~Thomas Fuller, "Gnomologia"

Now your car can smell like a two bit ho'
when you're getting screwed at the pump.
~Rev. Beergoggles

Fresh sonic Huey vittles @:
http://www.beat-factory.net/hellpope/
Back to top
maestro@ultrapiano.com
science forum Guru Wannabe


Joined: 23 Oct 2005
Posts: 145

PostPosted: Thu Oct 27, 2005 2:30 am    Post subject: Re: how your ears work Reply with quote

MP3 and Hamming windows compression are mostly related to spectral
analysis of sound into its component frequencies and then doing clever
mathematical transformations of the results. My simple approach of
playing each 25th of a second backwards and forwards at the same time
requires hardly any processing, other than the de-clicking. The clicks
are quite predictable and easy to understand, so they can quite easily
be eliminated - by readjusting the zero at each splice, for example, or
selecting a convenient splice point. The clicks aren't white noise,
they are caused by the loudspeaker cone attempting to move or change
direction too quickly for its design specifications - some
digitally-generated clicks are actually miniature 'sonic booms' caused
by the loudspeaker diaphragm moving faster than the speed of sound! (If
the the maximum distance that it can move is 1/4", if consecutive
samples are the max and min values, at 40KHz sampling rate the speed is
10,000"/sec).

What the original "how your ears work" (
http://ultrapiano.com/manufacturers/EarPage.jpg ) is getting at is that
the ear and brain do not perform spectral analysis of sound at all!
What instead happens is that patterns of pressure variations are
recognised while they are on the aural nerve. From this simple
information we recognise human speech and can distinguish between words
and understand its emotional content. Musicians can train their ears
to hear spectral components in a musical sound, but many natural sounds
are very complicated things consisting mostly of transients, with
hardly any meaningful frequency information. Even the loudness of a
sound depends entirely on its context - a soft noise can sound
remarkably loud in the context of silence, and MP3 compression makes
use of this - it's similar to the old Dolby system on analogue
recordings that reduces background hiss during quiet passages.


Matthew Fields wrote:
Quote:
In article <1130373939.164331.24050@g14g2000cwa.googlegroups.com>,
StpNrrs@aol.com> wrote:
S.O.D.D.I. wrote:
J Ketutsalo wrote:
What is this conversation doing in the piano and synth groups?

I dunno about the piano group, but sound perception (and anomalies) are
very interesting to this synthesist.

It was something to do with the statement about 25ths of seconds in the
thread "special effects from pianos":

http://groups.google.co.uk/group/rec.music.compose/msg/4f965c3c2b89ae5?hl=en

"On a normal piano, the maximum repeat rate of an individual note is
about ten per second, but If a piano note could be repeated at the rate
of about 25 notes per second, the result would be a single continuous
tone."

Did you know that if you split up a sound into 25ths of a second and
then play each 25th of a second backwards consecutively, it sounds the
same as the original? (other from any clickiness caused by the joins).


It occurred to me that that might from the basis for a DSP data
compression algorithm - if you play each 25th of a second forwards and
backwards at the same time, the resultant signal is symmetrical, so you
only need to store half the signal! Isn't it amazing what clever ears
we have - no matter what is fed into them, forwards, backwards
inside-out or upside-down, our brains can always make some sense of it!
- or is that because we are basically stupid?

This is already built into MP3. What's more interesting is that back
in the dark ages of computers, a fellow called Iannis Xenakis proposed
making entirely new sounds by splicing together segments of roughly
this length, and then another much younger fellow (about my age) by
the name of Xavier Serra realized that by taking segments this length
and overlapping them... or taking similar but overlapping segments of
an original sound and reducing the amount of overlap, he could speed
up or slow down a sound without changing its pitch. He quickly
discovered the use of something called Hamming's Window which
eliminated most of the white noise of the splicing clicks. These
algorithms were widely published and are built into many DSP systems
today, including many you may be familiar with.



--
Matthew H. Fields http://www.umich.edu/~fields
Music: Splendor in Sound
To be great, do better and better. Don't wait for talent: no such thing.
Brights have a naturalistic world-view. http://www.the-brights.net/
Back to top
Angelo Campanella
science forum Guru Wannabe


Joined: 08 May 2005
Posts: 226

PostPosted: Thu Oct 27, 2005 6:43 am    Post subject: Re: how your ears work Reply with quote

Matthew Fields wrote:
Quote:
High school physics barely prepares you for real acoustics much less
cellular dynamics.

I have the feeling that quantum physics is in the picture. That is, the
hair cells frequency response is limited to a certain increments that
are quantized. Another approach is that the "harmonicity" of note pairs
is limited by the speed at which the brain can process the incoming
nerve impulses emitted from the cochlea. When the two notes are close
enough together in frequency, their difference frequency will be
resolved, and the resulting perceived "beat" effect makes the sensation
unpleasant.

On that basins, "beats" or difference frequencies must be high enough
(e.g. 40 Hz or more) so as not to be perceived as modulations.

Now, the effect of pleasure seems to be evoked by particular note
frequency pairs whose ratio is expressed by small whole numbers.

I can't think beyond that point.

Angelo Campanella
Back to top
Matthew Fields
science forum Guru Wannabe


Joined: 26 Oct 2005
Posts: 200

PostPosted: Thu Oct 27, 2005 12:20 pm    Post subject: Re: how your ears work Reply with quote

In article <1130380248.543400.212740@g47g2000cwa.googlegroups.com>,
maestro@ultrapiano.com <StpNrrs@aol.com> wrote:
Quote:
MP3 and Hamming windows compression are mostly related to spectral
analysis of sound into its component frequencies and then doing clever
mathematical transformations of the results. My simple approach of
playing each 25th of a second backwards and forwards at the same time
requires hardly any processing, other than the de-clicking. The clicks
are quite predictable and easy to understand, so they can quite easily
be eliminated - by readjusting the zero at each splice, for example, or
selecting a convenient splice point. The clicks aren't white noise,
they are caused by the loudspeaker cone attempting to move or change
direction too quickly for its design specifications - some
digitally-generated clicks are actually miniature 'sonic booms' caused
by the loudspeaker diaphragm moving faster than the speed of sound! (If
the the maximum distance that it can move is 1/4", if consecutive
samples are the max and min values, at 40KHz sampling rate the speed is
10,000"/sec).

What the original "how your ears work" (
http://ultrapiano.com/manufacturers/EarPage.jpg ) is getting at is that
the ear and brain do not perform spectral analysis of sound at all!
What instead happens is that patterns of pressure variations are
recognised while they are on the aural nerve. From this simple
information we recognise human speech and can distinguish between words
and understand its emotional content. Musicians can train their ears
to hear spectral components in a musical sound, but many natural sounds
are very complicated things consisting mostly of transients, with
hardly any meaningful frequency information. Even the loudness of a
sound depends entirely on its context - a soft noise can sound
remarkably loud in the context of silence, and MP3 compression makes
use of this - it's similar to the old Dolby system on analogue
recordings that reduces background hiss during quiet passages.

A splice at a nonzero point in a waveform is white noise. It literally
has every frequency component in it. As does a single-sample spike
in the middle of silence.

This comes directly from the sampling theorem.

Yes, adjusting the edit point to the nearest zero-crossing will help
to eliminate noise. So will a Hamming window. Each takes a certain amount
of computing power, linear in the number of times it is applied. Try
'em both and see which one sounds best to you.


--
Matthew H. Fields http://www.umich.edu/~fields
Music: Splendor in Sound
To be great, do better and better. Don't wait for talent: no such thing.
Brights have a naturalistic world-view. http://www.the-brights.net/
Back to top
Matthew Fields
science forum Guru Wannabe


Joined: 26 Oct 2005
Posts: 200

PostPosted: Thu Oct 27, 2005 12:25 pm    Post subject: Re: how your ears work Reply with quote

In article <_F_7f.182763$qY1.76263@bgtnsc04-news.ops.worldnet.att.net>,
Angelo Campanella <a.campanella@att.net> wrote:
Quote:
Matthew Fields wrote:
High school physics barely prepares you for real acoustics much less
cellular dynamics.

I have the feeling that quantum physics is in the picture. That is, the

No. It's just as simple as that the cochlea is NOT a physical
Fourrier transform, with low frequencies sensed at one and and high
frequencies sensed at the other end. It's a long conch-shell-shaped
resonator full of feelers, and different frequency components will
stimulate parts in different patterns, but the interpretation to an
approximation of a Fourrier transform in brain cells happens in nerve
cells, mostly in the brain itself. The smallest actor worth
considering in the picture is still a nerve cell, something millions
of times bigger than a neurotransmitter molecule, and gazillions of
times larger than anything where quantum dynamics is an issue.

--
Matthew H. Fields http://www.umich.edu/~fields
Music: Splendor in Sound
To be great, do better and better. Don't wait for talent: no such thing.
Brights have a naturalistic world-view. http://www.the-brights.net/
Back to top
stickyfox@gmail.com
science forum beginner


Joined: 23 Oct 2005
Posts: 10

PostPosted: Thu Oct 27, 2005 1:53 pm    Post subject: Re: how your ears work Reply with quote

Transients are where it's at, frequency-wise. Have you ever looked at a
spectrogram of a sound audible to humans, and wondered why the majority
of the graph is dedicated to pitches above 1 kHz? Practically all of
the information that identifies a sound is near the top of our audible
spectrum, and it's the "kinks" in signals that carry this
high-frequency content.

If you chop up a sound into 1/25-sec pieces, and throw half of them
away, you won't lose any information at all, unless the original sound
has a fundamental frequency of less than 25 Hz. For most of us, that is
too low a frequency to hear, so few sounds of interest to us fit into
this category. Any high-frequency components that are present in the
first half of each "chunk" will also be present in the second half, so
it makes sense that you won't lose the "intelligence" of the signal by
doing this. And the savings of 50% is trivial if you compare it to
existing techniques that are less lossy and less proccessor-intensive.

Assuming that your chopping technique is perfect, and you eliminate any
transients due to the ends not matching up, you may not be able to hear
a difference, but this is not because it takes your brain 1/25 of a
second to identify a change in spectrum. It's because if you did
everything right, the spectrum never changed. The whole point of
Hamming and other sampling windows is to make it possible to chop up
signals into pieces and preserve their spectral content. It just puts
the distortion into phase changes or areas of the spectrum outside the
region of interest (which is usually outside our range of hearing when
it's audio signal processing).

Consider the difference in spectral content between 9 Beet Stretch and
Beethoven's 9th.

maestro@ultrapiano.com wrote:
Quote:
Musicians can train their ears
to hear spectral components in a musical sound, but many natural sounds
are very complicated things consisting mostly of transients, with
hardly any meaningful frequency information.
Back to top
Matthew Fields
science forum Guru Wannabe


Joined: 26 Oct 2005
Posts: 200

PostPosted: Thu Oct 27, 2005 2:21 pm    Post subject: Re: how your ears work Reply with quote

I'd be interested in how well this reversing 1/25s of a second works
for high unreverberated xylophone notes. I choose those because
almost-periodicity sets in almost immediately after the bars are struck,
and the amplitude tends to decay to inaudble within a single cycle--which
indicates just how sensitive our frequency-extrapolating mechanism is, but
it also means you may have much less than 1sec/25 to work with.


--
Matthew H. Fields http://www.umich.edu/~fields
Music: Splendor in Sound
To be great, do better and better. Don't wait for talent: no such thing.
Brights have a naturalistic world-view. http://www.the-brights.net/
Back to top
J Ketutsalo
science forum beginner


Joined: 26 Oct 2005
Posts: 6

PostPosted: Thu Oct 27, 2005 4:01 pm    Post subject: Re: how your ears work Reply with quote

stickyfox@gmail.com wrote:
Quote:
Transients are where it's at, frequency-wise. Have you ever looked at a
spectrogram of a sound audible to humans, and wondered why the majority
of the graph is dedicated to pitches above 1 kHz?

Yes, I have. And the reason is that such a spectrogram is easy to
compute, even if it doesn't correspond to human perception.

Quote:
Practically all of
the information that identifies a sound is near the top of our audible
spectrum, and it's the "kinks" in signals that carry this
high-frequency content.

No, it isn't. You can identify almost all sound through a telephone, and
the telephone bandwidth stops at a bit over 3 kHz. In fact, if you throw
away 3-20 kHz, you certainly lose some information but if you throw away
0-3 kHz, you lose most of the information. For example, you won't be
able to understand speech.

Quote:
If you chop up a sound into 1/25-sec pieces, and throw half of them
away, you won't lose any information at all, unless the original sound
has a fundamental frequency of less than 25 Hz.

Imagine a signal with an impulse that is, say, 1/1000 seconds long. It
will be very clearly audible. If you throw it away, you lose all the
information in the signal.
Back to top
maestro@ultrapiano.com
science forum Guru Wannabe


Joined: 23 Oct 2005
Posts: 145

PostPosted: Thu Oct 27, 2005 6:11 pm    Post subject: Re: how your ears work Reply with quote

What the original "how your ears work" (
http://ultrapiano.com/manufacturers/EarPage.jpg ) is getting at is that
the ear and brain do not perform spectral analysis of sound at all! The
hair cells are not tuned to specific frequencies, but simply transmit a
nerve impulse onto the aural nerve when they have been squashed by
pressure in the cochlea. Because of the large number of hair-cells
individually sending nerve impulses, patterns of impulses occur on the
aural nerve. These patterns of pressure variations are recognised by
the inner brain while they are on the aural nerve. From this simple
information we recognise human speech and can distinguish between words
and understand its emotional content.

Angelo Campanella wrote:
Quote:
Matthew Fields wrote:
High school physics barely prepares you for real acoustics much less
cellular dynamics.

I have the feeling that quantum physics is in the picture. That is, the
hair cells frequency response is limited to a certain increments that
are quantized. Another approach is that the "harmonicity" of note pairs
is limited by the speed at which the brain can process the incoming
nerve impulses emitted from the cochlea. When the two notes are close
enough together in frequency, their difference frequency will be
resolved, and the resulting perceived "beat" effect makes the sensation
unpleasant.

On that basins, "beats" or difference frequencies must be high enough
(e.g. 40 Hz or more) so as not to be perceived as modulations.

Now, the effect of pleasure seems to be evoked by particular note
frequency pairs whose ratio is expressed by small whole numbers.

I can't think beyond that point.

Angelo Campanella
Back to top
maestro@ultrapiano.com
science forum Guru Wannabe


Joined: 23 Oct 2005
Posts: 145

PostPosted: Thu Oct 27, 2005 6:25 pm    Post subject: Re: how your ears work Reply with quote

Here's a short program you can use to test .wav files (It's untidy and
badly written but it works! - the first chunk handles the .wav
formatting information and then it just reverses every 25th of a second
of the input file and puts it in the output file.


Matthew Fields wrote:

Quote:
I'd be interested in how well this reversing 1/25s of a second works
for high unreverberated xylophone notes. I choose those because
almost-periodicity sets in almost immediately after the bars are struck,
and the amplitude tends to decay to inaudble within a single cycle--which
indicates just how sensitive our frequency-extrapolating mechanism is, but
it also means you may have much less than 1sec/25 to work with.


--
Matthew H. Fields http://www.umich.edu/~fields
Music: Splendor in Sound
To be great, do better and better. Don't wait for talent: no such thing.
Brights have a naturalistic world-view. http://www.the-brights.net/

#include <io.h>
#include <stdio.h>

/*

main algorithm opens INfile
reads 25ths of seconds forwards,
writes backwards to OUTfile */



#define BUFFSIZE 1764 /* 25th of a second at the sampling rate of
INFile */

FILE *OUTfile, *INfile;
char ChunkID[4];
long LongInt;
short int ShortInt;
short int n, buffer[BUFFSIZE], bcount;


int main(int argc, char **argv)
{
if((INfile = fopen("C:\\sound\\wavs\\INmail.wav","rb"))==NULL) {
printf("failed to open file C:\\sound\\wavs\\INmail\n");
}
else printf("Input file C:\\sound\\wavs\\INmail.wav opened OK\n");

if((OUTfile = fopen("C:\\sound\\wavs\\OUTmail.wav","wb"))==NULL) {
printf("failed to open file C:\\sound\\wavs\\OUTmail.wav\n");
}
else printf("Output file C:\\sound\\wavs\\OUTmail.wav opened
OK\n");


n = fread(ChunkID, 4, 1, INfile); /* "RIFF" */
printf(" %c %c %c %c \n",
ChunkID[0],ChunkID[1],ChunkID[2],ChunkID[3]);
fwrite(ChunkID, 4, 1, OUTfile);

n = fread(&LongInt, 4, 1, INfile); /* Total INfile size (-4) */
printf("Chunksize is %d\n", LongInt);
fwrite(&LongInt, 4, 1, OUTfile);

n = fread(ChunkID, 4, 1, INfile); /* "WAVE" */
printf(" %c %c %c %c \n",
ChunkID[0],ChunkID[1],ChunkID[2],ChunkID[3]);
fwrite(ChunkID, 4, 1, OUTfile);

n = fread(ChunkID, 4, 1, INfile); /* "fmt " */
printf(" %c %c %c %c \n",
ChunkID[0],ChunkID[1],ChunkID[2],ChunkID[3]);
fwrite(ChunkID, 4, 1, OUTfile);

n = fread(&LongInt, 4, 1, INfile); /* 16 */
printf("SubChunk1Size is %d\n", LongInt);
fwrite(&LongInt, 4, 1, OUTfile);

n = fread(&ShortInt, 2, 1, INfile); /* 1 */
printf("AudioFormat is %d\n", ShortInt);
fwrite(&ShortInt, 2, 1, OUTfile);

n = fread(&ShortInt, 2, 1, INfile); /* 1 Mono, 2 Stereo */
printf("NumChannels is %d\n", ShortInt);
fwrite(&ShortInt, 2, 1, OUTfile);

n = fread(&LongInt, 4, 1, INfile); /* sample rate */
printf("SampleRate is %d\n", LongInt);
fwrite(&LongInt, 4, 1, OUTfile);

n = fread(&LongInt, 4, 1, INfile); /* byte rate */
printf("ByteRate is %d\n", LongInt);
fwrite(&LongInt, 4, 1, OUTfile);

n = fread(&ShortInt, 2, 1, INfile); /* */
printf("BlockAlign is %d\n", ShortInt);
fwrite(&ShortInt, 2, 1, OUTfile);

n = fread(&ShortInt, 2, 1, INfile); /* */
printf("BitsPerSample is %d\n", ShortInt);
fwrite(&ShortInt, 2, 1, OUTfile);

n = fread(ChunkID, 4, 1, INfile); /* "data" */
printf(" %c %c %c %c\n",
ChunkID[0],ChunkID[1],ChunkID[2],ChunkID[3]);
fwrite(ChunkID, 4, 1, OUTfile);

n = fread(&LongInt, 4, 1, INfile); /* */
printf("SubChunk2Size is %d\n", LongInt);
fwrite(&LongInt, 4, 1, OUTfile);



bcount=0;

while (LongInt > 0)
{
LongInt--; LongInt--;
n = fread(&ShortInt, 2, 1, INfile);

buffer[bcount] = ShortInt;
bcount++;
if (bcount == BUFFSIZE) {
while (bcount > 0) {
bcount--;
ShortInt = buffer[BUFFSIZE-bcount];
fwrite(&ShortInt, 2, 1, OUTfile);
}
}
}

while (bcount)
{
fwrite(&ShortInt, 2, 1, OUTfile);
bcount--;
}

fclose(INfile); fclose(OUTfile);

return(0);
}
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 2 of 6 [82 Posts] Goto page:  Previous  1, 2, 3, 4, 5, 6 Next
View previous topic :: View next topic
The time now is Fri Jan 09, 2009 11:17 pm | All times are GMT
Forum index » Science and Technology » Physics » Acoustics
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Now let's put the work together gb6724 New Theories 13 Fri Jul 14, 2006 10:58 pm
No new posts USA and Canada open for work? gb6724 New Theories 1 Thu Jul 13, 2006 1:36 am
No new posts Using calculus with confidence. It re... RadicalLibertarian@hotmai Math 6 Mon Jul 10, 2006 4:59 am
No new posts Does standard Kalman filter work if e... Kenneth T. Onyee Math 0 Sat Jul 08, 2006 10:39 am
No new posts George "Big Oil" Bush KNOWS Bio Fuels... perryneheum@hotmail.com Chem 16 Sun Jul 02, 2006 4:51 pm

Health Insurance | Refinance | Free Credit Score | Debt Consolidation | Personal Loans
Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Electronics forum |  Medicine forum |  Unix/Linux blog |  Unix/Linux documentation |  Unix/Linux forums


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2508s ][ Queries: 16 (0.0360s) ][ GZIP on - Debug on ]