Contents
path(path,'~/working/herbert/lib'); path(path,'~/working/herbert-old/lib');
Warning: Duplicate directory name: /home/tobin/working/herbert/lib. Warning: Duplicate directory name: /home/tobin/working/herbert-old/lib.
Simulte a really huge signal
rstat_mean = 1e-43; rstat_sigma = 1e-45; istat_mean = 0; istat_sigma = rstat_sigma; n_stats = 5000;
Compare the results with and without jitter
% Generate some fake data stats = (randn(n_stats, 1)*rstat_sigma + rstat_mean) + ... j*(randn(n_stats, 1)*istat_sigma + istat_mean); % Apply a time shift and jitter tshift = 0.0e-6; tshift_jitter = 0.5e-6; w0 = 37504 * 2 * pi; sstats = stats .* exp(j * w0 * (tshift + randn(size(stats))*tshift_jitter)); % Show a scatter plot subplot(1,1,1); plot(stats,'.','MarkerSize',1); hold all; plot(sstats,'.','MarkerSize',1); hold off; legend('without jitter','with jitter'); axis equal; grid on;
Plot the distribution of angles
Time jitter broadens the distribution of angles
[n1, b1] = hist(angle( stats),sqrt(n_stats)); [n2, b2] = hist(angle(sstats),sqrt(n_stats)); plot(b1,n1,b2,n2); legend(sprintf('mean = %e\nsigma = %e',mean(angle( stats)),std(angle( stats))), ... sprintf('mean = %e\nsigma = %e',mean(angle(sstats)),std(angle(sstats)))); title('Distribution of angles');
Plot the distribution of magnitudes
Time jitter between frames does not affect the magnitudes of the (intra-)frame statistics.
[n1, b1] = hist(abs( stats),sqrt(n_stats)); [n2, b2] = hist(abs(sstats),sqrt(n_stats)); plot(b1,n1,'-',b2,n2,'--'); legend(sprintf('mean = %e\nsigma = %e',mean(abs( stats)),std(abs( stats))), ... sprintf('mean = %e\nsigma = %e',mean(abs(sstats)),std(abs(sstats)))); title('Distribution of magnitude');
Show what we would estimate
stat = mean( stats); sstat = mean(sstats); plot_circle( stat, [std(real( stats)) std(imag( stats))]/sqrt(n_stats),'-'); hold all; plot_circle(sstat, [std(real(sstats)) std(imag(sstats))]/sqrt(n_stats),'-'); legend('without time shift','with time shift and jitter'); axis equal; grid on; hold off;