LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a 15khz Sine Wave with LabView?

I tried to create a 15khz Sine Wave with 'Sine Wave.vi' and 'Sine Waveform.vi'. But I achieved only a signal with 100Hz. Over this frequency the signal was distorted.
0 Kudos
Message 1 of 4
(3,398 Views)
Have you specified your sampling frequency (fs)? If not, when you use the Sine Waveform.vi, the value will by default be 1000 Hz and due to the Nyquist limit that tells you that you cannot generate a tone above half the sample rate (500 Hz), you'll not be able to generate 15 kHz. Also the signal "may" look distorded above 100 Hz because you get too few samples per period.

Try to create a control for to the sampling info input and select for example fs = 500 kHz and number of samples (#s) = 200. You should get a 15 kHz signal with 6 periods.
Message 2 of 4
(3,398 Views)
How do you see that the signal is distorted? Are you doing a frequency analysis of it, in that case, have you considered the effect of spectral leakage (need to window the signal)?

Generating a signal is just pure and simple math, no signal distortion involved. In the analogue world such phenomena is common though...so if the distrotion is seen after converting it to an analgoue output there are a number of possible reasons.
Message 3 of 4
(3,398 Views)
Hi Happy-student,

Both Alain and Mads gave very good answers.

If you post a copy of of your code we may be able to give you concrete suggestions.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(3,398 Views)