The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Sep 27th, 2024, 12:30am
Pages: 1
Send Topic Print
FFT for high accuracy DSM (Read 5108 times)
RobG
Community Fellow
*****
Offline



Posts: 570
Bozeman, MT
FFT for high accuracy DSM
Sep 26th, 2012, 5:39am
 
I have a 3rd order single bit DSM with an OSR of 267. There is a zero in the NTF at the signal of interest. Some times when I simulate I can get the noise floor down 100dB. Other times the noise floor is closer to 80dB or less.

The problem does NOT appear to be the ADC, but rather aliasing of the data. Basically the bit stream is not symmetric, and the higher frequency noise gets folded back and fills in the low frequency bins. This is explained in Schrier's "green book." It even happens with a matlab model at times.

Using a Hamming window helps a lot. I can often get improvement by changing the starting and ending points, but the improvement isn't always as great as I'd like to see.

How do you guys simulate these circuits to get such good noise floors? Maybe zero the input at the beginning and end, which would do something like windowing - making the beginning and end look similar.

Back to top
 
 
View Profile   IP Logged
nrk1
Community Member
***
Offline



Posts: 81

Re: FFT for high accuracy DSM
Reply #1 - Sep 26th, 2012, 7:18am
 
You have to use a window to get any reasonably accurate spectra with DSMs because the spectral density varies by a great deal.

Hann window is better than Hamming. BlackmanHarris is even better, but you lose 9 bins for each tone as opposed to 3 in Hann.

You have to use a long enough record so that you get enough points in the signal band(For 50 points in the signal band, you need 2OSR*50 ~ 2^15 FFT length) and enough of these records must be averaged. I guess you'd have to simulate for 2^18+ points and average 8 times to get the PSD uncertainty sufficiently down. With system level simulation this is OK, but with circuits, you probably have to compromise with the number of points in the signal band or number of averages.

Of course you make the input fall on one of the FFT bins so that there is no signal leakage to neighboring bins.

Back to top
 
 
View Profile   IP Logged
Vladislav D
Community Member
***
Offline



Posts: 76
The Netherlands
Re: FFT for high accuracy DSM
Reply #2 - Sep 26th, 2012, 1:00pm
 
There is no need to use a window when you r doing simulation since you can precisely define all the input variables for fft. To avoid artifacts what you need is:
1. 2^N number of FFT points
2. The integer number of periods
3. The fft point should be equally spaced in the time
4. Input frequency should not be a multiple of a sampling frequency (Fs)
Example:
Let's say, Fs=16MHz and you want to take 2^10 points. Then, the simulation time will be Tsim = (2^10) / Fs = 64 us. Then, the input frequency is n/64us, where n is the number of periods.
Importantly, that a simulator should save data points exactly at the particular moment of time. In the example above, every 62.5ns. You should specify it in the simulator's options.
Back to top
 
 
View Profile   IP Logged
RobG
Community Fellow
*****
Offline



Posts: 570
Bozeman, MT
Re: FFT for high accuracy DSM
Reply #3 - Sep 26th, 2012, 1:45pm
 
4096 points is as far as long as I can simulate.

I think I'm doing what Vladislav is saying: Fclk=16MHz, 4096 points, 13 cycles so Fin=16e6*13/4096.

Unfortunately this is giving me the problem I'm having.

nrk1: In cadence AWD calculator I have Blackman available (not blackman harris), but no Hann. What do you mean by losing 9 bins? Can I still evaluate a two-tone test properly? With my hamming window they adjacent 3 bins appear to be averaged.
Back to top
 
 
View Profile   IP Logged
Vladislav D
Community Member
***
Offline



Posts: 76
The Netherlands
Re: FFT for high accuracy DSM
Reply #4 - Sep 26th, 2012, 11:42pm
 
RobG wrote on Sep 26th, 2012, 1:45pm:
4096 points is as far as long as I can simulate.

I think I'm doing what Vladislav is saying: Fclk=16MHz, 4096 points, 13 cycles so Fin=16e6*13/4096.

Unfortunately this is giving me the problem I'm having.

nrk1: In cadence AWD calculator I have Blackman available (not blackman harris), but no Hann. What do you mean by losing 9 bins? Can I still evaluate a two-tone test properly? With my hamming window they adjacent 3 bins appear to be averaged.


What about fft points steps? Are they equal? In spectre this is parameter, called strobeperiod. It should be 1/Fs
Back to top
 
 
View Profile   IP Logged
RobG
Community Fellow
*****
Offline



Posts: 570
Bozeman, MT
Re: FFT for high accuracy DSM
Reply #5 - Sep 27th, 2012, 3:57am
 
yes, strobe period is 1/Fclk (actually 0.1/Flck)
Back to top
 
 
View Profile   IP Logged
nrk1
Community Member
***
Offline



Posts: 81

Re: FFT for high accuracy DSM
Reply #6 - Sep 29th, 2012, 8:58pm
 
Vladislav D wrote on Sep 26th, 2012, 1:00pm:
There is no need to use a window when you r doing simulation since you can precisely define all the input variables for fft.  


This is correct for a Nyquist rate converter(more precisely, for evaluating a noise PSD that varies *less* steeply than the leakage sidelobes of the window), but not a noise-shaped one. The problem is not the leakage of the signal. By ensuring that the input is in one of the FFT bins(integer multiple of fs/nfft), signal leakage is avoided. But, the quantization noise, which is orders of magnitude higher out of band than in band will leak into the signal band. This can be easily seen by simulating a DSM in matlab and computing the PSD with and without a window.

http://www.ee.iitm.ac.in/~nagendra/shanthi_lectures/EE658/EE658_Lecture_43/EE658... has a description of this.

Vladislav D wrote on Sep 26th, 2012, 1:00pm:
... that a simulator should save data points exactly at the particular moment of time. In the example above, every 62.5ns. You should specify it in the simulator's options.

The output is digital. So taking successive output samples will automatically ensure this. But the FFT must not be taken on the voltage values, but the quantized voltages so that the PSD is a true representation of the digital output.

RobG wrote on Sep 26th, 2012, 1:45pm:
nrk1: In cadence AWD calculator I have Blackman available (not blackman harris), but no Hann. What do you mean by losing 9 bins? Can I still evaluate a two-tone test properly? With my hamming window they adjacent 3 bins appear to be averaged.


RobG: In the FFT interface, it is called cosine2, I think. Anyway, I prefer PSD instead of FFT-gives the plot from 0 to fs/2 and can also do averaging(FFT is taken of length "windowsize" and averaged if the record length is more than that). In that it is called Hanning. What I meant is, just like the Hann window spreads a sinusoid on a bin to two adjacent bins, blackmanharris will do it to 8 adjacent bins(4 on either side).

4096 is too few for the high OSR you have. You have 8 points in the signal band, and will lose two to dc offset and three each to the signal and its harmonics. You can hardly see the in-band noise. You can try putting the input signal just out of band so that you can see the in-band noise spectral density.
Back to top
 
 
View Profile   IP Logged
RobG
Community Fellow
*****
Offline



Posts: 570
Bozeman, MT
Re: FFT for high accuracy DSM
Reply #7 - Sep 30th, 2012, 8:43am
 
Thanks nrk1. Wish I could do longer sims, but with extracted runs it isn't feasible. It also seems that the aliasing problem is worse with more data points.

Ironically the best results I got were with a top-level extracted sim at default conservative tolerances. The signal band is filled into 20dB higher when running tighter tolerances or more ideal subcircuits.
Back to top
 
 
View Profile   IP Logged
nrk1
Community Member
***
Offline



Posts: 81

Re: FFT for high accuracy DSM
Reply #8 - Oct 1st, 2012, 8:12pm
 
RobG wrote on Sep 30th, 2012, 8:43am:
Thanks nrk1. Wish I could do longer sims, but with extracted runs it isn't feasible. It also seems that the aliasing problem is worse with more data points.

Strange. With Hann window? With a longer sim, you can try taking PSD of different sections of shorter data and diagnose what happens.

Yes, it is quite difficult to get more points with extracted sims. I have had success with moderate preset tolerance for extracted sims, but for a lower OSR and SNR. You have to experiment and see. Will take time, but saves a lot of time if it works. Anyway, an input just out of band and Hann window seems to be the best option.

RobG wrote on Sep 30th, 2012, 8:43am:
Ironically the best results I got were with a top-level extracted sim at default conservative tolerances. The signal band is filled into 20dB higher when running tighter tolerances or more ideal subcircuits.

Not sure why tighter tolerances made it worse. But ideal subcircuits sometimes can do this. e.g. DAC without a transition filter to clean up the pulse shape etc.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.