1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How calculate a single frequency of a multifrequency signal?

  1. Dec 2, 2014 #1
    I'm just coding a program where I've to calculate the individual frequencies inside an audio file *.wav file.
    The modulation is pcm and the information I've is a lots of points, like this:
    http://www.renesas.com/media/support/faqs/faq_results/Q1000000-Q9999999/samp_1.gif [Broken]

    To be exact, I've 44,000 samples per second.
    Well, the signals would look like this:
    220px-Analog_digital_series.svg.png
    It's not a constant tone, it's a combination of different frequencies.
    My question is how can I calculate, frequency by frequency its value in hertzs/second and how can I approach the problem.
     
    Last edited by a moderator: May 7, 2017
  2. jcsd
  3. Dec 3, 2014 #2

    f95toli

    User Avatar
    Science Advisor
    Gold Member

    You can't. At least not the way you describe it.

    To analyze the frequency spectra of a signal you use a discrete Fourier transform, usually using an FFT algorithm. This will tell you the frequency content of the signal.
    However, there is no such thing as instantaneous frequency; you always have to analyze the signal over some time which should be significantly longer than the period of the slowest frequency component you are interested in, for sound that is usually 20 Hz, so you need to analyze "slices" that are at least a few times 1/20 s long.

    Now, of course there are still many uses for tools that can show us how the frequency distribution changes over time. especially in music. The way to do this is to chop the signal into small portions (just long enough to get the frequency content) of the signal at a time; I guess you could divide the signal into chunks; but it would presumably be better to use a FIFO buffer of some suitable length.

    Also, Hz/s is not a useful unit; so I am not sure why you would use that (it is the same thing as 1/s^2, i..e per second square)
     
  4. Dec 3, 2014 #3
    I 've also read that Goertzel algorithm can be used too, but I don't know exactly for what pourpouse.
    You're right that almost in all cases people use FFT or DFT because it's the main tool that I see each time. But I don't fully understand what FFT is and how it works.
     
  5. Dec 4, 2014 #4

    f95toli

    User Avatar
    Science Advisor
    Gold Member

    FFT is just a clever way to calculate the discrete Fourier transform (DFT), it is by far the most common method, to the point where people just say "FFT" when they really mean DFT. FFT is often a built in function in software for numerical calculations, I believe even Excel has a FFT function.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook