Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate Frequency using PeakDetector class

Hi, I am want to ploat a graph b/w magnitude and frequency. I have a voltage singnal of 100 samples by which I have calculated magnitudes (array of same size) and frequency using detect method of peak detector class. But the problem here is I need the frequency array of same size so that I can plot the graph.

 

Using peak detector method I got 10 peaks in almost equal different positions so I first calculated the period by substracting the two consecutive peak positions as below:

 

PeakDetector peakDetect = new PeakDetector(0);

 

// Detection and Plotting of Peaks

peakDetect.Detect(waveform, true, out amplitudesPeak, out locationsPeak, out secondDerivativesPeak);

double freq = 1000 * (1.0 / (double)(locationsPeak[1] - locationsPeak[0]));

 

But I need an array of frequency of size 100 so that I can plot magnitudes and frequency.

 

Any help regarding the same will be highly apprecialted.

 

Regards,

Bipul Dobhal

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