VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

performing frequency sweep in stimulus profile editor

Solved!
Go to solution

Hello all,

 

I am trying to figure out what the easiest way of doing this is.

 

I have a output signal. I want to start with a 5V signal, then I want to make it into a sinewave with an amplitude of 0.05V starting at 1Hz and gradualy increase the frequnecy, sweeping it up to 500Hz. I know there is a sine wave function in stimulus profile editor, but it seems to want to hold the frequency fixed.

 

Thanks.

0 Kudos
Message 1 of 4
(7,961 Views)
Solution
Accepted by topic author oeua.uoeuoau

There are a few options:

 

1. Make your own sinewave sequence that will sweep the frequency as it plays. The built-in sinewave function is just a sequence that you can view and copy to modify however you want. Double click it in the palette to view the sequence.

2. Use multi-tasking and the built-in sine wave sequence. The SineWave sequence does take in a parameter for Frequency, but it takes that value in by reference. This means that if the value mapped to the Frequency parameter changes while the SineWave sequence is executing, the frequency of the sine wave will update, too. This allows you to use a multi-task structure to run two parallel tasks: one to call SineWave and one to ramp the frequency variable.

 

Attached is an example to help you make some sense of this. This may not be the exact logic you want, but should help you get some ideas going. Hope this helps!

Jarrod S.
National Instruments
Message 2 of 4
(7,957 Views)

A while back, I made some point-by-point sinewave functions, including one for perforning a frequency sweep of a sinewave.  To execute the function, you provide th normal sinewave parameters (amplitude, frequency, etc...) as well as a starting frequency and a sweep rate.  This function would then be called repeatedly from another sequence which is responsible for incrementing the Time arguement.

 

In the attached example, the "PlayWfm" sequence will generate a signal for a fixed duration.  The signal generated depends on the "Function" input (set Function = 2 for a linearly swept sine wave).  Note that you could create your own caller for the SweptSine function which stopped when the frequency reached 500 Hz, instead of lasting for a fixed duration like the example.

Message 3 of 4
(7,945 Views)

Thank you to both replies. They were both very helpful.

0 Kudos
Message 4 of 4
(7,932 Views)