The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Aug 19th, 2024, 11:13am
Pages: 1
Send Topic Print
the problem about calculating SNR (Read 3233 times)
hslsc311
New Member
*
Offline



Posts: 5
beijing
the problem about calculating SNR
Jan 07th, 2013, 12:46am
 
hello,dear all
   i am simulating a delta sigma modulator, i apply a sinusoidal signal,and get the output bitstream, now i want to calculate the SNR of the modulator with the code provided by schreier. however ,but i am confused about the code on the attachment.
   the code says inband_bins=0:N/(2*OSR), i thoutght N/(2*OSR) is the bin which input signal frequency lie in since the input signal has only one frequency, am i right ? but where does fbin come from ? the code says fbin=11, why ? Sad
Back to top
 

3_001.png
View Profile hslsc311   IP Logged
sheldon
Community Fellow
*****
Offline



Posts: 751

Re: the problem about calculating SNR
Reply #1 - Jan 8th, 2013, 11:59am
 
hslsc311,

  You should probably start from the other way around, what are you
interested in learning from the FFT.
1) Do you want to know the THD of the design?
2) Do you want to know how oversampling effects the quantization
   noise floor?

The answer to 1 & 2 effects the number of tones in the signal band
and ultimately the number of bins in the FFT. Next, you need to
understand that you will be using windowing, the cosine^2 window
most likely. So you will to allocate additional bins because
windowing will spread the signal across multiple FFT bins.

In case of #1 above, assume that you would like to see the first
five harmonics, fundamental + 4 harmonics. Then you will need
2 FFT bins for dc
2 FFT bins for the fundamental
2 FFT bins for each harmonic
or you would like 12 FFT bins in the signal band. Then you would
like to oversample the signal band by 64 times. Since the math
works out best when the FFT is a power of two, you will 16*64
FFT bins (points) or 1024 points in the FFT.

For case #2
If you look in Appendix C of Schreier, he talks about the need to have
a large ratio of noise to signal when calculating SNR. As I remember
his recommendation is 10x more noise bins. So instead of 12 FFT
points in the signal band, you will need 120 points. Rounding up to
128 FFT points, the total number of FFT points is 128*64 points or
8,192 points.

NOTE:
Case #2 only covers the effect of quantization noise. If you really
want to consider the effect of device noise, that is, run a transient
noise analysis, then  you will need to run a power spectral density
analysis and it will require even more points in the FFT.

                                                                     Hope this helps,

                                                                         Sheldon
Back to top
 
« Last Edit: Jan 8th, 2013, 3:03pm by sheldon »  
View Profile   IP Logged
sheldon
Community Fellow
*****
Offline



Posts: 751

Re: the problem about calculating SNR
Reply #2 - Jan 8th, 2013, 3:51pm
 
Maybe the simpler way to say it is,

 You are oversampling the signal band, not just the fundamental
frequency. So you need to select the number of points in the FFT
based on both of these criterion.

                                                                 Best Regards,

                                                                    Sheldon

Back to top
 
 
View Profile   IP Logged
hslsc311
New Member
*
Offline



Posts: 5
beijing
Re: the problem about calculating SNR
Reply #3 - Jan 8th, 2013, 5:50pm
 
hello ,sheldon, thanks for your replies!and that helped.
however ,there is still a problem:i build a first order single bit sigma delta modulator with real circuit (OSR=128;N=64*128),but the SNR calculated from the output bitstream is 113dB which is unreasonable, i already windowed the bitstream,and the input signal frequency lies in the prime bin(11), the code followed schreier's.  what is wrong with my calculating ?
Back to top
 
 
View Profile hslsc311   IP Logged
hslsc311
New Member
*
Offline



Posts: 5
beijing
Re: the problem about calculating SNR
Reply #4 - Jan 8th, 2013, 7:59pm
 
and then i reduced the amplitude of the input signal, the SNR becomed 97dB,this is wired, why ?
Back to top
 
 
View Profile hslsc311   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.