LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Delay as Sine Wave Frequency

I'm trying to create a sine wave with sampling frequency that can go above and below the Nyquist frequency. The way I've managed to achieve this so far is by setting up the samples per cycle and amplitude in a for loop, surrounded by a while loop (see the code attached). This means that I have to control the frequency using a time delay in the loop, but for some reason changing the sample rate also changes the ouput frequency.

 

Can someone help me with this? I want to be able to change the freuqnecy using a time delay and not have it changed by the sample rate as well. 

 

Thanks!

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

@Valsae wrote:

I want to be able to change the freuqnecy using a time delay and not have it changed by the sample rate as well.


That is impossible since the delay is your sample rate.  If you want to change the frequency, you have to change N.

 

But you are also going about this the hard way.  Look at the Sine Waveform.vi in the Signal Processing->Signal Generation palette.  It will do everything you need.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(3,181 Views)

Unforunately the Sine Waveform.vi does not satisfy my needs, as it requires that the frequency be less than or equal to half the sampling rate. I need to be able to make frequency more than half the sampling rate, while still being able to control the frequency independently. Is there any way I can execute the code over a fixed amount of time, regardless of the number of data points per cycle? Can I change this fixed time?

0 Kudos
Message 3 of 3
(3,157 Views)