kissfft

Element-wise multiplication results between 2D arrays in KISSFFT are different than SciPy FFT

时光毁灭记忆、已成空白 提交于 2020-06-22 04:24:04
问题 I'm experimenting with KISSFFT in C++ after being discouraged to use FFTPACK to process 2D arrays. I wrote an element-wise multiplication function to multiply two 2D arrays after they've been transformed with kiss_fftnd() . The result of the multiplication is then transformed back with the inverse FFT function. Unfortunately, the results I get from kissfft in C are different from what I get with SciPy in python as you can see in the image below: To test the multiplication function, after the

KissFFT output of kiss_fftr

依然范特西╮ 提交于 2019-12-23 05:24:13
问题 I'm receiving PCM data trough socket connection in packets containing 320 samples. Sample rate of sound is 8000 samples per second. I am doing with it something like this: int size = 160 * 2;//160; int isinverse = 1; kiss_fft_scalar zero; memset(&zero,0,sizeof(zero)); kiss_fft_cpx fft_in[size]; kiss_fft_cpx fft_out[size]; kiss_fft_cpx fft_reconstructed[size]; kiss_fftr_cfg fft = kiss_fftr_alloc(size*2 ,0 ,0,0); kiss_fftr_cfg ifft = kiss_fftr_alloc(size*2,isinverse,0,0); for (int i = 0; i <

KissFFT forward / inverse is outputting noise, why?

两盒软妹~` 提交于 2019-12-14 04:17:08
问题 I'm trying to use KissFFT natively in a java app, but the forward/inverse of an input signal isn't returning as it should: the signal amplitude is almost non-existent. If I remove the scaling factor (dividing by 2N), the result is harmonic noise. Can anyone spot the bug? Here is the forward call (copied from GDX, so should be ok!): JNIEXPORT void JNICALL Java_com_badlogic_gdx_audio_analysis_KissFFT_spectrum(JNIEnv* env, jclass clazz, jlong handle, jshortArray obj_samples, jfloatArray obj

Giving large no of samples to KissFFT

故事扮演 提交于 2019-12-13 07:31:26
问题 I wanted to find the 4096 point DFT of an audio signal of duration 10 seconds with sampling rate 44100 Hz. Hence there are 441000 input samples. But KissFFT takes only up to 4096 as input size. How to go about finding FFT of such a large signal? 回答1: The power spectrum of most real-world audio signals (speech, music, etc) is time-varying, so typically you calculate a series of short-term FFTs using overlapping windows, to produce a sequence of power spectra, aka a spectrogram . I suggest

How do I get most accurate audio frequency data possible from real time FFT on Tizen?

帅比萌擦擦* 提交于 2019-12-11 20:40:48
问题 currently i m working on the Tizen IDE. I had read the input data from the microPhone and apply the FFT on it... but everytime i gets the nan output. here is my code.. ShortBuffer *pBuffer1 = pData->AsShortBufferN(); fft = new KissFFT(BUFFER_SIZE); std::vector<short> input(pBuffer1->GetPointer(), pBuffer1->GetPointer() + BUFFER_SIZE); // this contains audio data std::vector<float> specturm(BUFFER_SIZE); fft->spectrum(input, specturm); applying FFT.. void KissFFT::spectrum(KissFFTO* fft, std:

Kiss FFT on a dsPIC33

与世无争的帅哥 提交于 2019-12-11 16:34:56
问题 I have been trying to get KissFFT to work on a dsPIC, however after trying various different ways, the output is not what it should be. I was hoping to get some help to see if there are any configurations that I may be overlooking or if its just somthing i haven't thought of? I am using a dsPIC33EP256MC202 with the XC16 compiler within MPLABX. Declarations and memory assignment. int readings[3] = {0, 0, 0}; kiss_fft_scalar zero; memset(&zero,0,sizeof(zero)); int size = 128 * 2; float fin[256]

KissFFT (kiss_fftr to kiss_fftri) - How to reconstruct the original signal?

半世苍凉 提交于 2019-12-10 19:23:52
问题 I'm having some trouble understanding how to use KissFFT (1.2.9) correctly. All I am trying to achieve for now is to perform an FFT and then immediately perform an iFFT to reconstruct the original signal again. The code snippet below demonstrates what I'm doing: void test(short* timeDomainData, int length) { // Create the configurations for FFT and iFFT... kiss_fftr_cfg fftConfiguration = kiss_fftr_alloc( length, 0, NULL, NULL ); kiss_fftr_cfg ifftConfiguration = kiss_fftr_alloc( length, 1,

KISS FFT output with or without windowing

孤街醉人 提交于 2019-12-10 15:50:31
问题 I am currently trying to implement fft into avr32 micro controllers for signal processing purposes using kiss fft. And having a strange problem with my output. Basically, I am passing ADC samples (testing with function generator) into fft (real input, 256 n size) and retrieved output makes sense to me. However, if I apply Hamming window to ADC samples and then pass these to FFT, the frequency bin of the peak magnitude is wrong (and different from previous result without windowing). ADC

How can i calculate the peak using kissFFT?

时光毁灭记忆、已成空白 提交于 2019-12-10 11:44:59
问题 I want to apply FFT on the real audio device and calculate the peak from it here is my code.. N=8192 kiss_fft_cpx out[N/2 +1]; int len = fft->N / 2 + 1; kiss_fft_scalar* samples = &samples2[0]; //inputs from the mic kiss_fftr(fft->config, samples, out); for (int i = 0; i < len; i++) { float re = scale(out[i].r) * N; float im = scale(out[i].i) * N; if (i > 0) spectrum[i] = sqrtf(re * re + im * im) / (N / 2); else spectrum[i] = sqrtf(re * re + im * im) / N; } Now i calculate the pick using code

Applying Kiss FFT on audio samples and getting NaN output?

天涯浪子 提交于 2019-12-09 05:40:47
问题 The title explains my problem. What I am trying to do is quite simple: Load MP3 track (via libmpg123) Read samples Apply Kiss FFT on the samples What I have tried so far inline float scale(kiss_fft_scalar val) { int g = 0; return val < 0 ? val*(1/32768.0f ) : val*(1/32767.0f); } void main() { mpg123_handle *m = NULL; int channels = 0, encoding = 0; long rate = 0; int err = MPG123_OK; err = mpg123_init(); m = mpg123_new(NULL, &err); mpg123_open(m, "L:\\audio-io\\audio-analysis\\samples\\zero