#### dkumar

##### Member level 3

**snr calculation**

HI all,

I need some clarification on calculating SNR/SNDR.

I did cadence simulation of a sample and hold circuit and then took the FFT of the output. ( i did that keeping in mind the proper method of dealing sample data FFTs)

now i want to calculate the SNR/SNDR and i want to use matlab. I have following confusion.

(i save the FFT in .csv file)

1.As my data output is from sample and hold it is just sampled and not quantized.To calculate the SNR/SNDR so i need to quantize it? like to 0/1?

2.If no, i can then use the FFT output ( that is in dBs) directly or should i convert all the data back to non-dB format then use them?

3.If i use the direct dB format i plan to do the following for SNDR:

a. take the max. value ( will be my signal)

b. sum all the other dB values and remove signal from the sum.

c. Take the difference.

but this doesnt seem correct to me as it would give really a bad SNDR since all the noise summed values will be huge summation and signal component will be just a small number.

4.So, when i plan to convert the dB to non-dB (using 20*log(non-dB)) then i plan to do following for SNDR:

a.again take the maximum

b.sum all the other values and remover the signal from the sum.

c.divide the maximum by the sum. and then convert to dB.

this was all for SNDR.

for SNR, i have to remove the distortion components. So , if my circuit is fully differential , can i just remove all the odd harmonics from the signal band and then do the same as above.

------------------------

on the second though: i read somewhere, someone used fourier and fourier2ch instances in analogLib in cadence for calculation of THD and SNDR. if you have any idea about these components please help me understand them as well.

thanks and looking for reply.