VB arbitrary waveform signal generation problom

Post your .Net discussions here
yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

Re: VB arbitrary waveform signal generation problom

Post by yangzhaoshu »

the time interval is 0.8us as your command, hope it helps
thank you
Attachments
data&pic.rar
(105.36 KiB) Downloaded 274 times

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VB arbitrary waveform signal generation problom

Post by Martyn »

The problem you are having is that the sampling of the wave is too slow for the speed of the wave.

If you look at 20130124-A0001.bmp you will see it is starting to look like the wave you have in your buffer repeated many times. If you can change the sample rate on your scope to the nsec range, by using timebases in the usec, range and you should see the wave spread out and look even cleaner.
Martyn
Technical Support Manager

yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

Re: VB arbitrary waveform signal generation problom

Post by yangzhaoshu »

Dear Martyn,
I was working on the problem for nearly a week; some phased progress has been acquired, for the entire waveform is already generated when I set the waveformsize twice of the real length of the sequence generating the wave, but there are still some zero- points are interpolated between the real points, making the while wave looks like the pictures I attached.
Is it an oversampling problem, and how can I avoid these unwelcomed zero-points? From my point of view, I don’t believe that the problem lies in the impropriate time interval because as the code you sent to me:

Code: Select all

delta = ((frequency * arbitrarywavesize) / 4096) * 4294967296# * 0.00000002
If the frequency is set 50Hz, according to Shannon sampling theorem, the sampling rate could be just set as 100Hz, which means that a time interval of 0.01 second is enough, while the actual time resolution is much higher than 0.01s, there must be some unwelcomed zero points was interpolated between the useful points generated by the sequence in waveform buffer.
I have done a serial of experiments, the frequency was respectively 50Hz, 100Hz, 1000Hz, and 10000Hz. The results are attached.
Thank you
Attachments
result.rar
(39.96 KiB) Downloaded 390 times

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VB arbitrary waveform signal generation problom

Post by Martyn »

I am out of the office today.

If you are getting low/zero values out then they are probably in the buffer. Therefore I would suggest you look carefully at the data populating the waveform buffer as I am guessing that when you are reading your file in and populating the buffer some erroneous values are being added.
Martyn
Technical Support Manager

yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

Re: VB arbitrary waveform signal generation problom

Post by yangzhaoshu »

I have checked and I don't find anything wrong because all the elements are successfully read into the parameter of arbitrarywaveform, and the length of arbitrarywaveform just equals to that of the set sequence.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VB arbitrary waveform signal generation problom

Post by Martyn »

Can you send me an exact copy of the contents of the arbitrary waveform buffer that is passed to the driver.
Martyn
Technical Support Manager

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: VB arbitrary waveform signal generation problom

Post by Martyn »

The AWG uses a phase accumulator to synthesize the output waveform from the samples in the waveform buffer, hence the equation to define phase from frequency. Your buffer contains a waveform with both a positive and negative component defined in 4096 samples, the positive part taking up the first half and the negative part the second half, yet the waveforms in your screen shots are all positive.

The reason for this is that the waveform buffer values are being converted to 16 bit integers as they are passed through to the driver resulting in a 4096 byte buffer in the driver that consists of the first 2048 values of your waveform with zero values between each one to make up the 4096 samples.

When the signal is created by the phase accumulator some of the time you are getting a true value and other times you are getting a zero, the balance is dependent upon the chosen frequency as this will define how the accumulator steps through the buffer. If you chose frequencies at 1024,2048, 4096 I think you would either get a clearer half wave of your signal with a few points at zero, or a zero signal with a few points corresponding to the actual waveform.

To solve this problem you need to ensure that the driver receives an array of bytes so please check the function declaration and the waveform declaration to ensure these are correct. If you are unsure post these.
Martyn
Technical Support Manager

yangzhaoshu
Newbie
Posts: 0
Joined: Sat Jan 05, 2013 12:46 pm

Re: VB arbitrary waveform signal generation problom

Post by yangzhaoshu »

dear martyn
the problem is fainlly solved with your continuous help, and since I figure you may live in Cambirdge, a special gift is prepared for you which is attached, I hope you would enjoy it.
Attachments
Saying Good-bye to Cambridge Again.txt
(2.31 KiB) Downloaded 408 times

Post Reply