Other Parts Discussed in Thread: C2000WARE, TIDM-THREEPHASEMETER-F67641, CD4040B
We want to accurately calculate the harmonics in the grid voltage up to 9th harmonic. The sampling is being done at a fixed rate of 16KHz i.e. the rate at which PWMs frequency is set. At exactly 50 Hz this will result is 320 sample points. Similarly at 60Hz it will result in approx. 267 samples. Furthermore since the grid frequency can vary so the number of sample points per cycle can vary. I am totally clue less about a good solution to this problem as the FFT libraries compute on the samples that are 2^N only. The sampled signal segment must contain a whole number of periods. I understand if FFT is computed on incomplete cycle (for e.g. 256/320=0.8 portion of 50Hz cycle or 512/320=1.6 portion of 50Hz cycle) then this results in a lot of other harmonics in the result and incorrect results. Please guide about how to proceed about this.