The first non-zero frequency is at sigfft(2) not sigfft(1) -- you have to shift the left-hand side frequencies by one bin to the right, sigfft(1+i*200)
Likewise, suppose for a moment that the harmonics were 1 Hz apart starting from 1 Hz. Your code would use sigfft(44100-i*1) which would be sigfft(44099). The last bin though, corresponds to the first non-zero point, so you should be using sigfft(44100+1-i*200)
You now need to take in to account that because the first bin is occupied by the constant power (like the DC frequency 0 Hz) but the last bin does not include that, then if you have an even number of bins to start, and you proceed far enough with the harmonics, you may find that bin 22051 corresponds to both an harmonic "starting from the front" and a harmonic "starting from the back". You need to work out whether that means that a special value should be put in to that location.
0 Comments
Sign in to comment.