Sampling frequency Fs and number of sample #s in a waveform

Hi there,
It is probably a stupid question but I am still going to ask it:
I do not completely understand why in the "Basic Function Generator.vi"  there is a distinction between the number of samples #s and the sampling frequency Fs..?
What is the purpose to have more or less samples in the generated waveform then specified by the sampling frequency of the signal?
I hope this question make sense (or am I missing something obvious)?
thanks,
Best,
Renaud 

rihns wrote:
I am sending those values to an AO (to a mechanical system that reproduce the sended waveform) and record the signal with an AI. My problem is that when I reduce the number of sample as explained in the previous message, I enhance the number of cycles i.e the time of the signal seen by the AO but it does not seem to apply to the AI... see attached image (Fs = 305000 #s=30500 AO is in white AI is in red)
Why does the #s only affect the time of AO and not the one of AI? (the number of cycle is the same though, only the time base is different)
I think we need to see some code in order to get the full picture of what you are doing.  The number of samples of the AO should have nothing to do with the AI.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • What is the effect of output signal with the same sampling frequency but different number of samples?

    Hi,
    I'm using PXI4461 for audio measurement and there is a question about analog output. I'm using the Basic Multitone vi for generating multitone signal. The sampling rate is 200k and my question is how to determine the number of samples. I used an audio analyzer to measure the distortion of the output signal with 200k and 1k points and there are no different except the update rate. What number of samples is suitable for 200k sampling rate?
    Thanks,
    Bill

    The Sampling Rate determines the maximum frequency that you can see (the rate/2 according to Nyquist).
    The number of samples divided by the rate determines how long you will sample. This sample time can only be determined by you. Do you need .1 seconds worth of data, or 1 second? But note that the MINIMUM frequency that you can detect is 1/(Sample Time) or the Sampling Rate/Number of Samples. So if your system has a minimum and maximum frequency specification use that as your guild.
    [email protected]

  • How to use ni-6008 and build a four channel data acquisition at a rate of 250 samples per channel and display all the data in a waveform chart

    how to use ni-6008 and build a four channel data acquisition at a rate of 250 samples per channel and display all the data in a waveform chart 

    Hi kdm,
    please stick in one thread for the same topic!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Multiple channels acquisition and Number of samples per channel

    Hi,
    I'm a new labview user and I need some help in trasposing an old traditional NI-DAQ acquisition software in a NI-DAQ-mx one.
    I followed the tutorial (#4342) but I found a problem with Analogue 2D DBL Multiple Channels Multiple Samples DAQmx Read Vi.
    I'm trying to acquire 8 voltage signals from a NI-USB-6341 device. When the Number Of Samples Per Channel I set is below the number of channels (8), the software acquires only a number of channels equal to the number of samples per channel I set.
    Is that a normal behaviour?
    Thank you
    Daniele

    This is my code. The problem is the same with or without the code for the scan backlog indexing.
    Tomorrow I will try with the code from the example.
    Thank you
    Daniele
    Attachments:
    acq code.jpg ‏119 KB

  • 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

  • Pulse train generation fails with certain values for "number of samples"

    I'm generating a retriggerable analog output signal, and so I'm using a counter as the sample clock (see: Retriggerable AI Using Retriggerable Counter). I am finding that, above a certain number of samples, and only for certain values of the number of samples, the counter task gives me error -200305, "Desired finite pulse train generation is not possibe." The error crops up only when actually starting the task.
    The analog signal that I'm trying to generate will be about 800 kHz, so my counter is set to run at the same frequency. I find that the counter task works fine if the number of samples to generate is anywhere between zero and 671,088 samples. Setting the number of samples to 671,089 gives the error above, as does 671,090 samples and so on. However, using 671,096, the counter task works fine. After that, the counter seems to output fine only if the number of samples is divisible by 8.
    The only thing I can think of is that (617088 samples) / (800000 Hz) = 0.839 s. At the internal clock rate of 20 MHz, 0.839 s is 2^24 samples, and it is a 24-bit counter on this hardware. So if it's this internal counter rolling over, that's fine and I can work around that. But if that's the case, what I don't understand is why increasing the number of samples in increments of 8 samples still works.
    The hardware is a PXI-6733 board, running with LabView 7.1.1 and NI-DAQmx 8.1.

    Hmmm,  multiples of 50 & 100?  Now I'm puzzled again.
    Here's how to make sense of the 100 kHz timebase idea though, even if it turns out not to be the right explanation.  For a retriggerable finite pulse train, you actually use a pair of counters.  If you were to program it manually, you could set your output counter to generate a continuous pulsetrain at 800 kHz using the internal 20 MHz timebase.  This output counter would also be configured to use the other counter's output as a digital level-based pause trigger.  So the 800 kHz pulsetrain is only output while the other counter's output is, say, high.
    The other counter is configured for retriggerable pulse generation.  The pulse duration or high time should be set for (# pulses) / (800e3 pulses/sec).  This other counter can be configured to use the 100 kHz timebase, so its high time would then have to be an integer multiple of 10 usec.
    So let's see...  An 800 kHz pulsetrain is possible with a 20 MHz timebase (exactly 25 cycles).  A 700 kHz (28 + 4/7 cycles) or 900 kHz (22 + 2/9 cycles) is not.  So when you request those other frequencies, you actually get a near approximation.  I dunno if DAQmx can be queried for the actual value correctly or not -- I recall an early version that reported back whatever freq you had asked for rather than what it actually used.  Queries based on ticks (rather than time or freq) did return what was actually used, as I recall.
    Let's suppose a request for 700 kHz gets truncated to 28 cycles of the 20 MHz timebase making a 1.4 usec period.  Then 50 of those periods becomes 70 usec, which is evenly divisible by the 100 kHz timebase.  Bingo!  (Note: 70 is the least common multiple of 10 and 1.4)
    Now suppose the request for 900 kHz turns into 22 cycles of the 20 MHz timebase, or a 1.1 usec period.  Now it takes 100 of those periods to get to 110 usec, which is also evenly divisible by the 100 kHz timebase.  Bingo again!  (Note: 110 is the lcm of 10 and 1.1).
    Did you follow the method here?  It should help you figure out expected results for various output freqs and #'s of samples.
    -Kevin P.

  • DAQmxWrite​AnalogF64(​) - array & number of samples

    I plan to use DAQmxWriteAnalogF64() to output AO to my device.  This is part of the code that generate the AO:
    // DAQmx Configure Code
    DAQmxErrChk (DAQmxCreateTask ("",&taskHandle) );
    DAQmxErrChk (DAQmxCreateAOVoltageChan (taskHandle,"Dev1/ao0","",-10.0,10.0,DAQmx_Val_Vol​ts,NULL) );
    DAQmxErrChk (DAQmxCfgSampClkTiming (taskHandle,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_C​ontSamps,1000) );
    DAQmxErrChk (DAQmxRegisterDoneEvent (taskHandle,0,DoneCallback,NULL) );
    // DAQmx Write Code
    DAQmxErrChk (DAQmxWriteAnalogF64 (taskHandle,1000,0,10.0,DAQmx_Val_GroupByChannel,d​ata,NULL,NULL) );
    // DAQmx Start Code
    DAQmxErrChk (DAQmxStartTask(taskHandle));
    Questions:
    1. DAQmxCfgSampClkTiming() specifies a number of 1000 samples with a rate of 1000 samples/second.  dataLayout is DAQmx_Val_ContSamps, which is generate samples until task is stopped.  Does this mean that the input array that I pass into DAQmxWriteAnalogF64() must have a size of 1000?  This is single channel.
    2. Say if I use a total of 4 channels, each has 1000 samples, then my input array must have a size of 4000, while my sampling rate remains at 1000 samples/second, correct?

    Hello hn_sofec,
    In regards to your doubt:
    No,  the input array that you pass into DAQmxWriteAnalogF64() does not necesarily have to have the same value than the number of the sample rate. The number of samples is just the number of samples that compose the waveform that you want to generate. Then, the sample rate, will determine how fast will you transfer to the output buffer those samples. For example, for an array of 100 samples (lets say that those 100 samples represents a complete period of a sine wave), and configuring a sample rate of 1000 S/s, it would take 0.1 s to generate the first complete period of the sinewave (array of 100 samples). After1 second you would have generated 10 complete periods of the sinewave.
    I suggest you to review more examples in order to understand better how the functions work. I share you one here:
    "NI-DAQmx: Continuous Multi-Channel Analog Output Example in CVI"
    http://www.ni.com/example/25867/en/
    Hope this helps. Best regards!
    Daniel C.

  • Configurin​g IQ / Number of Samples for USRP2920

    Hello,
    I've been trying to record HF-Signal using the USRP 2920. I got unexpected behavior for some configurations of IQ rate and Number of Samples.
    When setting the IQ to 1M as example and Numbers of Samples to 60984, the recorded file remaind empty even after recording over a long period of time. It looks like for a given IQ there is an appropriate Number of sample applicable.
    Do someone know the trade off to be made between bo parameters?
    thanks for any suggestions
    Solved!
    Go to Solution.

    Hi Bolivar,
    There are a few considerations and facts in my knowledge:
    The number of samples that you specify as input to the fetch VI is the number of samples that will be fetched by your host from the NI-USRP device per fetch call.
    NI-USRP driver (at the host level) will try to acquire these configured number of samples within the timeout specified by you and if it is not able to fetch these from the device you would get a timeout error.
    The maximum communication speed/data rate between the device and the host is governed by the communication medium used between the two.(in this case the ethernet connection 1Gbit per sec).
    Once you call the initiate VI the NI-USRP device starts capturing data.
    So when you configure the timeout, number of samples and the IQ rate of operation following pointers might help.
    Is the amount of data that you want to fetch (number of samples * data width) fetchable within the timeout configured ?
    Are you fetching out samples quickly enough so that the device buffers do not  overflow due to a high IQ rate ?
    That being said. let's say we fix IQ rate at 1M
    Very small sample sizes will result in a lower actual data rate due to the overhead associated with every fetch call might even cause device buffer overflow.
    Very large sample sizes might work if above considerations are made.
    A good sample size for your application might be found by making a small benchmark and calculating the actual time taken by the fetch VI call to execute to get a fixed amount of data at various sample sizes and picking the best sample size for your application. I think multiples of 1024 might work better for sample size.
    I am not sure if this solves your problem.
    Thanks.

  • Number of sample required

    Hi to all the expertise,
    In my labview program 6i, I design a scan rate and number of scans to acquire. Now I want to read 100 samples, which mean on my graph, I want to see 100 samples of waveform. How should I configure it, so that I"m able to achieve this.
    Kindly advise.
    Thanks

    Simple as it
    If it is a finite acq, keep scan rate as 100 samples /sec and number of samples to read as 100 samples
    does this answer your query ?
    if not, get back with more details
    regards
    Dev

  • Error:the number of sample must be 0 please help.

    dear genius.
    I searched the same error in this board but I can not understand how can i fix my problem.
    I am just a beginner in LV so I need your help. I made AM modulation and demodulation vi .
    when  I first used "simulated signal" as message signal, noting happened.
    but, I changed simulated signal as "acquire sound", and add a play waveform, after that, problem occured.
    actually, I can not understand about sample number or sampler rate .
    how can i fix my problem?
    and do you know some website to exercise digital communication using usrp and labview for trying ?
    please let me know your idea.
    thanks a lot.
    Solved!
    Go to Solution.
    Attachments:
    error.vi ‏164 KB

    kimjihwan123 wrote:
    thanks kingt of ni 
    thanks again. but can you tell me the differecne between sample rate and sample per second?  (I thoungt it was same)
    First of all Knight of NI is my title.  Crossrulz is my alias.
    Secondly, Sample Rate is the same as Samples Per Second.  But you want to make sure your sample rate and number of samples gathered are the same from both sources.  I would also turn off the Actual Time (or whatever it is called) in the Simulate Signal so  that it just gives you the sine wave instead of using time to generate it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can I set the sampling frequency in Labview if I am not using DAQ?

     I am working with bluetooth to send my four signals from my circuit to the computer. So, I am using VISA to acquire the data in labview. Since as you know its not possible to use DAQ while using bluetooth. 
    anyway after getting the signal I need to filter ir for analysis part and I am using filter express VI from signal processing's functions. However, I am getting error, since I dont have the sampling frequency set and I am not able to set it in my filter function either.
    I was wondering If there is a way of making labview recognize the clock-timer as the sampling rate or any other way to set the sampling frequency somewhere before the filters. 
    here is the program, you can take a look at it.
    Attachments:
    shift final - Copy.vi ‏363 KB

    Sender side is sendng 2 bytes of FF in the begining of the loop and 2 bytes of zeros between each signal, I am attaching the code as ICCV8 file (I will also attach it as a notepad file), so you can see what I mean. I had written some solutions for that as well in my program before but not sure if it was correct or not. I tried to search for  FF bytes as a string, after getting each 18 bytes. But apparently it doesnt find the FF, I reckon because of wrong conversions beforehand, so it stops the programm there. Im attaching the that program now as well. could you please take a look?
    Attachments:
    main.c ‏2 KB
    bluetooth code.txt ‏2 KB
    ok - Copy.vi ‏159 KB

  • How to get exactly the same number of samples every trial

    Hi,
    Here is what I want to do.I would like to show using an numeric indicator the expired time increase from 0 to 2 seconds. At the end of this two second period, I want a second numeric indicator to start incrementing from 0 to 3 seconds. I am using a USB 9237 DAQ. Sampling frequency of 2k Hz, and samples read of 500. So far, here is what I have put together.
    The first problem I have is that the first indicator does not start at 0, it starts at .25. The only data I care about is the data during the 3 seconds of "Full force". For this reason, I multiply my signal by 0 except for during the "Full force" period. The problem I am having is that I am not consistently getting 6000 samples. Sometimes I get 5500. If however, there isn't exactly 4000 frames before the "full force" data, then my average will be off. I only start to write to .tdms when the "Start Trial" button is pressed
    Is there a better way for me to get this 2 seconds then 3 seconds time setup?
    Any help will greatly be appreciated.
    Regards,
    Johan
    Attachments:
    Timing Section.vi ‏40 KB

    JHendrik,
    That increments you are seeing are due to DAQ code for sure. If ou are sampling at 2khz and want 500 samples, then it'll take .25 seconds to retrieve those samples. While that retreive is happening, your other code may not execute (depending on data flow) becaue it's waiting for the DAQ samples to be returned. By your description, I would guess that the Elapsed time VI is being read after you get your samples, which would be why you don't start at 0 seconds. Try fixing your data flow so that the elapsed time is read first.
    Ben Sisney
    FlexRIO V&V Engineer
    National Instruments

  • Sample Frequency of Low Pass filter VI is ambiguous

    I am having trouble understanding how the Sampling Frequency of the Low Pass Filter actually impacts the function buried within. The information passed in is an array with no relavance to time. How does the function actually sample this array of data at a frequency?

    I doubt that they actually build a waveform. Here is my guess: By defining a sample frequency they can get the sampling interval dt as you indicated.  By defining a sampling frequency the cutoff frequencies can be scaled to frequency units (Hz), making the VI easier to use.
    Lynn

  • What are supported sampling frequency and digitization rates for Zen Micropho

    Some MP3's are playing back slowly. It is inconsistent, though, since files with the same digitization rate and sampling frequency will behave differently - some right speed, some slow.
    The bulletin board says:
    "My tracks don't play at the correct speed e.g. they play too slowly, why?
    Chances are they are encoded in an unsupported sampling frequency..."
    How do I find out what the supported sampling fequencies and digitization rates are?

    Thanks for the info. I guess I was looking for something more specific - the exact bitrates and sample rates that Creative claims to support. Would you know where official and comprehensi've data can be had? There must be a tech spec somewhere.
    It is common these days in business to see a recording of, say, a conference call or seminar presentation at 32k bitrate/025Hz, or even 24k bitrate/8000Hz, posted to a company's website for download by those who could not be there, and MP3 players are increasingly used for their replay. Companies use low digitization rates because there is no need for hifi and the files are much smaller: less storage, faster download.
    I'd be surprized to think that Creative don't have compatibility with the standard range of rates offered by ubiquitous programs like Audacity and dBpower, the latter being one they themselves recommend!

  • Best way to acquire and log N number of samples at a specific repetition rate and write to file

    Hello,
    I am interested in acquiring N number of samples (e.g., 10000) at a specific acquistion rate (e.g., 1MHz), and writing this data to file - and repeating this acquisition/logging at a specific repetition rate (e.g., 50Hz).  Pretty straightforward I think, but I am unsure of how to go about doing this in order to maximize the repetition rate.     
    Any insight is appreciated!
    Thanks,
    Vic

    First thing's first: get the acquire and log working.
    Look in the example finder for a simple Analog Input (don't remember the exact name right now).  You will want to configure the task to be Finite Samples.  So you acquire N samples at Fs rate, read the data, and log it to a TDMS file.
    Once you have that working, put it inside of a While loop.  Use a wait inside of the loop to regulate how often you run this task.  You can actually setup the task before this close and close it out after the loop.  Same for the TDMS file.

Maybe you are looking for

  • TCODE to find users Looged in the system

    Hi Friends, I want to see all the USERS logged into any of the SAP system. Thanks, Ster

  • Time recording & transfer to cProjects

    Hi, I have successfully integrated cProjects and CATS. The CATS and cProjects are in different systems. The task that has been created in the cProjects gets reflected in the cat2 transaction against the employee who has been allocated the task in cPr

  • LMS 4.2.2 virtual appliance fresh install : DCR Server Error

    Hello, I have installed a new version of LMS 4.2 on virtual appliance (VMware 4.1) and I have an issue. When I go the "Device Administration --> Manage Device State" I have the following error : Server Error Error Error in communicating with DCR Serv

  • How do I reduce the size of a PDF file?

    Hi, I cant reduce the size of documents that i have scanned, so my emails are all way too big to send online. Help! Also i used to be able to check the size of a document by "command"  "i" and this doesnt seem to work anymore. Is there another easy w

  • "Up Mix" from 2-channel "Stereo" audio content to 5.1/7.1 Surround

    Hello, This is a feature that I had strongly hoped would make it to Media Center in Windows 8, but didn't.  Please consider this for a future update and/or the next version of Windows... Feature Request:  "Ability to Configure Stereo Up-Mix Capabilit