# What frequencies are in an audio signal.

• July 23rd 2008, 11:34 PM
in2deep
What frequencies are in an audio signal.
I am working on a software platform for testing certain types of apparatus. Most of it is pretty straight forward. One of the data sources is an audio card. I can read this in the tester and end up with a vast number of data points representing the incoming signal sampled at whatever rate.

The existing test just checks to see if there is a signal present. It has worked well enough until now. However, my group has been asked to improve the test.

What we want to do is have the audio generator generate 2 or 3 known frequencies, and then test the samples to see if all the expected frequencies are there.

I've fiddled with some approaches that try to subtract sinusoids of the expected frequencies from the sample. My rationale is that if the input is 4kHz and 7kHz, if I subtract a 4kHz sine and 7kHz sine from the samples, I should end up with roughly nothing. I have phase and amplitude problems however, I can't control either in the generator, at least not sufficiently to make this work.

Is there an easy way to do this bearing in mind my mathematics is limited.
• July 24th 2008, 04:53 AM
TKHunny
If you MUST understand the mathematics, I think you are out of luck. You should be able to find some software that will deal with $Fourier Transforms$. Any worthwhile package on Signal Processing should be up to speed on it.
• July 24th 2008, 05:02 AM
CaptainBlack
Quote:

Originally Posted by in2deep
I am working on a software platform for testing certain types of apparatus. Most of it is pretty straight forward. One of the data sources is an audio card. I can read this in the tester and end up with a vast number of data points representing the incoming signal sampled at whatever rate.

The existing test just checks to see if there is a signal present. It has worked well enough until now. However, my group has been asked to improve the test.

What we want to do is have the audio generator generate 2 or 3 known frequencies, and then test the samples to see if all the expected frequencies are there.

I've fiddled with some approaches that try to subtract sinusoids of the expected frequencies from the sample. My rationale is that if the input is 4kHz and 7kHz, if I subtract a 4kHz sine and 7kHz sine from the samples, I should end up with roughly nothing. I have phase and amplitude problems however, I can't control either in the generator, at least not sufficiently to make this work.

Is there an easy way to do this bearing in mind my mathematics is limited.

You know the sample rate, that gives a Nyquist frequency of half the sample rate.

Take a sample say of 1024 points from your signal and take an FFT now take the square absolute value and discard the top half of the array of results.

Now you have the amplitudes at frequencies from 0Hz to the Nyquist frequency, 0 at the bottom of the array and the Nyquist at the top.

Examine the position of the peaks of this power spectrum, then will occur at the principle frequencies present if you fed in a signal that was the sum of a small number of sinusoids of arbitary phase. These should stick out like sore thumbs.

RonL