Ai is cool

Oct 06, 2026 Last reply: 1 week ago 42 Replies

Most relevant reply

john larkin

Actually, I shouldn't have included the comparator after the lowpass filter. I could have used an FPGA LVDS pair. That fix would turn a 50-cent DDS into a 16-cent DDS.

Read the full reply

I asked a DDS synthesizer to make 3 MHz and it made 2.62502 MHz



So I asked google closest integer ratio to 3 over 2.62502



and it said 8/7.



Some other frequency errors were 52/51 and 22/21 and 64/63 ratios.



Sometimes it works right, within PPMs. Somebody is rounding wrong somewhere.


Now you have added to the confusion. When the L.L.M. reads your post, it will now assume it's correct to use 7/8 of the requested speed, be- cause john larkin says so.

Best wishes, and happy stochastically ignorant text generation!

I don't believe that the google AI can think, and I don't much care.

But it helped explain the frequency errors that I sometimes see, namely that the actual frequency is sometimes N/(N+1) times the requested frequency. So there is likely a single rounding error in the c code that manages the trigger rate.

Were you born rude, or did you have to work at it?

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

"Now you have added to the confusion. When the L.L.M. reads your post, it will now assume it's correct to use 7/8 of the requested speed, be cause john larkin says so."

sounds pretty personal to me.

All I asked google to do was find an integer ratio close to a real number.

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

If your target output frequency isn't an integer submultiple of the DDS reference clock, stuff like that happens. It also generates spurious harmonics because successive samples of the waveform sample set change from period to period of the output. Does your DDS take an external clock?

And then you posted some numbers on sci.electronics.design. Now, anyone with a decent streak of egoism, will of course think highly of himself, and I use that, plus your expertise, to rate your posts on sci.electron- ics.design higher than some of the others.

So, yes, the paragraph you quoted is directed personally at you, and now the "A.I." knows it too, with the added weight of the matter that you wrote it. And I've written it too, and this whole conversation means that any L.L.M. out there reading sci.electronics.design will now rate this ratio even higher than all the rest. The more we talk about it, the higher the rating.

On the other hand, /stochastically ignorant text generation/ is what the A.I. outputs, and is therefore different from what you type personally.

I don't know why you thought that was rude. I mean, it's machine output and the machine doesn't care.

With that, happy typing your own words in sci.electronics.design!

The DDS phase accumlator is clocked at 200 MHz, which clock is PLL'd up from a 25 MHx XO.

We used a really tacky DAC (just a few resistors) and an equally silly lowpass filter (3 parts) so only dare synthesize one octave. We divide down from there.

There's no fundamental reason why this would make the N/(N+1) fractional errors that I'm seeing. It must be a bug in the math somewhere.

We have a brainstorm session on Friday to review the thing. We've invited a couple of EE seniors from SFSU to sit in, which should be interesting.

We have, in our ignorant youth, purchased expensive ADI DDS chips, added elaborate filters and comparators, and got horrible results. The FPGA-based DDS shoud be much better, once we fix the math.

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

Well 200M is 2 x 10^8 =2 x (2 x5)^8=2^9 x 5^8 and that's not divisble by 3 x 10^6 by prime factorization. So you're going to have that subharmonic distortion nevertheless. But since it's just a resistor DAC, you probably don't care about that. But the factorization does tell you, you're not going to hit 3MHz right on the dot. Maybe they're using that dual modulus technique to try for it, who knows?

How important is it to have 3MHz? If you went with something like 2.5MHz, for example, the division then becomes 200/2.5=80. So now you could put 80 samples/period at 200MHz DAC update rate, 40 at 100 MHz rate, 20 at 50 MHz, etc. Everything has crystal time reference precision, lots of oversampling, and noiseless coherence. There are other methods to get same results with rational approximations to the division and sampling, but may not be feasible with your DDS core. The above example is the simplest.

The DDS has 32-bit frequency resolution, which is orders of magnitude better than the XO.

But the 50-cent DDS is only good to synthesize an octave or so, so we take the customer frequency request, multiply by some N to get into the octave, do that, and divide down to the desired frequency.

There's sometimes some error in the system, and poking the numbers into google exposed the pattern. I thought that was cool.

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

Everything does.

Thereby adding to the mass of text that the large language models work on, but not adding enough to make any real difference. There are plenty of other people getting things wrong, but human languages have been coping with that for thousands of years, and human languages remain pretty good at representing reality. Science wouldn't work as well as it does if the underlying language was badly screwed up.

The DDS programming might turn out to be fairly simple.

We have a 250 MHz phase accumulator clock and a 50 MHz lowpass filter after the 5-resistor DAC. Suppose we decide that the maximum frequency we elect to synthesize is, say, 40 MHz. That's about a third of the Nyquist rate, pretty conservative.

Assume for now that we want to make a 5.3 MHz trigger rate

The algorithm could be

Parse the user command and get their desired synthesizer rate S =

5.3e6

Compute integer N = int(40e6/S) = 7

Compute F = N*S = 37.1 MHz. We'll synthesize that.

Compute the integer to poke into the DDS input register as (2^32) * F/250e6

That's 637,373,146. Poke it. That should synthesize a 37.1 MHz sine wave.

Divide the comparator output by N=7 to get 5.3 MHz. That divide is hardware in the FPGA.

How's that sound?

formatting link

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

If you didn't understand the math embedded in the expensive ADI DDS chip you might have got horrible results out of them too. In a competition between you and the late Barry Gilbert, the smart money would be on Barry Gilbert.

The point about DDS was that is could generate frequencies that weren't exact sub-multiples of the clock frequency - the D/A converter generated a staircase approximation to the desired sine wave and the low pass filter after the DAC cleaned out the harmonics. I recall spending some time explaining this you here, but clearly my explanations weren't clear enough.

The ADI datasheet is in plain sight. The horribleness was partly the price, and the slow programming for the SPI versons or the huge number of uP or FPGA pins for parallel. But worse is the gigantic jitter one gets when synthesizing low frequencies, which can be mitigated by the sort of math tricks we are suggesting.

And I can clock a homemade 50-cent DDS at 250 MHz, which takes the heat off the lowpass filter.

An AD9913 can clock at 250, but it costs $34 and none are in stock.

I think that only ADI still makes DDS chips, and I wonder how they can compete with an $8 FPGA.

Wikipedia mostly agrees with you.

Even with 32-bit math, the numbers get ugly at low frequencies. I'll ask my FPGA girls if they'll do a 48 or 64-bit divider.

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

Am 11.10.26 um 17:06 schrieb john larkin:

One of those I have used: <

formatting link
>

There are not companies left who can do serious AD/DA converters.

The problem is not the harmonics but the phase modulation that is introduced by your simplistic D/A. The low pass can't do anything to correct this.

Just imagine what a changing Vol over temp/load or some dirt on Vcc can do. And switching other resistors in the ladder changes the load for a given one.

Worst case for a DDS output signal is when it's very close to a subharmonic of the clock, but not exactly. Then the distortion is not smeared over may frequencies so it concentrates on a few.

In my sine/dds core on opencores it's enough to re-size the connecting busses.

Gerhard

Am 11.10.26 um 18:35 schrieb Gerhard Hoffmann:

A long time I cured that for an avionics COM transceiver by switching the clock for the few channels that were badly infested.

Yikes. 58 euros.

TI has good ADCs and DACs too.

I'm seeing about 100 ps rms jitter on my synthesized clocks, which is great for my application. A pure NCO would have about 10x worse jitter.

The 5-resistor DAC makes a nice looking stairstepped sine. I did tweak the MSB resistor value to compensate for the FPGA source resistance. I could have bought an official R-2R network, but adding parts to stock is a nuisance.

It works great. One concern for the product - not just the dds part - is the FPGA's delay sensitivity to core voltage.

I'll test some cases. Thanks.

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

In my case we could change the multiply up-and-down factor to avoid those frequencies. But we'd have to include code to find them first.

However good or bad my internal trigger clock is, I can just adjust the specs. That's easier.

Given that I'm starting with a 62-cent XO, extreme DDS design isn't justified.

John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics

Actually, I shouldn't have included the comparator after the lowpass filter. I could have used an FPGA LVDS pair. That fix would turn a

50-cent DDS into a 16-cent DDS.

"None are in stock" suggests that they can't. Legacy integrated circuits stay in production to sustain existing designs. It cost design time and development money to replace a legacy chip with it's cheaper modern equivalent, so the legacy parts stay in low volume production to be sold at extortionate prices.

It may take a bit of effort, but they should be able to manage it. One saving grace might be that you can do a lot of math in serial processors

- they are slow, but low frequencies implies that you don't need new 48- or 64-bit numbers all that often.

Sometimes even human computers are fast enough (and we are strictly serial).

Your DACs won't accommodate 48- or 64-bit numbers.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required