The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design >> Analog Design >> the problem about calculating SNR https://designers-guide.org/forum/YaBB.pl?num=1357548367 Message started by hslsc311 on Jan 7th, 2013, 12:46am |
Title: the problem about calculating SNR Post by hslsc311 on Jan 7th, 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 ? :( |
Title: Re: the problem about calculating SNR Post by sheldon on 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 |
Title: Re: the problem about calculating SNR Post by sheldon on 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 |
Title: Re: the problem about calculating SNR Post by hslsc311 on 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 ? |
Title: Re: the problem about calculating SNR Post by hslsc311 on Jan 8th, 2013, 7:59pm and then i reduced the amplitude of the input signal, the SNR becomed 97dB,this is wired, why ? |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |