Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

OpenCV dft audio getting spectrogram

$
0
0
I have a audio sequence that was captured with my microphone. This sequence is represented in a cv::Mat object with 1 row and n columns, where n represents the number of samples (=length) of my audio file. I want to get the frequency spectrogram using [Discrete Fourier Transform](http://docs.opencv.org/2.4/modules/core/doc/operations_on_arrays.html#dft) in OpenCV. I tried to make some example codes work, but I do not get the image I want to get. **Edit** This is the input image (the sound visualized as Mat for OpenCV): ![image description](/upfiles/14572184461912749.jpg) I read each 20 samples (20 pixels in x-direction) and multiply it with a hanning-window-function. Than I do the discrete fourier transform (dft) and get for each 20-sample-window the dft's result: e.g.: ![image description](/upfiles/14572186044999777.jpg). How can I get by multiple of theses images a spectrogram? Thanks!

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>