LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding indexing with while loops and building waveforms

I have created 2 separate programs that I want to generate the same result. The first program (whileloop2) generates a sine waveform, performs FFT, and displays it on a graph all under the while loop and outputs the correct result. The second program (whileloop3) generates a sine waveform and sends the array values of the waveform outside the while loop, then builds a waveform and performs FFT outside the while loops and displays it on a graph. The second program is not outputting the same results and i am not sure why. Does anyone know the reason for this and how to fix it? I need to be able to perform the fft outside the while loop correctly for another program that generates values from hardware. Please let me know, thanks.

Download All
0 Kudos
Message 1 of 5
(2,878 Views)

at the very least your are specifying the wrong "dt".

 

The "dt" in the waveform must be the reciprocal of the sample rate.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 5
(2,871 Views)

So if i set my frequency to .1 Hertz, what should i set my sample rate at?

 

0 Kudos
Message 3 of 5
(2,867 Views)

@loudoe77 wrote:

So if i set my frequency to .1 Hertz, what should i set my sample rate at?

 


Errrr... 0.1 ?

 

dt is the reciprocal.

 

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 5
(2,864 Views)

@loudoe77 wrote:

So if i set my frequency to .1 Hertz, what should i set my sample rate at?

 


Fs = Sample Rate = 0.1

Ts = dt = 10

 

dt is the time between samples and the math is just dt = 1/Fs


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
Message 5 of 5
(2,828 Views)