LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency measurement

I wanna measure sinewave frequency which is  acquired  from soundcard using AmpPhaseSpectrum() .
But the resolution is +/-50,eg.the input frequency is 920Hz,the measurement is 900Hz.
The belowing is the part of my rountine.
Tempdata[] is the data acquired from soundcard,len is the length.
 
Can you help check?Or is there other solution to measure?
Thanks
 
 for(i = 0;i < len ;i++)
 {
  Tempdata[i] = tem[i];
 }
 status = AmpPhaseSpectrum(Tempdata,len,DISABLE_OPTION,interval/(double)len,amp,phase,&df_Amp);
 for(i = 2; i<(len/2);i++)
 {
  if(amp[i] > amp[j])
  {
   j=i;
  }
 }
 SetCtrlVal(PANEL,PANEL_FRETESTED,(double)(j*df_Amp/2));   //Display the frequency输入频率

0 Kudos
Message 1 of 1
(3,048 Views)