In order to sample a 3 Hz sine wave, I have to scan it at 30 Hz.

My setup is as follows:
I have two PXI 6031E DAQ cards in a PXI 1000B chassis. Each DAQ card connects to a SCXI 1001 chassis. On the first SCXI chassis I have six SCXI 1102C modules and in the second SCXI chassis I have three SCXI 1102 modules. I set up two seperate scan lists. One for the first DAQ card and one for the second DAQ card. The actual scanning functions are placed in seperate threads. After I acquire the data, I move it to "shared memory." The display program reads the value from shared memory and plots the value. For simplicity I left the data as a short int and plotted it that way. If I connect a function generator to any channel I can read a clean wave only if my scan rate is 10
times the function generator value. For example, if I want to read a 3Hz sine wave I have to set the scan rate on the DataAcq program to 30Hz and the update rate on the display program to 30Hz. Should I be able to read a 3Hz sine wave while scanning at 3Hz? Also, I am open to any recommendations in my code.
Attachments:
DataAcq.zip ‏6 KB
Display.zip ‏5 KB

What you have discovered is quite normal for acquiring data in the time domain. If you were only interested in the frequency domain, you could follow the Nyquist criteria and sample at a frequency at least twice your desired frequency (6 Hz). Since you wish to examine the data as a sine wave (to view and recognize), you need to sample the waveform at a rate of at least ten times the desired frequency. Hence, to plot and recognize a 3 Hz signal, you would need to sample at a rate of 30 Hz. This action allows ten actual data points per wave cycle.
As a rule, I use 16 times "oversampling" for my application where I desire to manipulate the data in the time domain. Twenty times oversampling would be even better. It really depends upon the resolution you would like to
see in your data.

Similar Messages

  • Help Creating a Sine Wave in Numbers '09?

    Hi,
    I'm having trouble graphing some data in Numbers, having been used to Excel for most of my life. What I've basically got to do is graph a sine wave representing the annual variation described in the graph (it compares CO2 concentration measured at a chain of islands to time in years). I've figured out easily how to graph the data on a polynomial treadline curve, but now I've got this to do.
    The instructions say to make a new column in column D and enter in the equation 1.435x-2501.1, which is derived from the linear fit treadline equation I had calculated earlier. After that I am to copy it down to match the number of cells in column A (626), which I did, so now every cell in D down to 626 contains that equation above. Then, I enter 1 in cell E1 and 1/12 in order to arbitrarily guess at the sine wave amplitude and period, respectively, and finally I then select cell D1 and put in this equation:
    =1.435*A2-2501.1+($E$1*SIN(A2/$F$1))
    After that I grab cell D2, drag it down to select all the cells in column D, and add it to the graph by (I think) dragging it onto the graph, as Numbers says to do. What I'm uncertain of is where to go from here. Here are the instructions:
    'To plot the model values on the chart, double click or right click on the chart and select "Select Data" and click on Add under Series. Name the series "Model" and select data in column A for the X values and data in column D for the Y values. Rename Series 1 "Raw Data" and click OK."
    That's all stuff you can do in Excel... I don't know how to do it in Numbers. When I drag D into the graph, it works fine, but when I go to add in column A for X and D for Y in Inspector it won't let me type anything. How do I complete this sine wave?
    Thank you very much in advance for reading through this and helping me.

    theleonhearted wrote:
    The instructions say to make a new column in column D and enter in the equation 1.435x-2501.1, which is derived from the linear fit treadline equation I had calculated earlier. After that I am to copy it down to match the number of cells in column A (626), which I did, so now every cell in D down to 626 contains that equation above.
    I'm not sure of the reason for this step.
    1.435x-2501.1
    Entered into D2, with the x value in A2 is expressed as:
    =1.435*A-2501.1
    which is part of the formula below.
    Then, I enter 1 in cell E1 and 1/12 in order to arbitrarily guess at the sine wave amplitude and period, respectively, and finally I then select cell D1 and put in this equation:
    =1.435*A2-2501.1+($E$1*SIN(A2/$F$1))
    I'm assuming "1/12" goes in F1.
    I've also assumed row 1 is a Header row, and have entered your formula into the first data row (D2)
    Your formula is now:
    (1.435 times the value A) - 2501.1 + 1 * (Sin( the value in A divided by 0.833...))
    or
    (1.435 times the value A) - 2501.1 + 1 * (Sin( the value in A multiplied by 12))
    You haven't given any specifics regarding the raw data, so I've arbitrarily set it to a positive linear slope by making A =ROW()-1.
    After that I grab cell D2, drag it down to select all the cells in column D, and add it to the graph by (I think) dragging it onto the graph, as Numbers says to do. What I'm uncertain of is where to go from here. Here are the instructions:
    'To plot the model values on the chart, double click or right click on the chart and select "Select Data" and click on Add under Series. Name the series "Model" and select data in column A for the X values and data in column D for the Y values. Rename Series 1 "Raw Data" and click OK."
    These may be instructions for Excel. Using Numbers, a simpler way to place thie data into an X-y Scatter plot is this:
    Set the data up to occupy the full columns A and D, not including the Header row mentioned above.
    Select Column A: Click on any cell to make the table active show the row and column Reference tabs.
    Click on column A's reference tab.
    Command-clickon column D's reference tab to add it to the selection.
    Click the Chart button in the tools and choose the Scatter chart icon from the menu.
    If I've read this correctly, your formula imposes a sine wave onto the set of data.
    Here are the results. The expanded chart at the right shows the approximately the area bounded by the light blue rectangle at the upper end of the plot in the larger chart.
    Regards,
    Barry

  • How to take a derivative of a sine wave?

    I know this is probably really simple and I am sure I am doing something stupid but please could someone help me..
    I am just trying to plot the derivative of a sine wave on the same graph as the original sine wave. It seems to be working (it is displaying a cosine wave) but the amplitude is way off.
    Please could someone just point to me why the amplitude is off.. the original sine wave is going between 1 and -1 but the derivative is between 60 and -60
    Solved!
    Go to Solution.

    Just speculating, but...
    The derivative of a 10 Hz sine wave should have an amplitude of about ±60 (2*pi*10).
    The Sine Waveform VI has a default frequency of 10 Hz.
    Coincidence?
    Best Regards,
    John Passiak

  • Phase shift between a pulse and sin wave

    Hello,
    I was wondering if there is any VI that I can use to get the phase shift between a pulse and a sin wave (they have same frequency).
    The Ideal case is that the pulse should go to 1 when sin wave is positive and goes to 0 when the sin wave is negative. I want to set this test to measure the phase shift between pulse going to one and sin wave going positive.
    We just bought labview full version with Signal processing package, and I was wondering if there is anything that would be useful for me.
    Thanks in advance,
    Baran.

    Hi Baran,
    Try this on for size and see if it works for you.
    Have a great day,
    Chris V
    Applications Engineer
    National Instruments
    Attachments:
    Phase Difference.vi ‏22 KB

  • How to get the sine wave sample of the input and output in the same time?

    I discovered that the samples were acquired did not in the same time in my vi.Could you tell me how to get the sine wave sample of the input and output in the same time?
    Output:9263;
    Input:9201
    Attachments:
    singal requency.vi ‏104 KB

    Hello Yun_Zhu,
    Your VI looks like you started from an example, and you are on the right track. 
    To clarify are you trying to synchronize the input and the output waveforms?  If you you will need to share a time base and a start trigger.  Check out the synchronization examples from LabVIEW
    Anthony F.
    Product Marketing Engineer
    National Instruments
    Attachments:
    HIODAQmxSyncMultiDev.png ‏70 KB

  • Problem with meal order sdk sample (using c++ to define business logic)

    Hi there,
    I'm trying to use meal order udo sample from sdk but i cannot register .dll extension. it gives me Invalid dll path or name [User-Defined Object - Extension Name] error.
    What am i doing wrong?
    Thanks in advance

    Thanks but I was asking about something else. Maybe I wasn't precise.
    I'm trying to develop udo as extension written in c+. There is such a possibility. You can compile it into dll and then upon creating new object from sap b1 ui you link to that dll. Again this is written in c+ not c# or vb. But when I link that dll I get errror message that I posted in my previous message.
    Again I'm talking about this way to build udo objects -
    UDO - DLL (1)
    Thanks in advance

  • Sampling sine wave and saving the samples in an array.

    helo..
    I am new to Labview and i need some help regarding sampling the sine wave.
    I have generated the sinewave in labview and now i want to sample it.(do i need an ADC for sampling?) and the samples should be saved in an array.
    I dont know how to do this.
    Please tell me how to do this or post some related examples..
    Thanks in advance 

    All of the functions that generate a sine wave in software do save all of the samples in an array. You just need to know how to get them. Since you did not mention the function you used to create the sine wave, lets assume it's the Express VI Simulate Signal. On the signal output, wire a Convert From Dynamic Data type function and select the default 1d Array of Scalars. Right click on the output of this and select Create Indicator. You now have the array. If you are using Sine Waveform which outputs a waveform data type, just wire up a Get Waveform Components function and select the item 'Y'.
    For learning the basics, please see the free tutorials
    Message Edited by Dennis Knutson on 10-28-2008 08:23 PM
    Attachments:
    Get Y Array.PNG ‏4 KB

  • Sampling a sine wave

    Hi everyone
    I am looking to sample a signal using labview.
    I have produced a signal using the "simulate signal" block with controls for amplitude, frequency etc, and have varified that it works.
    I want to sample this signal at regular intervals and store the data. Can anyone explain how to sample a signal in labview?
    I have looked at the following white paper but it dealt more with the concept of sampling, rather than a tutorial of how to implement it:
    http://www.ni.com/white-paper/3016/en/
    I also looked at the following, which again didn't actually provide a tutorial:
    http://www.ni.com/tutorial/3116/en/
    I couldn't find anything else in my search. If anyone can point me in the direction of a tutorial for sampling it would be much appreciated

    Those sampling techniques will then be utilised for sampling real signals on an NI DAQ device. The simulated signal is just to provide me with a learning tool to learn sampling techniques, i.e. acquiring amplitudes at regular intervals
    I just need any sample as an input to test the sampling mechanism
    Using an NI DAQ device there are no other 'sampling techniques'. If you look at the vi snippet below, you see that the DAQ vi outputs a sampled signal just like the generate waveform vi. You don't get to do any sampling yourself or use a 'sampling mechanism', just change the input parameters to the vi to tell it sample rate, etc.
    Therefore, I'm not quite sure what you are looking for (and obviously neither is GerdW who was actually trying to be helpful).
    If you are looking to observe what happens when you change the sample frequency for a given waveform (in order to experiment with aliasing, etc.) then you can take the given samples and 'downsample' using the Resample Waveform vi.
     

  • Sampling sine wave in labview

    how to read  the corresponding voltage value for each point on sine wave(each sample)?
    please show me the block diagram
    thanks,

    continued here....
    LabVIEW Champion . Do more with less code and in less time .

  • How can I generate a smooth continuous sine wave

    I am trying to build a single frequency active noise control system to
    control a tonal acoustic disturbance. In order to do this I need to be able to
    drive a set of loudspeakers with a single frequency waveform which will be
    continuously adapting at each sample.
    The control system will ideally be implemented to control low frequency
    tones, 700-1000Hz, and thus sampling rates of below about 4000Hz should be
    sufficient for the task.
    However, when trying to continuously generate a waveform at an update rate
    of 4000 updates/sec the resulting sine wave output from the DAQ card when
    observed on an oscilloscope looks very much like a digital signal (a sine
    wave containing large "steps" in the voltage), as if there
    has been no
    smoothing in the DAC. Playing this through a loudspeaker results in a very
    "buzzy" sound and not a single frequency tone. Only when the update rate
    is much higher >50000 updates/sec, does the signal start to sound like a
    single frequency tone.
    I would much rather be able to implement the control system at a sample
    rate of 4000Hz than >50000Hz. How do I therefore guarantee a smooth analog
    sine wave output at the lower sample rates? Is this a labview problem, or
    a hardware problem?

    Is this a labview problem, or
    a hardware problem?"
    Problem?
    Well it actually the nature of the beast. As a rough rule of thumb, the signal starts to become smooth when the update rate is at least 10X the highest frequency present in your signal.
    The human ear is amazing in its ability to detect (hear) higher frequency components. This is the buzz you hear.
    If you want to keep your update rate low, then you may be able to get away with a low pass filter on the output from your DAQ device. An appropriately size cap and resistor may be all you need.
    Ben
    Ben Rayner
    Certified LabVIEW Developer
    www.DSAutomation.com
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How can I get stable Sin wave through NI 9264 ?

    Dear all,
    I would like to generate 64 analog sin wave with frequency up to 20K Hz.
    Then I bought 4 NI9264:
    25 kS/s/ch simultaneous output
    Hot-swappable operation
    Spring terminal or D-SUB connectivity options
    250 Vrms isolation (spring terminal version)
    60 VDC isolation (D-SUB version)
    .The attached is my file for the generation. when I used Osciloscope to monitor the output, I could not get any stable output.
     Could I have the reasons and suggestions for my objective please?
    Thanks!
    Zhu_nuo
    Attachments:
    64 Channel Programmatic v2.vi ‏22 KB

    Hi Zhuming,
    The VI above only provides waveform information for a single channel. In order to output data across all 64 channels in the task, we can make use of a For Loop to build an array of waveform information for each channel. In the example below, I've made use of an Auto-Indexing For Loop in order to build up a waveform output array of 64 elements. I've wired this to an NI-DAQmx Analog 1D Wfm Write VI; the 1D array's elements represents each channel in the group of selected channels for generation.
    An important thing to note is that the NI 9264 16 channel analogue output modules have a maximum sample rate of 25 kS/s/ch. This means that each channel is capable of writing 25kS/s simultaneously.
    To reliably generate a signal, we generally need to have it comprised of around 5 to 10 points of data. This allows us to represent the signal to a good degree of accuracy. For example, if I wanted to reliably output a 1Hz Sine Wave, I would need to break the 1Hz wave into ten separate points and then output them at a rate of 10Hz. In terms of the NI 9264, the maximum frequency content (Two points of information) that can be generated is 25kHz/2 = 12.5kHz wave. The maximum clear wave frequency that we could produce with the 9264 (A wave built up of ten points) is 2.5kHz simultaneously across each channel. This is all to do with Nyquist's Theorem. This should explain why the frequency appeared to drop.
    Out of interest, how are you measuring these output frequencies?
    Kind Regards,
    Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

  • My Sine Wave File sounds different in Logic than iTunes

    I am working on creating musical compositions with embedded sine wave patterns (which I am generating in a foriegn application). These sine waves are designed to entrain the brain to different frequencies to facilitate in stimulating meditative states of consciousness in the listener.
    Unfortunately, when I import my sine wave audio file (in .wav format) Logic changes it and the rhythm is frequency is twice as fast! When I play the file in iTunes it sounds just the way I generated it, but when I import it into Logic through the audio bin or simply drag and drop onto the arrange window, it sounds different and cannot work for the precise control I require for my compositions.
    Does any one have any idea why this is happening or what I can do to import my audio file without changing it?
    Thank you so much for any ideas/assistance,
    Devlin Dewitt Donnelly

    Hi DD Smooth,
    you should check sample rate settings on your original audio files and make them match the sample rate settings on your logic project prior to importing them. Sounds like you are generating 48khz .wav files in your foreign app and Logic must be set to 44.1khz by default. Or the other way around
    Message was edited by: Imol

  • How to count the number of cycles in sine wave

    Hi,
    I am new to Labview.  I have labview 8.2 version and my dataacquisition is NIDAQPAD6015.  I could write a program to generate a sine wave of desired frequency through simulate signal. My question is how do i measure the number of cycles for this sine wave as soon as I run the program. Hope my question  is clear.
    Ravi Mokirala

    To find the offset (which in this case is the Y value midpoint around which the sine wave is symetrical):
    Capture more than one cycle.  Find the min and max values.  Subtract Min from Max and divide by 2.  Then subtract this result from the Max value (or add the result to the Min value).  This is the offset.
    To count the number of cycles where the offset is unknown, just use the first data point value as a reference.  If the next data point is more positive, then count the number of times that the first data point is repeated and the next data point is more positive.  Of course with DBL data type, you probably would not get the exact same value as the first data point, so you need to use In Range with a very tiny limit.  It all depends on your signal amplitude, frequency, and sampling rate.
    Example:  Lets say your first data point value is 0.5 and the 2nd point is 0.55.  You need to look for another value that is between 0.48 and 0.52.  Then read the very next data point value.  If it is greater than the previous value, add one to the cycle count.  If it is less than, you are at half a cycle, do not add to the count.
    - tbob
    Inventor of the WORM Global

  • PXI-board only returns perfect sine wave

    Hi, everyone!
    This is a strange one:
    Im peforming synchronized sampling from two boards; one is a PCI-6224 in my computer and the other a PXI-6229 located in our PXI-system. Being a rookie when it comes to labview, I was quite proud of myself for managing this all by myself. However, when i looked closer at a 10 sec test-record I noticed something peculiar. Although none of the 32 (differential) channels had inputs during the recording, the PXI-board returned 16 perfect 1 Hz sine waves with exactly the same amplitude as the measurement range. Attaching a signal to the terminal block didn't alter this. The PCI-board returns only weak 50 Hz (power network) noise, as expected. What is going on ??
    I'm using a PXI-1031 chassis together with a PXI-8184 controller connected to the PC with a network cable. I trigger the pxi-board by sending the PC-clock through a PFI-port and a physichal wire.
    regards, Einar

    As I said, I haven't used LabVIEW 8 all that much. It's a bit tricky: you'll have to make a new Project, add the PXI as a new Target, and the add the VI you're trying to run underneath the new target. The last time I was playing with this I also had to open some ports in the Windows XP firewall.
    If this is all a bit much for you, you might have a PXI controller that is configured to dual-boot both LabVIEW RT and Windows XP. If you reboot the controller in Windows XP mode, you can then access the PXI-6229 in the same way you currently access the PCI-6224... provided you don't mind copying the VIs over and hooking up a mouse, monitor, and keyboard to the PXI.
    Switching from LV RT to Windows XP is most easily done by selecting the appropriate option in the PXI's BIOS. Check your PXI controller's manual for details.

  • Generating a 6X Sine Wave using an absolute encoder

    How do I get an Analog Signal Generation Synchronized to six times the frequency of an absolute nine bit parallel encoders output with adjustable phase relation. I am using a PXI-6533, a PXI-6711 and have available a PXI-6070E.
    Now the long version of the problem. I have a 9-bit absolute encoder connected to a motor shaft (up to 420Hz). From the encoders 9-bit (0-511) parallel signal I need to create a synchronized 6X sine wave (up to 2500Hzwith an adjustable phase relation. Picture an electronic timing chain. For every cycle of the encoder, I need to produce six full sine wave cycles with a variable tuned phase shift. I have LabView 7 w/RT.
    I have tried to use the Update Clock (PFI5) to step through a buf
    fer but it seems to drop an update every so often. I also have tried to monitor the bit-0 line to determine freq. and scaled the update rate accordingly but the phase shifts all over the place. Does anyone have any ideas on the matter ? I would really appreciate it! Thanx….Phil

    Phil,
    Another different option to solve your application would be to use the new LabVIEW FPGA module and the 7831R reconfigurable I/O hardware. Using these tools you can configure the FPGA on the board to generate the sine wave based on the 9-bit parallel input. The most simple setup would be to have a lookup table in the FPGA that has a corresponding output value to each of the 512 possible input values. This 512 sample table would contain 6 cycles of a sine wave. Every time the parallel input changes the analog output value would be updated accordingly from the lookup table. This setup would also allow to easily add a phas
    e shift of the output by shifting the point in the lookup table you are reading by a known constant.
    Christian L
    NICS
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

Maybe you are looking for

  • PO Approval stuck in error without any Error message

    Hi All, we have few notifications for PO Approval where they are stuck in error without any error message. they are also not showing in the worklist of the approver nor in the wf_notifications table. please help on this on how to solve this. we have

  • Message Distribution

    Hi, I want to distribute messages to a great number of receivers. This time I use as the receiver side the extern file adapter (Plain J2SE Adapter Engine), because I want to be shure, that the message will arrive successfully even if the network conn

  • Problems uploading a text file with line feed characters from Windows

    Hi, I am using the FM GUI_UPLOAD to load a text file in which at the end of each line there is a line feed character. When I upload the file, the FM interprets the entire file as ONE record; it does not recognize the line feed character at the end of

  • Data Load Rule file -Date conversion

    Hi,While working on a Dataload rule file,I was facing this problem.I'm getting date in the format "m(m)/d(d)/yyyy hh:mm:ss". Is there a way to change this to "mm/yy" ??(There won't be anyproblem if I get mm/dd/yyyy hh:mm:ss style. but unfortunately n

  • I want to use my iphone as a storage device - any tips?

    Hello I have files which i need to take to work tomorrow on my computer at home.  I don't have a USB flash drive and wish to use my iPhone 3GS to achieve this simple task.  What I have in mind is allocating, say, 4GB of space to store files on and be