05-28-2009 08:14 AM
Hi,
I've been trying to use the peak detector to determine the most present frequency in a frequency spectrum but I can't understant why there's a gap between the locations of the peaks that the peak detector returns and the actual peaks. Here is a picture that will make it clear :
Can you help me to fix it ? It'll be great to be able to use it...
Solved! Go to Solution.
05-28-2009 08:21 AM
05-28-2009 08:33 AM
here's the code, i'm not sure you'll understand everything, but anyway, I checked I was using the same df or dt when I create the waveform signal (by the way is it the same thing for labview?), so I don't really understand. I tried (in the "PIC+FFT" subVI) to synchronize the curves using coefficients, but it didn't work.
Peak finding area in my VI
"PIC+FFT" subVI shown upper
"Peak detector" code
05-28-2009 08:34 AM
This is an expected behaviour depending on the width input. Please read below extract from the help of Peak Detector.vi.
05-28-2009 08:44 AM
Using higher width obviously reduces the amplitude but doesn't change the location of the peaks, I just tried it, going up to 50 !
Have you got any other ideas ?
05-28-2009 11:07 AM
I have seen this before. And the problem is not the peak detector. It is a bug in your program. It looks like you do some timing operations on your signal like changing t0(this add some offset in time). If you forget to to the same on the peak locations the peaks will misplaced.
05-29-2009 04:17 AM
You were right, I was using a "wait" function in a while loop. Somehow, I don't really know why, it was causing a delay between the first and the second curve..., I deleted and it works now,
Thanks very much for the help !