Average values over samplesPerPixel numbers.įor (uint localSample = 0 localSample < samplesPerPixel localSample, sample) Uint samplesPerPixel = FFT_OUTPUT_SAMPLES / imgSizeY įor (uint y = 0, sample = 0 y < imgSizeY y) ![]() G_Plan = fftwf_plan_dft_r2c_1d(FFT_INPUT_SAMPLES, g_WindowedBuf, g_OutBuf, FFTW_ESTIMATE) īitmap = FreeImage_Allocate((int)imgSizeX, (int)imgSizeY, 24) įreeImage_Save(FIF_BMP, bitmap, "G:\\tmp\\Spectrogram.bmp") Static uint g_InBufPos = FFT_INPUT_SAMPLES/2 Static const uint FFT_OUTPUT_SAMPLES = (FFT_INPUT_SAMPLES / 2) 1 Static const uint FFT_INPUT_SAMPLES = 4096 To make a spectrum, one need to transform data from time domain to freqency domain, that is to perform the Fourier Transform. There are 44100 samples per second (this is the sampling frequency in Hz). Res = sound->readData(buf, BUF_SIZE,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |