PDA

View Full Version : How can I calculate the frequencies of a 44.1k wav file?


SA Dev
02-24-2004, 02:42 PM
I have signed integers (-32768..32767) and was wondering how one would go
about finding out what the frequencies are in a file like this. Do I have
to split it into specific time periods such as 1ms, 5ms, 50ms and can I run
a formula/algorithm to find out what the frequency of that chunk is?

Thanks,

SA Dev

Jim Thomas
02-24-2004, 03:24 PM
SA Dev wrote:
> I have signed integers (-32768..32767) and was wondering how one would go
> about finding out what the frequencies are in a file like this. Do I have
> to split it into specific time periods such as 1ms, 5ms, 50ms and can I run
> a formula/algorithm to find out what the frequency of that chunk is?
>

You're looking for the Discrete Fourier Transform (DFT) or the fast
version of it, the Fast Fourier Transform (FFT).

--
Jim Thomas Principal Applications Engineer Bittware, Inc
[email protected] http://www.bittware.com (703) 779-7770
Sometimes experience is the only teacher that works - Mike Rosing

Fred Marshall
02-25-2004, 07:04 AM
"SA Dev" <[email protected]> wrote in message
news:[email protected]...
> I have signed integers (-32768..32767) and was wondering how one would go
> about finding out what the frequencies are in a file like this. Do I have
> to split it into specific time periods such as 1ms, 5ms, 50ms and can I
run
> a formula/algorithm to find out what the frequency of that chunk is?

You want to compute the power spectral density.
The longer each temporal epoch, the better the frequency resolution.
The shorter each temporal epoch, the better the temporal resolution.
So, you need to choose an epoch length to suit your needs.
You can overlap if that makes sense to improve temporal resolution - I
guess.

Fred