03-12-2019 07:42 AM
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.
03-12-2019 08:00 AM
How does your waveform graph not match your expectation?
I can imagine that your are facing either breaking of Niquist or incorrect windowing.
03-12-2019 08:04 AM
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
03-12-2019 08:34 AM
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
03-12-2019 08:59 AM
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.
03-12-2019 11:37 AM
Thanks but I expecting to see the frequency of the analog input signal which in my case is not happening.
03-12-2019 12:36 PM
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
03-13-2019 05:53 AM
@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.
03-13-2019 02:49 PM
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.