12-21-2017 05:20 PM
Hi dimani4,
Hmmm, I noticed that you are sampling at 1000 Hz for 1000 samples. I would recommend sampling at least 2x the highest frequency. We recommend sampling 10x the frequency.
What we might be seeing here is aliasing - when a signal is not sampled fast enough, it could look like a different signal. Here's a document that explains the Nyquist Theorem.
Also this document (pages 7-9) that goes more in detail about what is happening.
Acquiring Analog Signal
http://download.ni.com/evaluation/pxi/Acquiring_Analog_Signal.pdf
Cici Z.
Applications Engineer
National Instruments
12-22-2017 09:46 AM - edited 12-22-2017 09:48 AM
Dear Cici,
Thank you very much.
Yes... You are absolutely right... totally forgot about Nyquist. Another question. Now I'm sampling at 100k (rate=100k and samples per channel is 10k) and it gives me the right results. But there are still questions: Here the example of the 100k sampling (rate) and samples per channel is 10k (finite samples) while delivering 1kHz signal:
There is some strange distorted part in the end of the graph (red). what is that?
The continuous mode for the same parameters (rate and sample per channel) gave me an error:
I did another try with the same rate but with the different samples to read (samples per channel) to track the distortion part.
So here it is:
Rate=100k, samples per channel is 1k (finite samples). Again I get this distortion.
The same for continuous I get again an error when I hit the STOP button:
The same graph I get from the MAX measurement for continuous mode (without any errors and distortions):
So here the questions:
1. Why I get error? I tried to increase the buffer size (samples per channel to 5000 instead of 1000, rate is 100k as it was before) and here the graph:
Again an error and distortion (red).
The same with finite samples:
Not error but with distortion.
2. Why the graphs in the finite mode are distorted? It shouldn't be because the same graphs I get from MAX without any distortions.
I want describe very quick what I did in program: My program reads every (1/rate) millisecond a sample and it reads (samples per channel) times. For example: if there is 100k rate and 1000 samples per channel; the program will read every (1/100k)*1000 millisecond a sample and it will do it 1000 times. So in the graph I will get time range from 0 to [samples per channel/rate]= 1000/100k=1*10^(-2) sec. I guess this is the process of samples reading as I saw it from the MAX. Here the picture for the prove as amplitude vs number of samples:
And finally:
If I'll have the frequencies more than MHz, can I measure it? Here I deliver 1Mhz and here what I got:
Anyway I guess maximum rate is 6.666MHz as written here:
Sorry for such a long post.
Thank you.