LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am having difficulty sampling my signal correctly...any ideas on what I am doing wrong?

I generated a 1 Hz sine wave using the Simulate Signal VI. I would like to sample this signal using the sample and hold method with sampling frequency of 360 Hz. To do this, I generated a 360 Hz sine wave. I then find where this signal crosses the x-axis from negative to positive, and a boolean indicator gives ''true'' when this happens. Since the signal is 360 Hz, the indicator should yield ''true'' 360 times per second. The 1 Hz sine wave is sent through a selector that outputs the same value as the one sent in every time the boolean indicator shows ''true''. Otherwise, it gives the output from the previous time step as the current output.

 

Next, the data goes through the ADC vi, which is set to compress the data (meaning that a new digital point is only displayed when the value changes). So, shouldn't there be 360 digital points if I run my simulation for 1 second, since the waveform is sampled 360 times per second?  

 

Any ideas are appreciated! I am not sure if my error is a result of misunderstanding Labview or misunderstanding sampling theory.

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

Versuche es mal ohne express vi s

 

Eine Whileschleife, dessen Zähler Du als Zeitbasis verwendest,

Sinusfunktionen als Signalquellen, g .....  ups english forum 😉

 

Try it without express vis

a while loop with the index as timebase (multiply by your timestep to get t)

sinus functions with 2 Pi  t  as signals

 

In your vi in every interation of the while loop you generate an array of values where you always pich the same index 😉  ...

 

 PS: here is my version

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 2
(1,933 Views)