OpenCV dft audio getting spectrogram

asked 2016-03-05 14:52:15 -0600

bingoblau gravatar image

updated 2016-03-05 16:57:52 -0600

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 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

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.

How can I get by multiple of theses images a spectrogram?

Thanks!

edit retag flag offensive close merge delete

Comments

You can read this post

LBerger gravatar imageLBerger ( 2016-03-06 04:03:35 -0600 )edit