I\'ve got this code, but it keeps returning random frequencies from 0 to about 1050. Please can you help me understand why this is happening.
My data length is 1024, sam
It seems iSignal[1025]..iSignal[8191] contain random data. You could try to set it to 0. But why do you pass 8192 to fft() if your data length is 1024 (or is it 1025)?
Also, you loose some precision in the integer division. Change it to double pitchF = pitch / (8192.0/1024);
Does your fft function expect real or complex input data? In case it expects complex data, you have to set every other entry of iSignal to 0.