This is my first ADC and verifying it is proving to be more difficult then actually designing the sub-blocks.
I have been able to do a transient simulation in cadence (
Spectre) and have successfully imported the data into matlab.
This is where I'm encountering most of my headache.
1) I'm new at matlab
2)All of the fft examples I've seen use as input a time varying signal defined as a function. The data that I have is in a table form: transient output with respect to time.
Do I have to build a function from the data that I imported?
2) In order to familiarize myself with the procedure of getting my SNR I've used an ideal sinusoid as an example and gone all the way up to applying a Hann window to the signal.
I'm hoping someone can help me with these questions:
a) Please refer to the attachment: he last plot, is supposed to be the power spectrum of the windowed signal. Can someone explain to me why there are lot of traces of it. Am I doing something wrong or am I wrong to expect a single trace. I'm basically trying to compare the power of the signal in two cases: windowed (with hann) and unwindowed.
b) Ultimately, I'll be extracting the SNR of my real ADC with a hann window applied to the output. What is the ideal bandwidth that I have to consider to do the SNR measurement in?
Here is my matlab code for the attached results:
fbw=50;%for tutorial example
deltaT=0.001;%time between samples
fs=1/deltaT; %sampling frequency
FFTOSR=64;%extra OSR for fft
NFFT=2048;%size of FFT
t = 0:deltaT:cycle*period;
x = sin(2*pi*fbw*t);%signal to be sampled
y = x;
title(['Sine Wave f=', num2str(fbw), 'Hz']);
%FFT and plots
Y = fftshift(fft(y,NFFT));
title('magnitude of FFT');
Pyy = (abs(Y).^2) / (NFFT*L);
title('power over entire spectrum unwindowed');
%Apply Hann window
%FFT of Hann windowed signal and plot
Pvv = abs(V.^2) / (NFFT*L);
title('power over entire spectrum with hann window');