Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Center Frequency for niFgen OSP Advanced?

May I cut in? 🙂
 
Yes, Jeiyi, the code you sent a screenshot of will create a chirp.  However, the amplitude is not correct, and the frequency may not be correct either.  Amplitude is currently set to 1, but it should be set to the square root of the maximum phase offset in the chirp.  The chirp maximum phase offset depends on multiple things:
   - chirp bandwidth (400 kHz in your case)
   - chirp duration
   - IQ rate (3.125 MHz in your case)
The one thing piece of info I don't have for your application is the chirp duration.  I would tell you the formula, but it is not easy to type up.  The best thing to do I think would be to plug your numbers into the 'RFSG Large Arbitrary Waveform Generation.vi' example to find out the correct values for amplitude and frequency.
 
By the way, there are lots of ways to do this.  The 'RFSG Large Arbitrary Waveform Generation.vi' is built to generate waveforms that are potentially hundreds of millions of samples long.  For this use case, the VI wound up being somewhat complicated in order to increase speed by reducing computer memory usage.  A simpler way would be to use the modulation toolkit and feed a simple ramp waveform into the FM modulator.  The attached example does exactly that.  It is compiled in LV 8.2.  This might get you up and running quicker, and will probably be plenty fast for your use case (takes ~1 second to generate a 1 million sample waveform on my 3.2 GHz machine).
 
-- McKay
 
0 Kudos
Message 11 of 27
(5,866 Views)
HI Kalyan,
 
Hope you can help me out in this. 
 
I'm still unable to generate and intergrate the required waveform for my sweeping theta. :womansad:
 
Is it possible that you help me out in this.
 
Thanks.
Jieyi
0 Kudos
Message 12 of 27
(5,837 Views)

Hi Jieyi,

McKay's is much more elegant and easier for your application.

I have integarted the VI posted by him with one of our shipping example. I was able to sweep through 400kHz as you have requested on top of 25MHz carrier. I have observed the output of the 544x on Scope and saw the sine sweep in frequency domain.

Attached zip file has vI's which should help you out. "Chirp Generation.vi" si the main VI. Let me know how it goes.

Thanks,

Kalyan

 

 

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 13 of 27
(5,815 Views)
Hi,
 
I have separated the Sine and Cosine wave as you have described.
 
But now i'm face with another new problem..Smiley Sad
 
Could you assist me in solving this.. thanks..
 
The Carrier Freq = 25MHz
Sweeping BW = 200K
Sweeping Rate = 1K
Fm = Sweeping between within the sweeping bandwidth
(as for a start, i have set it to a fixed value)
 
I couldn't use the Chirp function as I am unable to keep track of the phase. 
 
Thanks in advance.
Jieyi
0 Kudos
Message 14 of 27
(5,667 Views)
Hi Jieyi,
 
Can you explain to me what you mean by tracking the phase in the statement below and how are you planning to keep track of phase.
 
I couldn't use the Chirp function as I am unable to keep track of the phase. 
 
This will help me understand your application better and help you better.
 
Thanks,
Kalyan
Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 15 of 27
(5,636 Views)

Because I need to continuously generate a sweeping waveform to be sent into my UUT.  As this waveform is of a huge amount, ideally I will need to do streaming.

 

As this is a sweeping waveform, +/- 200k from Fc, I will need to monitor the phase.  This is needed as the waveform generated is not fixed.  It can be a sine, triangle, BPSK signals...

 

When there is a change in waveform, I need to maintain the phase continuality.   The concept you suggested for me to separate the IQ signal seems ideal as I can fix my Wc, while I keep building the array for Wm to be send it for the sweeping effect. 

 

I hope I have give u a clearer picture of my application.

Jieyi
0 Kudos
Message 16 of 27
(5,630 Views)
Hi Jieyi,
 
I took a quick glance at your code. The sampling rate of the cosine and sine waves generated should be equal to IQ Rate. Also, you were generating single point. The sine wave and cosine wave are functions of time with respect to I/Q rate.
 
An important thing I want to mention is that when you generate these sine and cosine waves, you want to generate for proper number of cycles to get accurate frequency.
For example, if you are trying to generate 1.1kHz at IQ rate of 1MS/s. The number of samples in each cycle of the waveform will be 1M/1.1k =909.09. To get proper frequency, you would have to generate 100 cycles (with samples 90909). Also at the sametime, this number should be multiple of quantum. The quantum for 5441 is 4samples. This means that the number of samples downloaded should be multiple of 4. The 90909 samples should be coerced to 90912. Another method is not worry about frequency and keep track of phase.
 
I am attaching sample code which will show you how to implement the concept. However, this sample code doesn't inlcude generating appropriate number of cycles. You probably want to modify code accordingly as I am not sure how you want to implement. Let me know if I am not clear.
Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 17 of 27
(5,614 Views)
Hi Kalyan,
 
Is it possible for you to save the file in LabVIEW 8.0 format.  Thanks.
Jieyi
0 Kudos
Message 18 of 27
(5,603 Views)
Here is the LabVIEW 8.0 version of the file. Since you cannot save back the toolkit VI's I attached a couple files that you may need to open it with LabVIEW 8.0.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 19 of 27
(5,585 Views)
Hi,
 
Attached is the sample code which I have created to generate the required Re-Im count-up sequence.  Is this is the correct way of doing it?
 
I try to merge it into the program above, but it fails... Robot Sad
 
sin( [wc + wm]t )
wc = center freq of NCO
wm = sweeping freq
       = 2 * pi * f * t
 
the counter which i have created is meant to create the wm, where f is the sweeping freq within the limit. and t is the sample rate.
 
n = 0, f =0, t = 0,  o/p = 0
 
n = 1, f =R*n*(4/3.125M), t = n*(4/3.125M),  o/p = 2 * pi * f * t
 
n = 2, f =R*n*(4/3.125M), t = n*(4/3.125M),  o/p = 2 * pi * f * t
 
Is this the correct way for me to gen the streaming data??
Jieyi
0 Kudos
Message 20 of 27
(5,413 Views)