Skew measurement with phase deviation

5 visualizzazioni (ultimi 30 giorni)
Bandw W
Bandw W il 11 Set 2019
I am calculating the standard deviation of skew (= phase/2*pi*fin) from the 1000 monte carlo runs of the following code.
In the y0, there is no input skew., but in y1 there is a skew present. Its this skew that i am measuring at the output of the FFT through phase diffrence calculation
clear skew_vector
clear mean_skew
clear SD_skew
clear phase_vector
k=0;
for f_tone=1:1:23
k=k+1;
mc=1000; % Monte carlo
clear spur_db_vector;
clear Ydb_with_filter;
clear Y;
clear y;
clear variation_input_db_y0;
clear variation_input_db_y1;
clear variation_input_phase_y0;
clear variation_input_phase_y1;
for m=1:mc
Fs=100e6; % sampling frequency changed depending on the individual ADCs
Ts=1/Fs;
NFFT=2^13; % number of samples
Runtime=(NFFT-1)*Ts;
t=0:Ts:Runtime; % signal directly sampled at 100 MHz
y=zeros(1,length(t));
% % Gain
g=1;
% % input frequency indexing
input_wanted=f_tone*1e6; % INPUT FREQUNECY tone
factor=Fs/NFFT;
bin=round(input_wanted/factor);
fin=bin*factor;
fin_MHz=fin/1e6;
dt=[0 28e-12]; % timing mismatch
%BW and SNR values
BW= 22.5e6;
SNR=abs(-127 + 10*log10(BW));
%Noise Calculation
SNR_linear=10^(-SNR/10);
noise_power_linear=SNR_linear;
SD=sqrt(noise_power_linear);
noise0=randn(1,NFFT)*SD;
noise1=randn(1,NFFT)*SD;
% noise0=0;
% noise1=0;
% %Time Domain Signals with thier offsets
y0=g.*cos(2*pi*fin*(t+dt(1)))+noise0;
y1=g.*cos(2*pi*fin*(t+dt(2)))+noise1; %both time axis are same (no TI)
% %Calculate Spectrum of y0
Y0 = (fft(y0,NFFT)/NFFT);
% %Calculate Spectrum of y1
Y1 = (fft(y1,NFFT)/NFFT);
input_fft_index=round(input_wanted/factor)+1 ;
difference_vector=Y1./Y0;
phase_vector(m)=angle(difference_vector(input_fft_index));
end
skew_vector_ps=phase_vector.*1e12./(2*pi*fin);
SD_skew(k)=std(skew_vector_ps);
mean_skew(k)=mean(skew_vector_ps);
end
x_vec=1:1:23;
plot(x_vec,SD_skew)
xlabel('Frequency (MHz)')
ylabel('S.Deviation of Skew (ps)')
grid on
hold on
plot(x_vec,mean_skew)
My question is . .why is standard deviation of the skew (SD_skew) different at different input frequencies (f_tone) and why is it dependent on NFFT number as well ? My mean is correct ( same as timing mismatch)
Shouldn't the standard deviation remain constant ? Its smaller at higher input frequencies.
Thanks

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by