Not quite a Qwt problem, but I'm really hoping someone can help me out here.
I have a frequency spectrum display and it is working except the center of the display is offset from the center frequency from the sound card.
A friend said just shift the spectrum bins relative to the display. I have tried many ways to do this and not succeeded.

The curve is set up like this, where x and y data are pointers to the fft output:
Qt Code:
  1. for (i = 0; i < nFrames_; ++i)
  2. {
  3. xData_[i] = ((xScale * i / (nFrames - 40)) * -1);
  4. }
  5.  
  6. // Reset curve data for new length.
  7. for (i = 0; i < nSignals_; ++i)
  8. {
  9. curves_[i]->setRawSamples(xData_, yData_[i], nFrames_);
  10. }
To copy to clipboard, switch view to plain text mode 

and the plotting is done:
Qt Code:
  1. for (unsigned int i = 0; i < nSignals_; i++)
  2. {
  3. memcpy(yData_[i], data[i], nFrames_ * sizeof(double));
  4. }
To copy to clipboard, switch view to plain text mode 

nSignals is always = 1 since it is a single plot. nFrames value depends on the sample rate set for the sound card.

I'm completely stumped as to how to shift the data so the received frequency is centered in the display.
Any help would be greatly appreciated.