09-14-2009 05:47 PM
I need to generate a swept square wave waveform. I was hoping to just use the Arbitrary Waveform Editor to do this. Unfortunately the capability is not there. I will have to write a separate program to make this swept square wave, then import the waveform into the arbitrary Waveform Editor to do further processing.
NI, you should include this capability! The code is already written to do this: check out this program. sqr_wave_frq_sweep.zip at http://zone.ni.com/devzone/cda/epd/p/id/3339. ( Just delete the Legacy DAQ vi's)
Also, I was trying to get around not being able to do the square wave sweep in the Arbitrary Waveform Editor by defining several components in a row, with each component being a pulse with different widths. Then after I did that I was going to multiply All the pulses together by another waveform that I wanted to create. Then I ran into a Problem. Since the waveform was made up of different components, I couldn't just multiply the waveform by another waveform. There needs to be a way to save out a waveform made up of several components to a waveform with just one component.
Also, If these features do exist, and i am overlooking them, please let me know!
09-15-2009 12:05 PM
Hi Ben,
Thanks for the feedback. I’ll make sure to record it in our database for consideration in future releases of the product.
Although we do not have an explicit swept square waveform, I think we can accomplish what you want via the formula primitive. In the Component Editor, select Formula as your primitive (second from the bottom of the list). Then for your formula, try something like square(.00001*x^2). This formula uses the square function but makes it dependent on the square of x – basically causing the frequency to be ramped linearly as a function of x. The constant may need to be adjusted based on what you want the starting frequency to be, the number of samples in your component, etc. See attached screenshot.
The second functionality you requested does already exist. You will want to follow the following steps:
1. Save the waveform with multiple components to disk.
2. Create a new waveform and launch the Component Editor.
3. For the primitive type, select “Custom – From File” – the last option in the list.
4. Click the “Load from File” button and select the waveform you saved in step #1.
5. The waveform will be imported as a single custom primitive that you can manipulate.
See attached screenshot.
Hope this helps. Let me know if you have any questions.
Matt Kisler
Signal Generators R&D
09-18-2009 01:24 PM
Thank you so much, Matt. That is exactly the solution to what I was trying to do. You know after evaluating several waveform editor software packages, the Arbitrary waveform editor has come out on top.
Also, I have written out the equation to make the square function simulate a frequency swept square wave.
The square wave frequency sweep equation in in the attached picture.
09-18-2009 01:35 PM
09-20-2009 08:28 PM
Hi Ben,
I’m happy to hear that the solution worked for you. Nice job on the equation - I looked it over and I came up with the same thing:
square[(2/Fs)*(freq1*x + .5*(freq2-freq1)*x^2/#samples)] – I just used (2/Fs) for 1/Nyquist Frequency and #samples for total waveform time * sample rate.
I agree that the sampling rate would be very handy to have as a variable in the formula primitive. # of samples would also be nice. I’ve added both to the database for consideration for future enhancements to the AWE.
Matt Kisler
Signal Generators R&D