Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Spectrum analyzer

  1. Aug 7, 2003 #1
    I tried to obtain the spectrum of a discrete signal and I had some problems...
    If I compute on a PC the discrete fourier transform (FFT or DFT) I obtain valid fourier transforms (the same Excel computes...)...
    ...but how do I analyze a wave obtained using a microphone ? I don't get the same results professional programs do...I tried using as the "intensity" of a frequency the magnitude...I tried using the real component...the complex one...but still no good...
    Can you help ?
     
  2. jcsd
  3. Aug 8, 2003 #2
    so you have a signal recorded by the computer with a microphone and you want to make the FFT?
    is the microphone stereo?
     
  4. Aug 8, 2003 #3
    I obtained the FFT...but the spectrum doesn't look like the one obtained with a proffesiona program...
    I applied the FFT algorithm to a chunk of 1024 samples...I found somewhere on the web that I shoul take a small chunk and duplicate it several time to obtain a periodic signal...and then compute the FFT...can you explain in detail how to process tha signal obtained with the microphone ? (it doesn't really matter if the signal is stereo...)
     
  5. Aug 8, 2003 #4
    if the microphone it's stereo, the left and right channels are mixed in the file format. When I was studying voice compression in college all the microphones on the lab were mono. The teacher said that for stereo the chanels must be separated first...

    well I'm not an expert but here goes... take a number of samples that's a power of 2 (that makes the FFT easier to compute). Multiply that with a window signal (this is optional, but depending on which window signal you use it enhances the spectrum). Make the FFT...
     
  6. Aug 8, 2003 #5
    Let's say...128 samples...multiplied by 8...gives 1024...apply FFT to this...and the spectrum consists in the magnitudes of the complex values of the FFT ?
     
  7. Aug 8, 2003 #6
    well, basically yes
    I'll try to find the link to a good DSP book if you want more info about FFT...
     
  8. Aug 8, 2003 #7
    Okay...thx...
     
  9. Aug 9, 2003 #8

    Integral

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    It is not clear to me what you mean by "does not look like". This is an easy thing to test, feed in a single frequency, you should see a single peak. Perhaps you could use Excell to generate a digital waveform of known content, then process the data with your program, It is very easy to make samll coding errors which give totally bogus results. A good habit is to test such software with a well know input.
     
  10. Aug 9, 2003 #9

    Integral

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    As I recall it is powers of 2 data points that make the FFT possible, so it is not nice but necessary.
     
  11. Aug 10, 2003 #10
    I tried that thing with Excel...and it's the same...but I didn't obtain the same spectrum sound analysis programs give...got it ?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?