Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
i am happy to say i finally understand how to read from microphone and get audio data, using portaudio (due to its multiplatform capability) and windows API functions.
Now i am doing this in C, i have read the audio in, and i have the data in an array.
What i want to do is perform FFT on the audio data (at real time, i am using FFTW) and plot the frequency and amplitude at real time.

I am not so sure how to do the real time FFT and plot it, (i am not so sure if any libraries exists for ploting in C). It would be great if you can help.

I know how to use FFTW, to perform simple 1d and 2d FFT, but how do you do it in real time with audio and plot it.
Posted

Hi there, there's an article around here on CP that crafts a windows media player plugin that does just this. The output is by way of 3d visualizations using directX,
I guess you'd just need to look at how it does the fft and then visualize it in a way that's appropriate - openGL, directX, windows DIBs, etc, etc.

Interactive 3D Spectrum Analyzer Visualization for Windows Media Player[^]
 
Share this answer
 
If you know how to do an FFT with FFTW, then you should know how to do it in real-time, all you have to do is collect a number of samples (fixed number) and continually evaluate the FFT after you collect an entire block. Every time you get a new array of output data from the FFT computation, you can plot that over the sampling frequency span (bound by the nyquist-shannon theorem).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900