Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006

Toggling Between Two Pulse Train Frequencies (Frequency Shift Keying)

3 ratings | 3.33 out of 5
Print | PDF
The DAQ-STC (for E Series devices) and the NI-TIO (for NI PCI/PXI-660x devices) allow a counter to generate a second pulse train frequency, depending on the state of the gate input. This application is known as frequency shift keying (FSK). FSK can be programmed through the NI-DAQ API by calling the GPCTR_Set_Application function with the application parameter set to ND_FSK. Am9513- and 8253-based devices do not offer this functionality.

In FSK, the counter generates a pulse train of one frequency and duty cycle when the gate is low, and it generates a pulse train with a second set of parameters when the gate is high. The NI-DAQ API for the DAQ-STC and the NI-TIO call these parameters ND_COUNT_1, ND_COUNT_2, ND_COUNT_3, and ND_COUNT_4. The pulse train output when the gate is low is determined by the ND_COUNT_1 and ND_COUNT_2 parameters, and the pulse train when the gate is high is determined by the ND_COUNT_3 and ND_COUNT_4 parameters. While the gate is low, ND_COUNT_1 determines the length of the inactive phase of the pulse. ND_COUNT_2 determines the length of the active phase of the pulse. While the gate is high, ND_COUNT_3 determines the length of the inactive phase, and ND_COUNT_4 determines the length of the active phase. Use the GPCTR_Change_Parameter function to set the values of the count parameters for FSK.



Frequency Shift Keying Signal Timing

The output frequency is source_frequency / (ND_COUNT_1 + ND_COUNT_2), and the duty cycle (assuming positive polarity) is ND_COUNT_1 / (ND_COUNT_1 + ND_COUNT_2). Since ND_COUNT_1 + ND_COUNT_2 must be an integer (and may be additionally constrained), the counter can only produce a discrete number of frequencies, but as the desired frequency becomes increasingly smaller compared to the source frequency, the produced frequency will be more likely to exactly match the desired frequency.


Related Links:
Can the 660X or E Series Counter/Timer Device Generate This Frequency?

3 ratings | 3.33 out of 5
Print | PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).