analysis software

I have a little problem and could use some FFT-type analysis software.

We want to digitally generate programmable-bandwidth, lowpass/bandlimited Gaussian noise, at constant amplitude. What we have is a 4096-point, 16-bit wide RAM feeding a DAC, clocked by a DDS based address generator (phase accumulator) running at 128 MHz.

What I'd like to do is load the ram with a snippet of a bandlimited gaussian noise pattern corresponding to, say, 1 volt RMS at the dac output. I can generate the 4096 data points on a PC, and copy the data into my embedded assembly language program, which can in turn load the noise pattern into the ram when my user decides he wants noise on one channel (it will also do standard waveforms and arb.) The DDS phase accumulate value "plays" the waveform at a variable rate, setting the noise bandwidth.

Since the waveform will be played continuously, I don't want a "seam" at the transition from ram address 4095 to 0. It's sort of like a

360-degree panoramic photograph with no seam anywhere.

My thinking is this:

Using some software tool, PowerBasic or one of the math things, define an array of 4096 floats. Load the array with random numbers in the range -1 to +1.

Now make a pass through all entries, applying a weighting function such as to change the probability distribution from flat to nearly Gaussian, with some reasonable crest factor. (I'm not sure this step is necessary.)

The points now look like hell, as they have no adjacent-point correlation; they need to be lowpass filtered.

Filter the points as follows: look at the data as an input array arranged as a ring instead of a linear vector. Create an null output array. Now we want to lowpass filter the input ring array into the output array seamlessly. Two ideas:

  1. Define a lowpass response as a FIR filter, determine its coefficients, and walk that filter (envision it as a arc-section of a circle) around the input ring, one step at a time. At each step, do the multiply-accumulate (convolution) thing and poke the resulting value into the output array.

  1. Simulate a single-pole lowpass filter as out = out + (in-out)/K. "Connect" it to the input data ring, walk it around one loop to "charge it up", then walk around another loop, with the "out" value now loading the output loop.

Lastly, I can normalise the output array to 1 volt RMS, remove any residual DC component, and quantize to 16 bits.

So I can code this without much trouble, and come up with some candidate algorithms and coefficients. I can export the data as a csv or whatever. What I need is a nice, easy-to-drive frequency analysis program, a fun Windows FFT utility. Any suggestions?

I'm thinking also that my "noise" spectrum will be a bunch of lines, not continuous, because my waveform is actually periodic. So we might somewhat randomize the DDS input frequency value to smear the lines in the frequency domain, jittering the waveform in the time domain. The effects of this needs to be analyzed, too, so the datasets may get large. Worst case, we could do the experiment all in hardware and use a real (classic, sweeping) spectrum analyzer.

Or maybe we need another algorithm for digitally generating bandlimited Gaussian noise. This one does fit our existing ARB architecture with minimal damage... we have a pipelined ARB architecture that we'd rather not trash much.

Ideas?

John

Reply to
John Larkin
Loading thread data ...

The process that you suggest in points 1 and 2 don't require an FFT, yet an FFT would be just the thing to use.

The FFT math is appropriate for a periodic signal, so if you use

4096-point set of completely random data, do an FFT, band limit it by multiplying it point-by-point with your filter envelope, then do an IFFT, you'll get perfectly bandlimited but periodic data.

If you're clever you can eliminate the initial FFT step by generating a

2048-point set of complex numbers then reflecting it with 2048 complex conjugates (except for point 1 and point 2049, which will be all real). Then your inverse transform will be real, within the precision of your FFT algorithm.

You can do all of this with Scilab

formatting link
It's a general-purpose math package like MatLab. Unlike MatLab it's free. The user interface is obscure, and the help is dismal, but it's a tremendously powerful package

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

[...snip...]

No one is all that concerned with your "thinking." The de facto standard for doing this sort of thing for the past 21 years is described in Gaussian White-Noise Generation for Digital Signal Synthesis, Kafadar,.K, IEEE Trans. Instrumentation and Measurement, Vol. IM-35, No.

4., Dec. 1986, 492-495. This paper is referenced all over the place and the implementation breaks down into about a six line MathCad program to produce the sample set.
Reply to
Fred Bloggs

I am. My co-workers and employees are. My customers are. Sometimes my wife and my kids are. The cats apparently aren't.

What't the point of having an engineering discussion group if all the responses are "go research the IEEE literature."?

Not being an IEEE member, I don't have access to that paper. Someone, like you, could be kind and email me a copy. However references to it suggest it doesn't address the details of my problem. Just generating a series of bandlimited gaussian signal samples, on a pc, is trivial.

But it looks as if doing it the easy way, loading a bandlimited Gaussian noise waveform into the 4K point arb waveform table, must necessarily make bad noise. The spectrum will have discrete lines at multiples of Fclk/Table_len, which is nasty, and the max/min noise range will be badly limited. It will also be visually periodic, not too impressive. Dithering the DDS clock helps a little but has problems of its own.

So we'll probably use a tapped long-pattern pseudorandom shift register (64 or 96 bits maybe) and post-scramble to zap bit crosscorrelations; XOR gates are free. That gives us random 16-bit numbers with flat probability distribution. If we digitally lowpass filter that, we'll get bandlimited Gaussian noise. If we clock that whole system from the DDS synthesizer, we can set the noise bandwidth

3db point anywhere we like it, mHz to MHz, without affecting RMS amplitude, which is pretty cool.

Our problem now is to squeeze 8 such noise generators into a Spartan3 FPGA, most of whose multipliers have already been used in the DDS and modulators. The filters look like the tricky part, but I have an Evil Scheme for them.

John

Reply to
John Larkin

Sounds like a work around infringement of US6732128...

Reply to
Fred Bloggs

Actually, we considered loading the waveform table with random values and wobulating the dds phase accumulator input to select table entries in a non-trivial pattern. That was one of our many wild ideas in the last week. It turns out to put some adders in a time-critical path (all this stuff runs at 128 MHz) and got complex anyhow, so we decided (as of this afternoon) to ignore the arb memory and generate the noise off to the side, with a pseudo-random shift register and some hashing. We still need to digitally lowpass filter the data to make it Gaussian and define its bandwidth, but that can't be protected by a patent.

All this is bring us back to the Signals and Systems stuff we studied a long time ago, but the math is seriously opaque here. I think we'll justify buying a new spectrum analyzer to check how the final thing really works. Anybody got a suggestion for a nice one? Several people are making portable ones that look like tablet PCs with color LCDs, in the 1-3 GHz range, under $10K maybe. Any comments?

John

Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.