Author Topic: generating arbitrary waveforms with zynq 7000 series  (Read 3634 times)

0 Members and 1 Guest are viewing this topic.

Offline ant17Topic starter

  • Regular Contributor
  • *
  • Posts: 95
generating arbitrary waveforms with zynq 7000 series
« on: November 17, 2019, 04:01:53 am »
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
 

Offline colorado.rob

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: us
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #1 on: November 17, 2019, 04:21:58 am »
400 millihertz is certainly doable using simple PWM and low-pass filtering.
 
The following users thanked this post: ant17

Offline ant17Topic starter

  • Regular Contributor
  • *
  • Posts: 95
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #2 on: November 17, 2019, 04:46:22 am »
thanks for your reply but meant 400 megahertz
 

Offline FlyingDutch

  • Regular Contributor
  • *
  • Posts: 147
  • Country: pl
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #3 on: November 17, 2019, 08:54:32 am »
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.html

https://forums.ni.com/t5/LabVIEW/DDS-Compiler-Xilinx-Coregen-IP-maximum-achievable-clock-rate/td-p/1979773?profile.language=en

https://forums.xilinx.com/t5/AI-Engine-DSP-IP-and-Tools/about-DDS-compiler-and-parameters/td-p/650067

Regards
 
The following users thanked this post: ant17

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20583
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #4 on: November 17, 2019, 08:55:44 am »
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 to read neither can I)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline filssavi

  • Frequent Contributor
  • **
  • Posts: 433
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #5 on: November 17, 2019, 10:58:32 am »
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 possible
For the logic in fpga
1)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 frequency
2) 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
 
The following users thanked this post: ant17

Offline ant17Topic starter

  • Regular Contributor
  • *
  • Posts: 95
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #6 on: November 17, 2019, 10:16:28 pm »
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.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15312
  • Country: fr
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #7 on: November 17, 2019, 10:21:09 pm »
So you're thinking of using a 32-bit, 1Gsps DAC?
 ::)
 
The following users thanked this post: Bassman59

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3246
  • Country: ca
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #8 on: November 17, 2019, 10:46:03 pm »
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.

Nyquist 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.
 
The following users thanked this post: ant17

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #9 on: November 17, 2019, 10:59:13 pm »
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.

Looking at https://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.
« Last Edit: November 17, 2019, 11:02:56 pm by hamster_nz »
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: ant17

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20583
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #10 on: November 17, 2019, 11:27:31 pm »
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.
Nyquist frequency is about sampling, not about wave generation.

No.

It is about being able to reconstruct the original waveform from the samples.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: ant17

Offline ant17Topic starter

  • Regular Contributor
  • *
  • Posts: 95
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #11 on: November 17, 2019, 11:39:19 pm »
So to do it i would need to sample the dac  at 5GS/S or 6GS/s.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20583
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #12 on: November 17, 2019, 11:44:16 pm »
Looking at https://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.

There is never any chance of generating a sawtooth wave.

There is the certainty of being able to generate a usable approximation to a triangle wave. But that critically depends on the use being defined in 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.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: ant17

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20583
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #13 on: November 17, 2019, 11:48:05 pm »
So to do it i would need to sample the dac  at 5GS/S or 6GS/s.

Who 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.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: ant17

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3246
  • Country: ca
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #14 on: November 18, 2019, 12:13:38 am »
No.

It is about being able to reconstruct the original waveform from the samples.

You'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.
 
The following users thanked this post: ant17

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2797
  • Country: ca
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #15 on: November 18, 2019, 03:57:13 am »
So you're thinking of using a 32-bit, 1Gsps DAC?
 ::)
If such thing exists, it probably costs more than my car...
 
The following users thanked this post: ant17, BrianHG

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #16 on: November 18, 2019, 04:14:35 am »
Looking at https://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.

There is never any chance of generating a sawtooth wave.

There is the certainty of being able to generate a usable approximation to a triangle wave. But that critically depends on the use being defined in 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.

Maybe, 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.

Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: ant17

Offline ant17Topic starter

  • Regular Contributor
  • *
  • Posts: 95
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #17 on: November 18, 2019, 05:07:59 am »
ok i get the picture
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15312
  • Country: fr
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #18 on: November 18, 2019, 04:52:25 pm »
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.

« Last Edit: November 18, 2019, 04:54:45 pm by SiliconWizard »
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6945
  • Country: nl
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #19 on: November 18, 2019, 05:18:45 pm »
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.
« Last Edit: November 18, 2019, 05:22:24 pm by Marco »
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20583
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #20 on: November 18, 2019, 06:00:03 pm »
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.

That 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.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline OwO

  • Super Contributor
  • ***
  • Posts: 1250
  • Country: cn
  • RF Engineer.
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #21 on: November 19, 2019, 03:51:47 am »
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...
Email: OwOwOwOwO123@outlook.com
 

Offline m98

  • Frequent Contributor
  • **
  • Posts: 630
  • Country: de
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #22 on: November 27, 2019, 11:41:36 am »
Nyquist frequency is about sampling, not about wave generation.
One 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.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9933
  • Country: us
Re: generating arbitrary waveforms with zynq 7000 series
« Reply #23 on: November 27, 2019, 04:37:35 pm »
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.html

The 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=eng

I 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.
« Last Edit: November 27, 2019, 04:47:45 pm by rstofer »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf