LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency spectrum of analog voltage by continuous sampling

Hello,

 

I am trying to see the frequency spectrum of analog input signal by continuous sampling with input from a function generator.Somewhere i am not able to see the desired frequency spectrum.The VI screenshot is attached for information.capture1.JPG

 

0 Kudos
Message 1 of 9
(2,405 Views)

How does your waveform graph not match your expectation?

I can imagine that your are facing either breaking of Niquist or incorrect windowing.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 9
(2,389 Views)

Try replacing the DAQ code with a "Virtual" Waveform Generator (look in the Waveform Palette, and start with a sinusoid or sum of sines).

 

Bob Schor

0 Kudos
Message 3 of 9
(2,386 Views)

The freq of signal was taken as 500hz with 1000 hz as fs.Also window was kept as none in spectral measurements any suggestions on that!! Maybe if you suggest on the VI

0 Kudos
Message 4 of 9
(2,375 Views)

You didn't mention what you expected vs. what you see.

However, 500Hz signal with 1kHz sampling rate, you are at the a corner case of Niquist. Or in other words: If both clocks would run highly synchronized, you would get a DC signal. Yes: constant voltage. No frequency involved.

I expect the clocks to not run synchronuously. Which will result in any signal peak close to 0Hz or 500Hz with, using NO WINDOWS, in any random peak to compensate for "signal jumps" at the beginning vs. end of the signal.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 9
(2,369 Views)

Thanks but I expecting to see the frequency of the analog input signal which in my case is not happening.

0 Kudos
Message 6 of 9
(2,357 Views)

Mathematicians will tell you to sample at "at least" twice the highest frequency you expect to see in your signal to avoid "aliasing" (look up this term, you need to know what it means!).  Engineers, who are much more practical, will tell you to sample at least 10 times faster than the signals you want to see.  If your signal is 500 Hz, therefore, an engineer will tell you to sample at at least 5 kHz.  If you sample at 1 kHz, you will get two points per cycle, so if the signal is a pure sinusoid, you'll get (depending on precisely when you sample relative to the peaks of the sinusoid) two alternating values that can range from "max to min" of the sinusoid to "midpoint to midpoint" (or a DC signal).

 

Bob Schor

0 Kudos
Message 7 of 9
(2,347 Views)

@Bob_Schor wrote:

[...]  Engineers, who are much more practical, will tell you to sample at least 10 times faster than the signals you want to see.  If your signal is 500 Hz, therefore, an engineer will tell you to sample at at least 5 kHz.  [...]


Exactly this. To know the frequency, a sampling rate double the signal frequency is, mathematically, sufficient. But you will not see the shape (sine vs. triangle vs. square vs sawtooth vs arbitrary) with that rate. Thats why engineers recommend a 10 time oversampling.

And use a window to reduce the effect of "unaligned periods" at the beginning and ending of each packet.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 9
(2,337 Views)

A much bigger problem than Nyquist criteria is that the Spectral Measurements ExpressVI doesn't have a sample rate input, so it can't do the calculations*.

 

Change your DAQ function from 1D Dbl to Waveform (as well as the other stuff others have mentioned). A Double array is just a list of numbers. A Waveform contains that plus timing information.

 

*: Without a sample rate input, it may return values in some "time normalized" units, like cycles per sample, but it won't look like the FFT you're expecting to see.

0 Kudos
Message 9 of 9
(2,326 Views)