Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Witch! Witch! They'll burn ya! -- Hag, "Tomorrow is Yesterday", stardate unknown


devel / comp.arch.embedded / Re: Wide frequency range, arbitrary waveform DDS

SubjectAuthor
* Wide frequency range, arbitrary waveform DDSStef
+- Re: Wide frequency range, arbitrary waveform DDSRick C
`* Re: Wide frequency range, arbitrary waveform DDSantispam
 `- Re: Wide frequency range, arbitrary waveform DDSStef

1
Wide frequency range, arbitrary waveform DDS

<nnd$14eac489$5ab7230c@c29d2e0012419321>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=987&group=comp.arch.embedded#987

  copy link   Newsgroups: comp.arch.embedded comp.arch.fpga
Newsgroups: comp.arch.embedded,comp.arch.fpga
From: me...@this.is.invalid (Stef)
Subject: Wide frequency range, arbitrary waveform DDS
Mail-Copies-To: nobody
User-Agent: slrn/1.0.3 (Linux)
Message-ID: <nnd$14eac489$5ab7230c@c29d2e0012419321>
Organization: Newsxs
Date: Tue, 16 Aug 2022 17:37:34 +0200
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!feeder.usenetexpress.com!tr1.eu1.usenetexpress.com!94.232.112.244.MISMATCH!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.newsxs.nl!not-for-mail
Lines: 29
Injection-Date: Tue, 16 Aug 2022 17:37:34 +0200
Injection-Info: news.newsxs.nl; mail-complaints-to="abuse@newsxs.nl"
 by: Stef - Tue, 16 Aug 2022 15:37 UTC

To generate frequencies from approximately 0.5 mHz to 12 MHz with a DDS
a minimum clock of >24, say 25 MHz, is required. To be able to go down
to 0.5 mHz, a phase accumulator of at least 36 bits is required. This
will give sub mHz resolution over the entire range. Nice for the low
frequencies, but not of much use for MHz frequencies (in this
application).

Is there any objection to using a smaller phase accumulator and a clock
pre-scaler to generate the lower frequencies?

I see Analog Devices has DDS chips up to 48 bits, so 36 bits would not
be a problem (except for cost maybe).

But al of the DDS chips I find from Analog seem only to implement a
fixed sine table/function. Do DDS chips exist that allow downloading an
arbitrary lookup table with 2^10 - 2^16 entries of 10 - 16 bit each?

If no such standard chips exist, I expect I need to implement the DDS
in an FPGA. Using a smaller accumulator would probably save some space
in the FPGA. Or am I just optoimizing prematurely?

--
Stef

Baker's First Law of Federal Geometry:
A block grant is a solid mass of money surrounded on all sides by
governors.

Re: Wide frequency range, arbitrary waveform DDS

<53c1d937-af6a-4206-89af-a151c69649a6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=988&group=comp.arch.embedded#988

  copy link   Newsgroups: comp.arch.embedded
X-Received: by 2002:ad4:5ccf:0:b0:474:7201:6789 with SMTP id iu15-20020ad45ccf000000b0047472016789mr20321089qvb.75.1660700633707;
Tue, 16 Aug 2022 18:43:53 -0700 (PDT)
X-Received: by 2002:a25:2b01:0:b0:68a:6dff:4a87 with SMTP id
r1-20020a252b01000000b0068a6dff4a87mr6790322ybr.364.1660700633376; Tue, 16
Aug 2022 18:43:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.embedded
Date: Tue, 16 Aug 2022 18:43:53 -0700 (PDT)
In-Reply-To: <nnd$14eac489$5ab7230c@c29d2e0012419321>
Injection-Info: google-groups.googlegroups.com; posting-host=65.207.89.54; posting-account=I-_H_woAAAA9zzro6crtEpUAyIvzd19b
NNTP-Posting-Host: 65.207.89.54
References: <nnd$14eac489$5ab7230c@c29d2e0012419321>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <53c1d937-af6a-4206-89af-a151c69649a6n@googlegroups.com>
Subject: Re: Wide frequency range, arbitrary waveform DDS
From: gnuarm.d...@gmail.com (Rick C)
Injection-Date: Wed, 17 Aug 2022 01:43:53 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 29
 by: Rick C - Wed, 17 Aug 2022 01:43 UTC

On Tuesday, August 16, 2022 at 11:37:42 AM UTC-4, Stef wrote:
> To generate frequencies from approximately 0.5 mHz to 12 MHz with a DDS
> a minimum clock of >24, say 25 MHz, is required. To be able to go down
> to 0.5 mHz, a phase accumulator of at least 36 bits is required. This
> will give sub mHz resolution over the entire range. Nice for the low
> frequencies, but not of much use for MHz frequencies (in this
> application).
>
> Is there any objection to using a smaller phase accumulator and a clock
> pre-scaler to generate the lower frequencies?
>
> I see Analog Devices has DDS chips up to 48 bits, so 36 bits would not
> be a problem (except for cost maybe).
>
> But al of the DDS chips I find from Analog seem only to implement a
> fixed sine table/function. Do DDS chips exist that allow downloading an
> arbitrary lookup table with 2^10 - 2^16 entries of 10 - 16 bit each?
>
> If no such standard chips exist, I expect I need to implement the DDS
> in an FPGA. Using a smaller accumulator would probably save some space
> in the FPGA. Or am I just optoimizing prematurely?

See my response in comp.arch.fpga

--

Rick C.

- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209

Re: Wide frequency range, arbitrary waveform DDS

<tdjemt$1dft$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=989&group=comp.arch.embedded#989

  copy link   Newsgroups: comp.arch.embedded comp.arch.fpga
Path: i2pn2.org!i2pn.org!aioe.org!NZ87pNe1TKxNDknVl4tZhw.user.46.165.242.91.POSTED!not-for-mail
From: antis...@math.uni.wroc.pl
Newsgroups: comp.arch.embedded,comp.arch.fpga
Subject: Re: Wide frequency range, arbitrary waveform DDS
Date: Wed, 17 Aug 2022 19:14:37 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tdjemt$1dft$1@gioia.aioe.org>
References: <nnd$14eac489$5ab7230c@c29d2e0012419321>
Injection-Info: gioia.aioe.org; logging-data="46589"; posting-host="NZ87pNe1TKxNDknVl4tZhw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: tin/2.4.5-20201224 ("Glen Albyn") (Linux/5.10.0-9-amd64 (x86_64))
Cancel-Lock: sha1:aBrVayC8qZBfA0gxaYZVqGTy554=
X-Notice: Filtered by postfilter v. 0.9.2
 by: antis...@math.uni.wroc.pl - Wed, 17 Aug 2022 19:14 UTC

In comp.arch.embedded Stef <me@this.is.invalid> wrote:
> To generate frequencies from approximately 0.5 mHz to 12 MHz with a DDS
> a minimum clock of >24, say 25 MHz, is required. To be able to go down
> to 0.5 mHz, a phase accumulator of at least 36 bits is required. This
> will give sub mHz resolution over the entire range. Nice for the low
> frequencies, but not of much use for MHz frequencies (in this
> application).
>
> Is there any objection to using a smaller phase accumulator and a clock
> pre-scaler to generate the lower frequencies?

Well, your frequency will be less accurate. To see this let me
derive formula for DDS. Let t be DAC clock, T be period of desired
signal and assume that we have N samples at uniformly distributed
points. At n-th tick of DAC clock real time is nt. In the
scale of desired signal this corresponds to nt/T. To get
position within period we drop integer part of this, that is
take frac(nt/T). Then we need to round to closest sample point.
Actually instead of rounding we can multiply by N, add 0.5 as
bias and take integer part. So, sample index is:

[N frac(nt/T) + 0.5]

where [ ] denotes integer part. Assuming that N is power of 2,
say 2^m and all arthmetic is in fixed point binary frac above
is equvalent to dropping high bits, leaving only m bits before
binary point. Integer part means dropping bits after bianary
points. So formula simplified to

[nNt/T + 0.5] = [n*a + b]

where a = Nt/T and b = 0.5 is time shift. Note that taking

phi_n = n*a + b

we have phi_{n+1} = (n+1)*a + b = a + phi_n so single addition
is enough to adjust phase. What is effect of using smaller
number of bits to represent phase phi_n? Well, b needs only
1 bit, so if Nt/T fits into k bits with k bigger than m + 1,
then calculation using k bits gives exactly the same result
as calculation using infinite precision. In other words,
using k bits we get exact result but possibly for wrong
frequency.

In general acceptable frequency error depends on application.
But since good analog components are more expensive than
digital ones, simple heuristic says that resuluting of
phase accumulator should not degrade accuracy of
oscilator. Assuming few ppm quartz oscilator as source
of DAC clock, this means that we need about 20 significant
bits in parameter a. OTOH, at moderate freqences we do not
want to make big jumps, so parameter a should have m or more
zero bits at start. With m = 10 we arrive at 30 bits. Add
some margin for users that want slightly better results and
we arrive at 36 bits. In fact, if you want 0.5 mHz without
divisor on DAC clock you will have about 35 zero bits
at start of paramter a, so 55 bits phase accumultor would
be more appropriate. However, in in few hundreds Hertz
range and below pre-divisor on DAC clock seem quite
appropriate, so 36 bits + pre-divisor should be OK.

> I see Analog Devices has DDS chips up to 48 bits, so 36 bits would not
> be a problem (except for cost maybe).
>
> But al of the DDS chips I find from Analog seem only to implement a
> fixed sine table/function. Do DDS chips exist that allow downloading an
> arbitrary lookup table with 2^10 - 2^16 entries of 10 - 16 bit each?
>
> If no such standard chips exist, I expect I need to implement the DDS
> in an FPGA. Using a smaller accumulator would probably save some space
> in the FPGA. Or am I just optoimizing prematurely?

If you go for 25 MHz DAC clock your DDS should be doable using
sufficiently fast processor. My rough guesstimate is that
to produce single sample (addjust phase accumulator, extract
bits and copy value) you need about 10 machine instructions,
so 250 MIPS processor should be fast enough to generate
samples. You probably need a DMA channel to transmit them
to DAC. I am not aware of processor with fast enough DAC,
but I think that there are processors capable of driving
external DAC at that speed.

OTOH with 12 MHz signal and 25 MHz DAC clock you essentially
are limited to sinusoidal signals, to have more variety
you need more samples per period, so either lower signal
frequency or higher DAC clock. So you may end up with
much higher DAC freqency and censequenty be forced to
use FPGA.

As I wrote earler, skimming bits on phase accumulator seems
unwise, it is at most one instruction in critical loop
in CPU realization and has _much_ smaller impact on
FPGA (think about size of your tables, single counter
is tiny compared to that).

--
Waldek Hebisch

Re: Wide frequency range, arbitrary waveform DDS

<nnd$3290a642$51a445aa@83f55c0d6939847a>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=990&group=comp.arch.embedded#990

  copy link   Newsgroups: comp.arch.embedded comp.arch.fpga
Newsgroups: comp.arch.embedded,comp.arch.fpga
From: me...@this.is.invalid (Stef)
Subject: Re: Wide frequency range, arbitrary waveform DDS
References: <nnd$14eac489$5ab7230c@c29d2e0012419321> <tdjemt$1dft$1@gioia.aioe.org>
Mail-Copies-To: nobody
User-Agent: slrn/1.0.3 (Linux)
Message-ID: <nnd$3290a642$51a445aa@83f55c0d6939847a>
Organization: Newsxs
Date: Thu, 18 Aug 2022 10:21:44 +0200
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder.usenetexpress.com!tr1.eu1.usenetexpress.com!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp002.abavia.com!news.newsxs.nl!not-for-mail
Lines: 76
Injection-Date: Thu, 18 Aug 2022 10:21:44 +0200
Injection-Info: news.newsxs.nl; mail-complaints-to="abuse@newsxs.nl"
X-Received-Bytes: 3972
 by: Stef - Thu, 18 Aug 2022 08:21 UTC

On 2022-08-17 antispam@math.uni.wroc.pl wrote in comp.arch.embedded:
> In comp.arch.embedded Stef <me@this.is.invalid> wrote:
>> To generate frequencies from approximately 0.5 mHz to 12 MHz with a DDS
>> a minimum clock of >24, say 25 MHz, is required. To be able to go down
>> to 0.5 mHz, a phase accumulator of at least 36 bits is required. This
>> will give sub mHz resolution over the entire range. Nice for the low
>> frequencies, but not of much use for MHz frequencies (in this
>> application).
>>
>> Is there any objection to using a smaller phase accumulator and a clock
>> pre-scaler to generate the lower frequencies?
>
> Well, your frequency will be less accurate. To see this let me
> derive formula for DDS.

<snip detailed DDS math>

>>
>> If no such standard chips exist, I expect I need to implement the DDS
>> in an FPGA. Using a smaller accumulator would probably save some space
>> in the FPGA. Or am I just optoimizing prematurely?
>
> If you go for 25 MHz DAC clock your DDS should be doable using
> sufficiently fast processor. My rough guesstimate is that
> to produce single sample (addjust phase accumulator, extract
> bits and copy value) you need about 10 machine instructions,
> so 250 MIPS processor should be fast enough to generate
> samples. You probably need a DMA channel to transmit them
> to DAC. I am not aware of processor with fast enough DAC,
> but I think that there are processors capable of driving
> external DAC at that speed.

That is assuming the processor has not much else to do and that only a
single DDS channel is required. Both will not be true in the possible
application, I'm affraid. The additional DDS channels can be a bit
slower, so it may still be doable.

> OTOH with 12 MHz signal and 25 MHz DAC clock you essentially
> are limited to sinusoidal signals, to have more variety
> you need more samples per period, so either lower signal
> frequency or higher DAC clock. So you may end up with
> much higher DAC freqency and censequenty be forced to
> use FPGA.

Yes, this is understood. Read the 10 MHz as bandwidth, not as the max
frequency at which a complex waveform should be generated. So the
waveform will degrade to a sine when sped up to 10 MHz.

> As I wrote earler, skimming bits on phase accumulator seems
> unwise, it is at most one instruction in critical loop
> in CPU realization and has _much_ smaller impact on
> FPGA (think about size of your tables, single counter
> is tiny compared to that).

FPGA have memory blocks to hold such tables. A simple ripple counter
will indeed take a tiny amount of logic, a synchronous counter will take
more, certainly at 55 bits. But I think you need an adder if you want
variable accumulator steps and not only +1. Keeping the adder small
enough to fit in something like a 48-bit DSP slice will probably save
space.

The above is probably quite Xilinx specific, as that is the last FPGA I
have experience with. And even that was a while ago.

But again, I may be worrying too much about space already. When it comes
to it, I should first implement the 'best' solution. And then probably
find that this uses less than 10% of my FPGA. :-)

--
Stef

Don't shout for help at night. You might wake your neighbors.
-- Stanislaw J. Lem, "Unkempt Thoughts"

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor