LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Envelope Detection with Peak Detector

Hi.

 

I have a data file which represents the frequency sweep from a device. I am trying to get the envelope of the signal to produce a frequency response curve. With the width of the peak detector set to 9 the envelope is accurate for the first half of the signal but dosn't seem to track the higher frequencies (by the way the frequencies only go from 5 - 200Hz). I tried using the absolute value of the signal and a peak detector width of 1 which made the higher frequencies slightly better but the lower ones bad. 

 

The Hilbert Transform which is advised to use for envelope detection in many places produces very noisy and inacurate results.

 

Is there a way I can get the peak detector to perform better at the higher frequencies??

 

Thanks,

 

Mark.

Download All
0 Kudos
Message 1 of 5
(4,059 Views)

Mark,

 

The problem is that your sampling rate is much too low to accurately find the high frequency peaks. The image below shows the last 100 ms of your data with the actual data points highlighted.

 

Data Sampling.png

 

As you can see there are only two or three points per cycle at the higher frequencies.

 

With the peak detector width set to 9 the data needs to have more than 9 points in each peak. So the sampling rate needs to be 15-20 times the highest frequency in your signal. For your stated fmax = 200 Hz that means a sampling rate >3-4 kHz.   Based on the data in the file it appears that the sampling rate is 500 Hz.

 

While your sampling meets the Nyquist rate, you also need to consider that you have very little data to work with - less than one complete cycle at each frequency. This means that many analysis routines such as Hilbert and the Peak Detector do not work very well.

 

Lynn

Message 2 of 5
(4,029 Views)

I wrote my own function that checks if the points are greater than the adjacent ones. I also added some filtering and curve fitting and it gives me the result i need. It works well for this data set anyway. 

Message 3 of 5
(3,994 Views)

I have not looked at your VI but consider the first two peaks in the image I posted earlier. The "real" peak is likely higher than either of the points near amplitude 0.05. The error may get worse as you go to higher frequencies. This is because the data samples may occur part way up the curve and not necessarily near the peak.

 

Without doing any analysis I cannot predict the size of the error. Fitting to the data samples may result in the signal appearing to be smaller than it really is.

 

Lynn

0 Kudos
Message 4 of 5
(3,972 Views)

Yea the actual peak is probably slightly higher. But for an envelope this is fine. I will also use curve fitting to make it nice and smooth. I will then do a curve compare with other tests, ie do they have the same envelope as apposed to absolute value. 

0 Kudos
Message 5 of 5
(3,955 Views)