generating arbitrary waveforms with zynq 7000 series - Page 1
Forum section: electronics / general

author: ant17
author_rank: Regular Contributor
timestamp: November 17, 2019, 04:01:53 am
content: hi i am wanting to be able to generate arbitrary waveforms such as time mark waveforms square waves sine waves and sawtooth but i need it to be be able to generate them at up to 400mhz is this possible using this fpga and what would be the best way to implement it if someone could help i would be greatful thanks

author: colorado.rob
author_rank: Frequent Contributor
timestamp: November 17, 2019, 04:21:58 am
content: 400 millihertz is certainly doable using simple PWM and low-pass filtering.

author: ant17
author_rank: Regular Contributor
timestamp: November 17, 2019, 04:46:22 am
content: thanks for your reply but meant 400 megahertz

author: FlyingDutch
author_rank: Regular Contributor
timestamp: November 17, 2019, 08:54:32 am
content: Hello,it depends with how resolution (number of samples) you would like to generate for example sine wave. I think such high frequency is not achievable, but maybe someone has knowledge which I not know in such case I ask for correction. See for examnple these links:https://www.xilinx.com/products/intellectual-property/dds_compiler.htmlhttps://forums.ni.com/t5/LabVIEW/DDS-Compiler-Xilinx-Coregen-IP-maximum-achievable-clock-rate/td-p/1979773?profile.language=enhttps://forums.xilinx.com/t5/AI-Engine-DSP-IP-and-Tools/about-DDS-compiler-and-parameters/td-p/650067Regards

author: tggzzz
author_rank: Super Contributor
timestamp: November 17, 2019, 08:55:44 am
content: youneedtostartbydefiningtheclockrateyourapplicationnrequires.(Conventional punctuation and accurate terminology seem to be an optional extra for the OP. If they can't be bothered to make their posts easy toreadneither can I)

author: filssavi
author_rank: Frequent Contributor
timestamp: November 17, 2019, 10:58:32 am
content: Using just the zynq alone it will be difficult to nigh on impossible, however if you throw an external dac in the mix, it gets much easier, and the main difficulty becomes the interface (you might have to go jesd)Depending on the number of points the number several solutions might be possibleFor the logic in fpga1)store 1 waveform cycle in 2/4 Ram blocks (interleaved) and then use a pll block to generate two clocks with the correct phase shift and frequency2) if a cycle has too much data to fit in block ram then you. An use DMA or a core to load the next batch in the background from DDR3

author: ant17
author_rank: Regular Contributor
timestamp: November 17, 2019, 10:16:28 pm
content: sorry i left out alot of detail i wanted to use a zynq xc7020 with a external 32bit dac. I was thinking for the nyquist frequency i would need sample at 1gsps.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 17, 2019, 10:21:09 pm
content: So you're thinking of using a 32-bit, 1Gsps DAC?

author: NorthGuy
author_rank: Super Contributor
timestamp: November 17, 2019, 10:46:03 pm
content: Quote from: ant17 on November 17, 2019, 10:16:28 pmNyquist frequency is about sampling, not about wave generation.The best way is to read the datasheet for your DAC. It explains what the DAC can or cannot do.

author: hamster_nz
author_rank: Super Contributor
timestamp: November 17, 2019, 10:59:13 pm
content: Quote from: ant17 on November 17, 2019, 10:16:28 pmLooking athttps://en.wikipedia.org/wiki/Sawtooth_wave#/media/File:Sawtooth-td_and_fd.png, from a mathematical point of view there would be no chance of a 1GS/s DAC generating anything like a saw-tooth wave at 400 MHz. At a rough guess, for a sawtooth you would need to have a sample rate 11x that of the fundamental, and that would only allow you to get to the 5th harmonic, so would still be pretty "unsawtooth" like.As a warm up, get yourself a 1MS/s DAC (should be plenty around), and see if you can generate a 400kHz sawtooth, or simpler still, try generating a 19.2kHz sawtooth using a 48kS/s sound card and viewing it on an oscilloscope's FFT.

author: tggzzz
author_rank: Super Contributor
timestamp: November 17, 2019, 11:27:31 pm
content: Quote from: NorthGuy on November 17, 2019, 10:46:03 pmNo.It is about being able toreconstructthe original waveform from the samples.

author: ant17
author_rank: Regular Contributor
timestamp: November 17, 2019, 11:39:19 pm
content: So to do it i would need to sample the dac at 5GS/S or 6GS/s.

author: tggzzz
author_rank: Super Contributor
timestamp: November 17, 2019, 11:44:16 pm
content: Quote from: hamster_nz on November 17, 2019, 10:59:13 pmThere isnever anychance of generating a sawtooth wave.Thereis the certaintyof being able to generate a usable approximation to a triangle wave. But thatcritically depends on the use being definedin sufficient detail that the effects of the approximation can be shown to be acceptable.So, any choice of, say, the 11th harmonic is purely speculative and may or may not be useful/relevant.

author: tggzzz
author_rank: Super Contributor
timestamp: November 17, 2019, 11:48:05 pm
content: Quote from: ant17 on November 17, 2019, 11:39:19 pmWho knows?You have to define the use of the waveform, and assess the affect an imperfect waveform will have on your system's operation.While you are doing that you should assess the effect of all the imperfections in practical DACs (see my .sig!). Sometimes entire systems are architected so as to minimise such effects.

author: NorthGuy
author_rank: Super Contributor
timestamp: November 18, 2019, 12:13:38 am
content: Quote from: tggzzz on November 17, 2019, 11:27:31 pmYou're right. If you're generating an arbitrary wave from a set of samples, you cannot generate it correctly if the information is not there.

author: asmi
author_rank: Super Contributor
timestamp: November 18, 2019, 03:57:13 am
content: Quote from: SiliconWizard on November 17, 2019, 10:21:09 pmIf such thing exists, it probably costs more than my car...

author: hamster_nz
author_rank: Super Contributor
timestamp: November 18, 2019, 04:14:35 am
content: Quote from: tggzzz on November 17, 2019, 11:44:16 pmMaybe, but not much more speculative than most answers to this post, and I did preface it with "at a guess".Attached are three different images, using the 1st to 3rd harmonics, the 1st to 5th harmonics, and the 1st to 11th harmonics. The O.P. can see what a difference this makes.However, they are all bandwidth filtered sawtooths, so I really have no opinion, other than 1GS/s won't give you a 400MHz sawtooth.

author: ant17
author_rank: Regular Contributor
timestamp: November 18, 2019, 05:07:59 am
content: ok i get the picture

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 18, 2019, 04:52:25 pm
content: Anyway, signal generators are usually specified (like oscilloscopes, for the dual problem) for their analog bandwidth and max sample rate. For a scope, for instance, no vendor is going to tell you that you can acquire a signal other than a sine wave at the max frequency for the rated bandwidth, because as it's been explained to you above, it wouldn't make sense. It's your job as a user to derive what you can do with an analog bandwidth of such.Again, signal generators usually have just the above specified, and it's all that matters (and of course output amplitude range + output impedance).And that said, designing a 400MHz (analog bandwidth) DDS signal gen. is already pretty challenging. I kind of doubt it's in the amateur territory already. Regarding the teasing question I asked earler: call me when you find an off-the-shelf 32-bit, 1GSps DAC. Completely unrealistic IMO. If that thing ever existed, it would probably cost a fortune. But you probably don't need 32-bit either.Now if you want to generate, say, square waves @400MHz, your best bet would be to generate them as a digital output directly, with possibly an high-speed VGA after that to set the amplitude. (Could also be done with some kind of level shifter.) Again, at those frequencies, it won't be anything trivial already.

author: Marco
author_rank: Super Contributor
timestamp: November 18, 2019, 05:18:45 pm
content: To get a high fidelity sawtooth at 400 MHz you need many GS/s ... just buy DAC38RF80EVM and TSW14J56EVM, a single Zynq 7000 with enough transceivers to drive the DAC38RF80 costs as much as the complete driver board EVM.

author: tggzzz
author_rank: Super Contributor
timestamp: November 18, 2019, 06:00:03 pm
content: Quote from: SiliconWizard on November 18, 2019, 04:52:25 pmThat has a characteristic that is often a critical problem: jitter due to the digital clock plus quantisation jitter. The latter is particularly obvious on the output of ublox GPS receivers: try to get a 10MHz output with a 48MHz clock. That's fine on average, but tye short term jitter is 21ns. OTOH an 8MHz has only the jitter in the internal 48MHz clock.If you want a low jitter square wave, it is better to generate a sine wave using a DDS, then aggressively filter it, then drive a comparator and use comparator's output as the clock.

author: OwO
author_rank: Super Contributor
timestamp: November 19, 2019, 03:51:47 am
content: Depends how you generate the output. If you use a dedicated PLL for it you won't have quantization jitter but the PLLs in an FPGA aren't very clean either (lots of spurs and phase noise). But if all you want is a square wave up to 500MHz you can just use a ADF4351...

author: m98
author_rank: Frequent Contributor
timestamp: November 27, 2019, 11:41:36 am
content: Quote from: NorthGuy on November 17, 2019, 10:46:03 pmOne thing is the reverse of the other. Just that implementing a good reconstruction filter is much harder on the analog side.Now for generating a sawtooth-wave approximation at up to 400 MHz, I guess that needs custom circuits tuned to a limited frequency range each, clocked by the FPGA.

author: rstofer
author_rank: Super Contributor
timestamp: November 27, 2019, 04:37:35 pm
content: The replies in this thread won't be any different than the replies in your other thread:https://www.eevblog.com/forum/beginners/how-arbitray-waveforms-are-generated/You aren't going to buy a Zynq board and somehow come up with an AWG with a higher output frequency than the test equipment manufacturers, people who do it for money! Although, there is a Keysight board with those specs.I showed you an example plot of a simple cosine wave sampled at 10x and 100x. The 10x plot looks pretty crude and that's for a cosine, one of the easiest things to generate. I gave you the code, run it through Octave with 2.5 samples instead of 10. The waveform is unrecognizable.Fourier, Nyquist and Shannon (and a lot of math) are going to prevent you from constructing decent approximations without higher order harmonics. Your 400 MHz thing sounds good but to get the 9th harmonic of a square wave means clocking a sine wave at 3.6 GHz. I don't think the Zynq will run that fast! Apparently PC DRAM will run at those speeds, or so the advertising says, and that would be excellent if the waveform is in the form of a table. DDS generation is an entirely different animal.About 1/4 the way down this page, there is a simple square wave being formed from harmonics of a sine wave. You can select the upper harmonic clear up to the 21st (around 8.4 GHz for a 400 MHz square wave) and it just barely starts to resemble something square. The corners still aren't quite right and won't be until the infinite harmonic. How good is good enough?https://lpsa.swarthmore.edu/Fourier/Series/ExFS.htmlThe math doesn't favor your project. You just can't generate the higher order harmonics necessary to reproduce even simple periodic functions. True arbitrary waveforms are going to be table driven and still with limited bandwidth.BTW: That is the best paper I have ever seen on Fourier Series. Far better than the class I took in school. Triangle and sawtooth waveforms are also discussed.Here is a commercial version by Keysight that is in the form of a PC card.https://www.keysight.com/en/pd-2747446-pn-M3202A/pxie-arbitrary-waveform-generator-1-gs-s-14-bit-400-mhz?cc=US&lc=engI don't care how they spec if, 1 GSa/s won't produce an arbitrary waveform of 400 MHz with any fidelity because Fourier said so.