johnwasser:
What is the (simulated) sample rate in Hz? In order to get 100 Hz to be in Bin 100 you have to have sampleRate == sampleCount.100 * sampleRate (Hz) / sampleCount = 100 (Hz)
This is the code I used to generate sine wave data:
for (int i = 0 ; i < 512 ; i += 2) { // save 256 samples
k = 127*sin(2*3.14 * 100 * t );
t++;
fft_input[i] = k; // put real data into even bins
fft_input[i+1] = 0; // set odd bins to 0
}
I have 256 samples = sampleCount; I have no idea what the simulated sampling rate is. How can I find out? I thought all I need was to filled up the array with numbers. Please help!
If I change " k = 127sin(23.14 * 100 * t ) " to "k = 127sin(23.14 * 100 * 256 * t )" would that make a difference?
I thought I understood a little about this stuff. Now I'm really confused.
Thank you